Autor Thema: Capturing with mencoder  (Gelesen 16912 mal)

gardar

  • Newbie
  • *
  • Beiträge: 4
    • Profil anzeigen
Capturing with mencoder
« am: Mai 05, 2011, 01:42:40 Vormittag »
I'm trying to capture from composite with mencoder.

This is the command I'm using

mencoder -tv driver=v4l2:input=1:width=720:height=576:device=/dev/video1:fps=25:amode=2:norm=PAL-BG tv:// -oac lavc -ovc lavc acodec=ac3:vcodec=mpeg4 -o test.avi
Then what happens is that I can hear the audio from the source and receive some errors aswell. Mencoder also just outputs a 0byte file.
MEncoder SVN-r33226-4.5.2 (C) 2000-2011 MPlayer Team
162 audio & 359 video codecs
success: format: 9  data: 0x0 - 0x0
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
 comment: first try, more to come ;-)
Selected device: Sundtek MediaTV
 Tuner cap: STEREO
 Tuner rxs:
 Capabilities:  video capture  tuner  audio  streaming
 supported norms: 0 = PAL-BG; 1 = PAL-DK; 2 = PAL-I; 3 = PAL-M; 4 = NTSC-M; 5 = Secam-L; 6 = Secam-LC; 7 = Secam-K;
 inputs: 0 = Television; 1 = Composite; 2 = S-Video;
 Current input: 1
 Current format: YUYV
v4l2: current audio mode is : LANG1
Audio block size too low, setting to 8192!
[V] filefmt:9  fourcc:0x32595559  size:720x576  fps:25.000  ftime:=0.0400
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 1 ch, s16le, 705.6 kbit/100.00% (ratio: 88200->88200)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x8a8aee0]using unscaled yuyv422 -> yuv420p special converter
videocodec: libavcodec (720x576 fourcc=34504d46 [FMP4])
Selected video codec: [rawyuy2] vfm: raw (RAW YUY2)
==========================================================================
Forcing audio preload to 0, max pts correction to 0.

Skipping frame!
Pos:   0.0s      1f ( 0%)  0.95fps Trem:   0min   0mb  A-V:0.000 [0:0]
v4l2: select timeout

Skipping frame!
Pos:   0.0s      2f ( 0%)  1.27fps Trem:   0min   0mb  A-V:0.000 [0:0]
v4l2: select timeout

Skipping frame!
Pos:   0.0s      3f ( 0%)  1.43fps Trem:   0min   0mb  A-V:0.000 [0:0]

Skipping frame!
Pos:   0.0s      4f ( 0%)  1.53fps Trem:   0min   0mb  A-V:0.000 [0:0]
v4l2: select timeout

Skipping frame!
Pos:   0.0s      5f ( 0%)  1.59fps Trem:   0min   0mb  A-V:0.000 [0:0]

Skipping frame!
Pos:   0.0s      6f ( 0%)  1.64fps Trem:   0min   0mb  A-V:0.000 [0:0]
v4l2: select timeout

Skipping frame!
Pos:   0.0s      7f ( 0%)  1.67fps Trem:   0min   0mb  A-V:0.000 [0:0]

Skipping frame!
^Cs:   0.0s      8f ( 0%)  1.70fps Trem:   0min   0mb  A-V:0.000 [0:0]
v4l2: select timeout

Skipping frame!
Pos:   0.0s      9f ( 0%)  1.72fps Trem:   0min   0mb  A-V:0.000 [0:0]

Flushing video frames.
Writing index...
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

Video stream:     -nan kbit/s  (-2147483648 B/s)  size: 0 bytes  0.000 secs  9 frames

Audio stream:     -nan kbit/s  (-2147483648 B/s)  size: 0 bytes  0.000 secs
v4l2: select timeout
v4l2: 0 frames successfully processed, 1 frames dropped.



What am I doing wrong?


Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re:Capturing with mencoder
« Antwort #1 am: Mai 05, 2011, 05:37:23 Vormittag »
you can try this one:
Zitat
mencoder -tv norm=PAL-BG:adevice=/dev/dsp0:amode=1:audiorate=48000 -af format=s16le -ovc lavc -lavcopts vcodec=mjpeg -oac pcm -o test.avi tv://

your command does not really show up any audio device so it probably just falls back to the default soundcard, this example was used by another user in a previous post and it's verified to work. You might also try to change the codecs of course but keep the adevice, amode and audiorate settings.

For some technical details we constantly check our driver with a tool called valgrind, this shows up any bad behavior or memory leak, especially since long term availability is a strong requirement for our software.
« Letzte Änderung: Mai 05, 2011, 05:49:38 Vormittag von Sundtek »
Failure is a good thing! I'll fix it

gardar

  • Newbie
  • *
  • Beiträge: 4
    • Profil anzeigen
Re:Capturing with mencoder
« Antwort #2 am: Mai 05, 2011, 07:42:46 Nachmittag »
When I try that command, my webcam turns on. And I don't have any other /dev/dsp devices.

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re:Capturing with mencoder
« Antwort #3 am: Mai 06, 2011, 04:51:31 Vormittag »
of course you need to add the parameter for your USB TV tuner, device=/dev/video1
Failure is a good thing! I'll fix it

gardar

  • Newbie
  • *
  • Beiträge: 4
    • Profil anzeigen
Re:Capturing with mencoder
« Antwort #4 am: Mai 06, 2011, 04:03:12 Nachmittag »
Oh silly me ;)

Works great now :)

Here's my current command to capture (if anyone lurking this topic might be interested).


mencoder -tv driver=v4l2:input=1:width=720:height=576:device=/dev/video1:fps=25:amode=2:norm=PAL-BG:adevice=/dev/dsp0:amode=1:audiorate=48000 -af format=s16le tv:// -oac pm -ovc lavc -lavcopts acodec=libfaac:vcodec=mpeg4:vbitrate=3000 -ofps 25 -o something.avi