Re: [FFmpeg-user] framerate conversion with sync audio

2016-10-13 Thread Carles Vila
>
> > How can I apply the same filter to all audio streams?
>
> You use -filter_complex instead of -vf and -af
>
> -filter_complex
> [0:0]setpts=PTS*0.8[v];[0:1]asetrate,aresample[a0];[0:2]
> asetrate,aresample[a1]
> and then -map [v] -map [a0] -map [a1]
> (untested)
>

After a couple of attempts, it works! But I keep using the -r 25 option
before -i. It works just fine for me.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] framerate conversion with sync audio

2016-10-12 Thread Steve Boyer
On Tue, Oct 11, 2016 at 5:00 PM, Steve Boyer  wrote:
>
>
> Have you tried experimenting with the audio filter "atempo"? I'm guessing
> here, but try:
>
> ffmpeg -i ... -af atempo=0.96 
>
> (24/25 = 0.96)
>
> Wow, I messed that one up completely. Incorporating Carl's suggestion as
well of -vf setpts, the filter chain should look something like:

ffmpeg -i  -vf setpts=PTS*0.8 -af=atune=25/24 

or if -r works for you:
ffmpeg -r 25 -i  -af=atune=25/24  

Just a heads-up: on a test clip, looks like using -ss and -r before -i
causes frame-sync issues, so if you were wanting to skip forward into your
test clip, make sure to use -ss after -i .


> ~Steve
>
>
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] framerate conversion with sync audio

2016-10-12 Thread Carl Eugen Hoyos
2016-10-11 23:25 GMT+02:00 Carles Vila :
> Hi, I'm trying to perform framerate conversion of a video, from 24fps to
> 25fps to be precise.
> The source is  mov, ProRes with multichannel audio at 48kHz.
> It is mandatory for my application to preserve the integrity of all frames,
> i.e. no frame-interpolation or duplication should occur.

Then use the setpts filter, the input option -r tends to be unreliable.
Although using setpts means you have to take care if audio and
video start at the same time.

Or to say it differently: setpts is recommended, if r works for you,
all the better!

Since you change the video length, you have to change audio
speed, I don't know if asetpts is an alternative to atempo.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] framerate conversion with sync audio

2016-10-11 Thread Steve Boyer
On Tue, Oct 11, 2016 at 4:25 PM, Carles Vila  wrote:

> Hi, I'm trying to perform framerate conversion of a video, from 24fps to
> 25fps to be precise.
> The source is  mov, ProRes with multichannel audio at 48kHz.
> It is mandatory for my application to preserve the integrity of all frames,
> i.e. no frame-interpolation or duplication should occur.
> In other words, just the playback speed should be increased from 24 to 25,
> resulting in a video of slightly shorter duration.
> I've been partially successful so far using the command
>
> ffmpeg -r 25 -i  -r 25 -c:v prores -profile:v 3 -c:a
> pcm_s24le 
>
> This comand produces a good video, shorter than the original, but the
> problem is with audio. As you can imagine, the audio drifts out of sync
> because it has no knowledge of the video framerate conversion.
> My solution now is to process the audio externally, in an audio editor. I
> must apply a sample rate conversion, first forcing the sample rate metadata
> to 50.000 Hz (48.000 *(25/24)) and then resampling at 48.000 Hz
> This shortens the audio by the same amount as the video and can be merged
> to it.
> Is there any way to perform this audio processing within ffmpeg?
> Thanks!


Have you tried experimenting with the audio filter "atempo"? I'm guessing
here, but try:

ffmpeg -i ... -af atempo=0.96 

(24/25 = 0.96)

~Steve
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] framerate conversion with sync audio

2016-10-11 Thread Carles Vila
Hi, I'm trying to perform framerate conversion of a video, from 24fps to
25fps to be precise.
The source is  mov, ProRes with multichannel audio at 48kHz.
It is mandatory for my application to preserve the integrity of all frames,
i.e. no frame-interpolation or duplication should occur.
In other words, just the playback speed should be increased from 24 to 25,
resulting in a video of slightly shorter duration.
I've been partially successful so far using the command

ffmpeg -r 25 -i  -r 25 -c:v prores -profile:v 3 -c:a
pcm_s24le 

This comand produces a good video, shorter than the original, but the
problem is with audio. As you can imagine, the audio drifts out of sync
because it has no knowledge of the video framerate conversion.
My solution now is to process the audio externally, in an audio editor. I
must apply a sample rate conversion, first forcing the sample rate metadata
to 50.000 Hz (48.000 *(25/24)) and then resampling at 48.000 Hz
This shortens the audio by the same amount as the video and can be merged
to it.
Is there any way to perform this audio processing within ffmpeg?
Thanks!


ffmpeg -r 25 -i input.mov -r 25 -c:v prores -profile:v 3 -c:a pcm_s24le
output_25fps.mov
ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.7.2_1 --enable-shared
--enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags=
--enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc
--enable-libxvid --enable-libfreetype --enable-libvorbis --enable-libvpx
--enable-libass --enable-ffplay --enable-libfdk-aac --enable-libopus
--enable-libquvi --enable-libx265 --enable-libopenjpeg
--extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 '
--enable-nonfree --enable-vda
  libavutil  54. 27.100 / 54. 27.100
  libavcodec 56. 41.100 / 56. 41.100
  libavformat56. 36.100 / 56. 36.100
  libavdevice56.  4.100 / 56.  4.100
  libavfilter 5. 16.101 /  5. 16.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale  3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc53.  3.100 / 53.  3.100
Guessed Channel Layout for  Input Stream #0.1 : mono
Guessed Channel Layout for  Input Stream #0.2 : mono
Guessed Channel Layout for  Input Stream #0.3 : mono
Guessed Channel Layout for  Input Stream #0.4 : mono
Guessed Channel Layout for  Input Stream #0.5 : mono
Guessed Channel Layout for  Input Stream #0.6 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mov':
  Metadata:
major_brand : qt
minor_version   : 537199360
compatible_brands: qt
creation_time   : 2016-10-11 12:30:25
  Duration: 00:01:49.04, start: 0.00, bitrate: 150503 kb/s
Stream #0:0(eng): Video: prores (apch / 0x68637061),
yuv422p10le(bt709), 1920x1080, 143548 kb/s, SAR 1:1 DAR 16:9, 24 fps, 24
tbr, 24 tbn, 24 tbc (default)
Metadata:
  creation_time   : 2016-10-11 12:30:25
  handler_name: Apple Alias Data Handler
  encoder : Apple ProRes 422 HQ
  timecode: 00:00:00:00
Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1
channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
  creation_time   : 2016-10-11 12:30:25
  handler_name: Apple Alias Data Handler
Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1
channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
  creation_time   : 2016-10-11 12:30:25
  handler_name: Apple Alias Data Handler
Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1
channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
  creation_time   : 2016-10-11 12:30:25
  handler_name: Apple Alias Data Handler
Stream #0:4(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1
channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
  creation_time   : 2016-10-11 12:30:25
  handler_name: Apple Alias Data Handler
Stream #0:5(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1
channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
  creation_time   : 2016-10-11 12:30:25
  handler_name: Apple Alias Data Handler
Stream #0:6(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1
channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
  creation_time   : 2016-10-11 12:30:25
  handler_name: Apple Alias Data Handler
Stream #0:7(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
  creation_time   : 2016-10-11 12:32:09
  handler_name: Apple Alias Data Handler
  timecode: 00:00:00:00
File 'output_25fps.mov' already exists. Overwrite ? [y/N] y
Output #0, mov, to 'output_25fps.mov':
  Metadata:
major_brand : qt
minor_version   : 537199360
compatible_brands: qt
encoder : Lavf56.36.100