11

I really like 50fps video, but I cannot make ffmpeg convert it to 50fps for me.

720p resolution is absolutely fine with me, just need more FPS.

50i just looks much smoother in proper players (for example GOM Player deinterlaces video and plays it at 50Hz. Very big difference to 25Hz video.)...

My current command line is:

ffmpeg -i 00010.MTS -threads 3 -filter:v yadif -s "1280x720" -r 50 -b:v 20M output.avi

Here are more video details. Source video is from Cannon HF10 AVCHD camcoder.

ffmpeg -i 00010.MTS -threads 3 -filter:v yadif -s "1280x720" -r 50 -b:v 20M output.avi
ffmpeg version N-37541-g670229e Copyright (c) 2000-2012 the FFmpeg developers
  built on Feb  3 2012 20:14:17 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil      51. 37.100 / 51. 37.100
  libavcodec     54.  0.102 / 54.  0.102
  libavformat    54.  0.100 / 54.  0.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[h264 @ 000000000033FA30] Increasing reorder buffer to 1
Input #0, mpegts, from '00010.MTS':
  Duration: 00:03:13.92, start: 0.482156, bitrate: 16304 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1920x1
080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, s16,
256 kb/s
File 'output.avi' already exists. Overwrite ? [y/N] y
w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[yadif @ 0000000003CE95B0] mode:0 parity:-1 auto_enable:0
[scale @ 0000000003CE9550] w:1920 h:1080 fmt:yuv420p -> w:1280 h:720 fmt:yuv420p
 flags:0x4
Output #0, avi, to 'output.avi':
  Metadata:
    ISFT            : Lavf54.0.100
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x720 [SAR 1:1 DA
R 16:9], q=2-31, 20000 kb/s, 50 tbn, 50 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16, 128 kb
/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (ac3 -> libmp3lame)
Press [q] to stop, [?] for help
frame=   15 fps=  0 q=2.0 size=     945kB time=00:00:00.62 bitrate=12481.3kbits/
frame=   32 fps= 32 q=2.0 size=    2132kB time=00:00:01.30 bitrate=13435.2kbits/
frame=   51 fps= 34 q=2.0 size=    3372kB time=00:00:02.06 bitrate=13409.2kbits/
frame=   70 fps= 35 q=2.0 size=    4641kB time=00:00:02.82 bitrate=13482.8kbits/
frame=   76 fps= 35 q=2.0 Lsize=    5047kB time=00:00:03.06 bitrate=13511.9kbits

5 Answers5

9

Just like interlacing progressive content divides each frame into 2 fields, thus doubling the frame rate, the common method of deinterlacing is to combine each 2 fields into 1 frame, which reduces the rate by 2, thus taking 50 into 25fps. You can of course double each final frame, but that does not provide any benefit.

First, we can read not to use -deinterlace, and yadif instead (which you already do):

 - deinterlace This option is deprecated since the deinterlacing is very low quality. Use the yadif filter with -filter:v yadif. 

You'll probably find the the yadif section of the FFMPEG documentation pretty interesting:

Deinterlace the input video ("yadif" means "yet another deinterlacing filter"). 
It accepts the optional parameters: mode:parity:auto. 

MODE specifies the interlacing mode to adopt, accepts one of the following values: 
‘0’
output 1 frame for each frame
‘1’
output 1 frame for each field 
‘2’
like 0 but skips spatial interlacing check 
‘3’
like 1 but skips spatial interlacing check 
Default value is 0. 

PARITY default value is -1.
AUTO default value is 0. 

Notice how the default MODE is 0, which instructs FFMPEG to ouput 1 frame for each 2 fields, thus halving the fps. I think what you're looking for is MODE 1: one frame per field. I'm not too sure how to use these optional parameters but perhaps something like

-filter:v yadif 1:-1:0 -s "1280x720" -r 50 
mtone
  • 11,700
1

According to the documentation, the -r option sets the output file frames per second. For example, this sets the output to 50 frames per second:

ffmpeg -i input.avi -r 50 output.avi
Just Jake
  • 738
1

ffmpeg -i input.avi -deinterlace -filter:v yadif -s "1280x720" output.avi

Jason
  • 164
  • 4
1

"For most practical cases it is not possible to retrieve a complete progressive video from interlaced content."

Also if you could upload a small sample of the video, it would help your cause tremedously.

Source: mplayerhq.hu/DOCS/HTML/en/menc-feat-telecine.html

Zombo
  • 1
0

This command is working for me:

ffmpeg -i source_50i.MTS -aspect 1920:1080 -vf yadif=1,scale=1920:1080 -c:v libx264 -preset fast -profile:v high -crf 23 -ac 2 -strict experimental -c:a aac -b:a 96k -movflags +faststart -y result_50p.mp4

The source was a Sony camcorder file.