[MPlayer-users] Switches for playing interlaced h264 ?

Håkon Alstadheim hakon at alstadheim.priv.no
Tue Aug 19 14:19:43 CEST 2008


Hi, I'm receiving dvb-t broadcasts in interlaced h264 format. I seem to 
be totally unable to get the mplayer switches right for this format, 
video always lags. See log below from an (unpatched mplayer ) for how 
mplayer describes the input. With the switches "-mc 2 -framedrop 
-autosync 30" I get a couple of  image frames in 1 second, a 3 second 
pause and then a couple more frames. Running with -speed 2.0 I get good 
pictures but bad/no sound. Trying to monkey with -fps does not work 
either. Trying  -lavdopts bug=4 on a hunch has no effect. Do I need to 
specify a different codec with -lavdopts , or am I seeing a different bug?

Now, I have a couple of patches, and with those applied I get pretty 
consistently successful (downright beautiful) decoding of the stream. 
These patches are not going to be put into the official code it seems, 
so I wonder what switches I should use to emulate the effect. I have two 
patches installed (see below), the operative one i suspect is the 
framerate patch.



--framerate patch--
Index: libmpcodecs/vd_ffmpeg.c
===================================================================
--- libmpcodecs/vd_ffmpeg.c    (revision 27410)
+++ libmpcodecs/vd_ffmpeg.c    (working copy)
@@ -737,6 +737,8 @@
     mp_image_t* mpi=NULL;
     int dr1= ctx->do_dr1;
 
+    sh->frametime=1.0/sh->fps;
+
     if(len<=0) return NULL; // skipped frame
 
 //ffmpeg interlace (mpeg2) bug have been fixed. no need of -noslices
@@ -781,6 +783,8 @@
     ret = avcodec_decode_video(avctx, pic,
          &got_picture, data, len);
 
+    if(!got_picture)sh->frametime=1.0/1000.0;
+
     dr1= ctx->do_dr1;
     if(ret<0) mp_msg(MSGT_DECVIDEO,MSGL_WARN, "Error while decoding 
frame!\n");
 //printf("repeat: %d\n", pic->repeat_pict);
-------------patch ends--
I also have this installed, don't know if it has any effect:
-------hdr buf patch---
Index: stream/asf_mmst_streaming.c
===================================================================
--- stream/asf_mmst_streaming.c    (revision 27410)
+++ stream/asf_mmst_streaming.c    (working copy)
@@ -68,7 +68,7 @@
 extern int video_id;
 
 #define BUF_SIZE 102400
-#define HDR_BUF_SIZE 8192
+#define HDR_BUF_SIZE 16384
 #define MAX_STREAMS 20
 
 typedef struct


------------ log -----------
MPlayer dev-SVN-r27471-4.1.2 (C) 2000-2008 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 2.00GHz (Family: 15, Model: 2, Stepping: 4)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

Playing dvb://NRK1.
dvb_tune Freq: 658000000
 Cache fill:  0.00% (0 bytes)    Cache fill:  2.20% (90112 bytes)    
Cache fill:  4.80% (196608 bytes)    Cache fill:  7.60% (311296 
bytes)    Cache fill: 10.20% (417792 bytes)    Cache fill: 12.80% 
(524288 bytes)    Cache fill: 15.40% (630784 bytes)    Cache fill: 
18.00% (737280 bytes)  
TS file format detected.
VIDEO H264(pid=512) AUDIO AAC(pid=640) NO SUBS (yet)!  PROGRAM N. 1009
FPS seems to be: 25.000000
Opening video filter: [pp=fa/fd]
Opening video filter: [crop w=550 h=576]
Crop: 550 x 576, -1 ; -1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) 
decoder)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
[h264 @ 0x86dbd90]number of reference frames exceeds max (probably 
corrupt input), discarding one
.. snip ..

.. snip ..
mmco: unref short failure
 ..snip..

VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
[PP] Using external postprocessing filter, max q = 6.
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.82:1 - prescaling to correct movie aspect.
VO: [xv] 550x576 => 800x576 Planar YV12  [fs] [vm]
XF86VM: Selected video mode 800x600 for image size 800x576.


Exiting... (Quit)




More information about the MPlayer-users mailing list