[FFmpeg-user] AVCHD recoding problem

Tisch Dániel tisch.daniel at gmail.com
Sun Jun 5 17:52:19 CEST 2011


Hi,

I want to recode files produced by an AVCHD camera. These are MTSs with 
H.264 video, AC3 audio and PGS subtitle. I am trying to use the 
following command:
ffmpeg -top 1 -i test.mts -vcodec libx264 -top 1 -crf 23.0 -preset 
slower -tune fastdecode -acodec copy -sn -threads 5 test.mp4

My problem is, that x264 encodes video as 50FPS progressive, however it 
is 25FPS top-field-first. I also tried adding -x264opts "tff=1", but 
nothing changed.
What can I do to get correct scan type during the whole process?

I got this output:

ffmpeg version git-N-30558-ge844abc, Copyright (c) 2000-2011 the FFmpeg 
developers
   built on Jun  5 2011 15:41:41 with gcc 4.4.3
   configuration: --arch=x86_64 --enable-shared --enable-gpl 
--enable-nonfree --enable-runtime-cpudetect --enable-libfaac 
--enable-libtheora --enable-libx264 --enable-libmp3lame
   libavutil    51.  4. 0 / 51.  4. 0
   libavcodec   53.  6. 1 / 53.  6. 1
   libavformat  53.  2. 0 / 53.  2. 0
   libavdevice  53.  1. 1 / 53.  1. 1
   libavfilter   2. 12. 0 /  2. 12. 0
   libswscale    0. 14. 1 /  0. 14. 1
   libpostproc  51.  2. 0 / 51.  2. 0

Seems stream 0 codec frame rate differs from container frame rate: 50.00 
(50/1) -> 50.00 (50/1)
Input #0, mpegts, from 'test.mts':
   Duration: 00:01:00.87, start: 1.000033, bitrate: 22363 kb/s
   Program 1
     Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1920x1080 [PAR 
1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
     Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
     Stream #0.2[0x1200]: Subtitle: pgssub
[buffer @ 0xe83a00] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1 
sws_param:
[libx264 @ 0xe76760] using SAR=1/1
[libx264 @ 0xe76760] using cpu capabilities: MMX2 SSE2Fast SSSE3 
FastShuffle SSE4.2
[libx264 @ 0xe76760] profile High, level 5.0
[libx264 @ 0xe76760] 264 - core 115 - H.264/MPEG-4 AVC codec - Copyleft 
2003-2011 - http://www.videolan.org/x264.html - options: cabac=0 ref=8 
deblock=0:0:0 analyse=0x3:0x133 me=umh subme=9 psy=1 psy_rd=1.00:0.00 
mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 
deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=5 
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 
constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 
weightb=0 open_gop=1 weightp=0 keyint=250 keyint_min=25 scenecut=40 
intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=23.0 qcomp=0.60 
qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test.mp4':
   Metadata:
     encoder         : Lavf53.2.0
     Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 
q=2-31, 200 kb/s, 50 tbn, 50 tbc
     Stream #0.1: Audio: ac3, 48000 Hz, stereo, 256 kb/s
Stream mapping:
   Stream #0.0 -> #0.0
   Stream #0.1 -> #0.1
Press [q] to stop, [?] for help
frame=   70 fps=  3 q=31.0 Lsize=    1877kB time=00:00:01.22 
bitrate=12565.3kbits/s dup=36 drop=0
video:1838kB audio:37kB global headers:0kB muxing overhead 0.129483%
frame I:1     Avg QP:24.66  size:244547
[libx264 @ 0xe76760] frame P:30    Avg QP:25.73  size: 46540
[libx264 @ 0xe76760] frame B:39    Avg QP:32.16  size:  6169
[libx264 @ 0xe76760] consecutive B-frames: 21.4%  0.0% 38.6% 40.0%
[libx264 @ 0xe76760] mb I  I16..4:  4.9% 62.3% 32.9%
[libx264 @ 0xe76760] mb P  I16..4:  0.2%  0.5%  0.1%  P16..4: 38.0% 
15.2%  2.1%  0.1%  0.1%    skip:43.6%
[libx264 @ 0xe76760] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 30.3%  
1.6%  0.2%  direct: 1.0%  skip:66.9%  L0:44.2% L1:50.8% BI: 5.0%
[libx264 @ 0xe76760] 8x8 transform intra:62.6% inter:49.6%
[libx264 @ 0xe76760] direct mvs  spatial:94.9% temporal:5.1%
[libx264 @ 0xe76760] coded y,uvDC,uvAC intra: 85.6% 85.6% 44.4% inter: 
11.7% 13.1% 0.1%
[libx264 @ 0xe76760] i16 v,h,dc,p: 39% 11%  4% 46%
[libx264 @ 0xe76760] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17%  9%  5%  8% 12% 
16% 11% 13% 10%
[libx264 @ 0xe76760] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 14%  3%  9% 14% 
15% 13% 10% 11%
[libx264 @ 0xe76760] i8c dc,h,v,p: 41% 17% 25% 17%
[libx264 @ 0xe76760] ref P L0: 60.6% 11.9% 15.8%  3.4%  2.0%  2.5%  
2.4%  1.4%
[libx264 @ 0xe76760] ref B L0: 85.1%  5.6%  5.3%  2.0%  0.7%  0.8%  0.5%
[libx264 @ 0xe76760] ref B L1: 97.1%  2.9%
[libx264 @ 0xe76760] kb/s:10750.62


Thanks!
Daniel


More information about the ffmpeg-user mailing list