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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Jul 23 19:51:17 CEST 2014

On Wed, Jul 16, 2014 at 10:35:34AM -0700, Marc MERLIN wrote:
> I have an 8 core CPU that seems fast enough for encoding (I can encode at
> more than realtime speed with x264).
> But with tv:// recording, I only record at about 0.3x of realtime.
> I've tried stuff like
> 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 
> It works fine, but if I stop it after 1mn, I only get about 20 seconds
> worth.
> I've tried some options to improve speed, but none seem to help.
> Is my speed being throttled by the source somehow?
> I can play tv:// with mplayer realtime.
> Actually I'd love to use mplayer with -dumpstream, but that doesn't work
> for this source type.
> Any ideas?
> This is what mencoder says when I stop it (video bitrate is low because it's a blue image for testing):
> Pos:   5.1s    309f ( 0%) 24.89fps Trem:   0min   0mb  A-V:0.000 [4:128]
> Flushing video frames.
> Writing index...
> Writing header...
> ODML: vprp aspect is 16384:13107.
> 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).

> real	0m12.796s
> user	0m0.800s
> sys	0m0.300s

This shows clearly that CPU is not an issue at all, MPlayer was idle
waiting almost the whole time.

More information about the MPlayer-users mailing list