[FFmpeg-user] x264: pixel aspect ratio overriden?

me at renecalles.de me at renecalles.de
Thu Apr 19 15:21:01 CEST 2012


Hi Peter,

is it possible for you to use the -sar option? E.g. -sar 1:1 ?

Best,
René


On Thu, 19 Apr 2012 14:40:38 +0200, Peter B. wrote:
> Hi,
>
> I'm trying to transcode videos for web playback in h264/aac.
> Unfortunately, it's currently not possible in our setup to use the
> display aspect ratio to resize anamorphic sources to 16:9, so my 
> "Plan
> B" was to resize them to have the right aspect ratio with square
> pixels.
>
> What's odd is that when I encode using libx264, the original (5:4
> anamorphic) aspect ratio seems to be stored *somewhere* inside the
> video stream, because players like VLC, WMP or even ffplay play it
> with the old (=wrong) aspect ratio.
>
> When I use the exact same ffmpeg commandline, but choose e.g. FFv1 as
> output codec, the pixel aspect ratio is taken as-is and everything
> works fine.
>
> I'm using ffmpeg v0.7.11 on a Debian Squeeze production system (so
> I'm  kind of locked to that version)
>
> Does anyone have clue what's happening here?
>
> Thank you very much in advance,
> Pb
>
> PS: In order to save cehoyos his standard catchphrase "Please provide
> the complete, uncut console output together with your command line."
> ;), here it goes:
>
> //------------------
> ffmpeg -i client/mpeg-duration/suite/vx-04690_01-026-mencoder.mpg -s
> 500x100 -flags +ilme+ildct -vcodec libx264 -deinterlace -an
> client/flash/test5-h264_aac-PAR1_1.avi
> ffmpeg version 0.7.11, Copyright (c) 2000-2011 the FFmpeg developers
>   built on Jan 28 2012 01:15:36 with gcc 4.4.5
>   configuration: --enable-libdc1394 --prefix=/usr
> --extra-cflags='-Wall -g ' --cc='ccache cc' --enable-shared
> --enable-libmp3lame --enable-gpl --enable-libvorbis --enable-pthreads
> --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab
> --enable-libgsm --enable-libtheora --enable-libopencore-amrnb
> --enable-libopencore-amrwb --enable-libx264 --enable-libspeex
> --enable-nonfree --disable-stripping --enable-avfilter
> --enable-libdirac --disable-decoder=libdirac --enable-libschroedinger
> --disable-encoder=libschroedinger --enable-version3
> --enable-libopenjpeg --enable-libvpx --enable-librtmp
> --extra-libs=-lgcrypt --disable-altivec --disable-armv5te
> --disable-armv6 --disable-vis
>   libavutil    50. 43. 0 / 50. 43. 0
>   libavcodec   52.123. 0 / 52.123. 0
>   libavformat  52.111. 0 / 52.111. 0
>   libavdevice  52.  5. 0 / 52.  5. 0
>   libavfilter   1. 80. 0 /  1. 80. 0
>   libswscale    0. 14. 1 /  0. 14. 1
>   libpostproc  51.  2. 0 / 51.  2. 0
> [mpeg @ 0x8ae15e0] max_analyze_duration 5000000 reached at 5000000
> Input #0, mpeg, from
> 'client/mpeg-duration/suite/vx-04690_01-026-mencoder.mpg':
>   Duration: 00:00:59.96, start: 0.240000, bitrate: 4097 kb/s
>     Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576
> [PAR 1:1 DAR 5:4], 8000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
>     Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 224 kb/s
> File 'client/flash/test5-h264_aac-PAR1_1.avi' already exists.
> Overwrite ? [y/N] y
> [buffer @ 0x8ae3ea0] w:720 h:576 pixfmt:yuv420p tb:1/1000000 sar:1/1
> sws_param:
> [scale @ 0x8ae4000] w:720 h:576 fmt:yuv420p -> w:500 h:100
> fmt:yuv420p  flags:0x4
> [libx264 @ 0x8ae9a60] Default settings detected, using medium profile
> [libx264 @ 0x8ae9a60] interlace + weightp is not implemented
> [libx264 @ 0x8ae9a60] using SAR=1/4
> [libx264 @ 0x8ae9a60] using cpu capabilities: MMX2 SSE2Fast SSSE3
> FastShuffle SSE4.2
> [libx264 @ 0x8ae9a60] profile High, level 2.1
> Output #0, avi, to 'client/flash/test5-h264_aac-PAR1_1.avi':
>   Metadata:
>     ISFT            : Lavf52.111.0
>     Stream #0.0: Video: libx264, yuv420p, 500x100 [PAR 1:4 DAR 5:4],
> q=2-31, 200 kb/s, 25 tbn, 25 tbc
> Stream mapping:
>   Stream #0.0 -> #0.0
> Press [q] to stop, [?] for help
> frame= 1500 fps=108 q=28.0 Lsize=     770kB time=00:00:59.92 bitrate=
> 105.3kbits/s
> video:729kB audio:0kB global headers:0kB muxing overhead 5.697445%
> frame I:6     Avg QP:19.72  size:  6750
> [libx264 @ 0x8ae9a60] frame P:419   Avg QP:22.00  size:  1259
> [libx264 @ 0x8ae9a60] frame B:1075  Avg QP:27.82  size:   165
> [libx264 @ 0x8ae9a60] consecutive B-frames:  0.9%  3.1% 23.0% 73.1%
> [libx264 @ 0x8ae9a60] mb I  I16..4:  9.4% 60.6% 29.9%
> [libx264 @ 0x8ae9a60] mb P  I16..4:  0.1%  0.5%  0.4%  P16..4: 35.0%
> 20.7% 10.8%  0.0%  0.0%    skip:32.6%
> [libx264 @ 0x8ae9a60] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 29.4%
> 1.9%  0.3%  direct: 0.4%  skip:67.9%  L0:37.4% L1:58.8% BI: 3.8%
> [libx264 @ 0x8ae9a60] field mbs: intra: 0.0% inter:0.0% skip:0.0%
> [libx264 @ 0x8ae9a60] 8x8 transform intra:56.5% inter:66.1%
> [libx264 @ 0x8ae9a60] coded y,uvDC,uvAC intra: 78.0% 88.0% 56.5%
> inter: 9.3% 8.6% 0.3%
> [libx264 @ 0x8ae9a60] i16 v,h,dc,p: 71% 17%  1% 11%
> [libx264 @ 0x8ae9a60] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 29% 10%  4%
> 6%  4% 12%  4% 11%
> [libx264 @ 0x8ae9a60] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 25%  7%  3%
> 5%  3% 10%  3%  9%
> [libx264 @ 0x8ae9a60] i8c dc,h,v,p: 40% 36% 15%  9%
> [libx264 @ 0x8ae9a60] ref P L0: 72.8% 14.4% 12.8%
> [libx264 @ 0x8ae9a60] ref B L0: 89.4%  8.4%  2.2%
> [libx264 @ 0x8ae9a60] ref B L1: 92.4%  7.6%
> [libx264 @ 0x8ae9a60] kb/s:99.47
> //------------------
>
>
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list