[MPlayer-users] Recording from tv:// isn't realtime

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Jul 28 20:56:34 CEST 2014


On Sun, Jul 27, 2014 at 03:05:34PM -0700, Marc MERLIN wrote:
> On Wed, Jul 23, 2014 at 07:51:17PM +0200, Reimar Döffinger wrote:
> > > time mencoder tv:// -tv driver=v4l2:norm=PAL:width=720:height=576:outfmt=uyvy:device=/dev/video1:input=0:fps=25:alsa:amode=1:forcechan=2:audiorate=48000:forceaudio:immediatemode=0 -ovc x264 -x264encopts threads=8:subq=5:8x8dct:frameref=2:bframes=3:b_pyramid=normal:weight_b -oac mp3lame -lameopts cbr:br=128   -o test.avi 
> > > 
> > > Setting audio delay to 0.080s.
> > > Video stream:    6.387 kbit/s  (798 B/s)  size: 4056 bytes  5.080 secs  309 frames
> > 
> > This says 309 frames in 5 seconds. Which would be 60 fps.
> > I don't have enough experience to be sure what causes this, but one
> > possibility would be that even though you told it to use 25 fps, the
> > driver actually gives you 60 fps, thus confusing MPlayer.
> > This is consistent with you getting 20 seconds of output after 1 minute.
> > The solution would be to set fps=60 in the tv:// but using -ofps 25 to
> > make mencoder drop frames (if desired).
> 
> Just to be clear, did you want me to try this?
> time mencoder tv:// -tv
> driver=v4l2:norm=PAL:width=720:height=576:outfmt=uyvy:device=/dev/video1:input=0:fps=60:alsa:amode=1:forcechan=2:audiorate=48000:forceaudio:immediatemode=0
> -ovc x264 
> -x264encopts threads=8:subq=5:8x8dct:frameref=2:bframes=3:b_pyramid=normal:weight_b
> -oac mp3lame -lameopts cbr:br=128   -ofps 25 -o test.avi

Yes, I think so.
Strange that it didn't work.
If you have the patience, there are two other things you could try -
starting from the original line with fps=25
1) Try adding -fps 25 (and/or -fps 60 to the line quoted above).
2) Try with -ovc copy (or -ovc lavc etc.), to try if it's even in any
way related to the encoder or not.

> ^CPos:   3.0s    181f ( 0%) 24.58fps Trem:   0min   0mb  A-V:0.000 [3:128]

Something is clearly strange, the video position and frame number
combination indicates 60 fps, but the 25 fps indicates it gets data only
at 25 fps.
If I didn't know that mencoder has the strangest bugs I'd be blaming the
video input driver and say that it claims to deliver 60 fps (and
timestamps matching that) while actually only supplying 25 fps...
Possibly just trying to play the input with MPlayer might give some
insights?
As a last suggestion, I think ffmpeg supports all you need here,
maybe you could try using that?


More information about the MPlayer-users mailing list