[MEncoder-users] -VF FIELD=0 and BFRAMES=3 problem

Bill Crockett wsc4 at optusnet.com.au
Thu Nov 3 11:26:59 CET 2011



On 3/11/2011 7:48 PM, Nicolas George wrote:
> Le tridi 13 brumaire, an CCXX, Bill Crockett a écrit :
>> I decided to experiment with the deinterlace method of extracting
>> and encoding only one of the two fields using -VF FIELD=0.  Being PAL
>> format, I halved the vertical resolution from 720x576 to 720x288
>> using crop and scale appropriately.  The -ovc I use is x264 and with
>> my options setting this has BFRAMES=3.  All this worked well produced
>> a progressive, 25 fps file and plays well in MPlayer.
>>
>> However, when playing the video in other players, the video flickers
>> and jerks as though frames are missing.  After much experimenting and
>> trying different encoding options, I stumbled upon BFRAMES being the
>> problem.  Reducing BFRAMES=0 fixed it.  All players now can play it
>> properly.
>>
>> Using MPLayer, I looked hard but could not see any difference having
>> BFRAMES=3 or BFRAMES=0.  Are they really necessary or is this an
>> MEncoder only problem?
> Please show us your complete command line and the complete output it
> produced (without silencing options).
>
> Regards,
>

This is it:

mencoder stream3.mpg -o stream3_field.mp4 -vf field=0, /
crop=704:272:12:12,scale=750:272,dsize=750/272,harddup /
-nosound -of lavf -lavfopts format=mp4 -ovc x264 -x264encopts /
pass=1:bitrate=768:global_header:frameref=8:deblock=1,0:me=umh:trellis=2 /
:chroma_qp_offset=-2:threads=1:nointerlaced:b_pyramid=normal /
:rc_lookahead=60:partitions=all

Note: x264 options default to bframes=3  For the last line above, 
partitions=all:bframes=0 fixed it.

Output with the default bframes=3 :

VIDEO:  MPEG2  720x576  (aspect 2)  25.000 fps  8000.0 kbps (1000.0 kbyte/s)
[V] filefmt:2  fourcc:0x10000002  size:720x576  fps:25.000  ftime:=0.0400
** MUXER_LAVF 
*****************************************************************
REMEMBER: MEncoder's libavformat muxing is presently broken and can generate
INCORRECT files in the presence of B-frames. Moreover, due to bugs MPlayer
will play these INCORRECT files as if nothing were wrong!
*******************************************************************************
OK, exit.
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [harddup]
Opening video filter: [dsize=750/272]
Opening video filter: [scale w=750 h=272]
Opening video filter: [crop w=704 h=272 x=12 y=12]
Crop: 704 x 272, 12 ; 12
Opening video filter: [field=0]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
==========================================================================
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[swscaler @ 01213434]BICUBIC scaler, from yuv420p to yuv420p using MMX2
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2 Cache64
x264 [info]: profile Main, level 2.2
Pos:   0.0s      2f ( 1%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]

1 duplicate frame(s)!
Muxer frame buffer cannot allocate memory!
Pos:   0.0s      3f ( 1%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]

1 duplicate frame(s)!
Pos:   2.4s     62f ( 7%) 47.15fps Trem:   0min   0mb  A-V:0.000 [0:0]
VIDEO CODEC ID: 28
Writing header...
[mp4 @ 010e0198]Codec for stream 0 does not use global headers but 
container format requires global headers
Pos:  38.7s    970f (99%) 22.59fps Trem:   0min   3mb  A-V:0.000 [689:0]

Flushing video frames.
Writing index...

Video stream:  716.638 kbit/s  (89579 B/s)  size: 3468526 bytes  38.720 
secs  970 frames
x264 [info]: frame I:9     Avg QP:22.87  size: 14468
x264 [info]: frame P:540   Avg QP:26.35  size:  5180
x264 [info]: frame B:419   Avg QP:28.00  size:  1291
x264 [info]: consecutive B-frames: 20.9% 61.2%  9.3%  8.7%
x264 [info]: mb I  I16..4: 40.7%  0.0% 59.3%
x264 [info]: mb P  I16..4: 16.3%  0.0%  0.0%  P16..4: 69.3%  0.0%  0.0%  
0.0%  0.0%    skip:14.4%
x264 [info]: mb B  I16..4:  1.2%  0.0%  0.0%  B16..8: 20.3%  0.0%  0.0%  
direct:13.7%  skip:64.8%  L0:23.2% L1:52.1% BI:24.6%
x264 [info]: final ratefactor: 23.20
x264 [info]: coded y,uvDC,uvAC intra: 48.2% 49.6% 9.0% inter: 25.9% 
16.8% 0.3%
x264 [info]: i16 v,h,dc,p: 17% 43% 26% 14%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 29% 19%  3%  8%  5%  7%  
5% 10%
x264 [info]: i8c dc,h,v,p: 57% 28% 10%  5%
x264 [info]: Weighted P-Frames: Y:10.9% UV:8.7%
x264 [info]: kb/s:716.64

Did you note the above warning:

"MEncoder's libavformat muxing is presently broken and can generate
INCORRECT files in the presence of B-frames. Moreover, due to bugs MPlayer
will play these INCORRECT files as if nothing were wrong!"

Is this why?

Cheers


More information about the MEncoder-users mailing list