![]() |
Grab audio/video with meconder.
Did anyone managed to grab video AND audio with mencoder???
I've been trying for a long time without success. I can grab video but when I add audio to the stream mecoder fails with error. This is the basic mencoder cmd that I use at my eepc and works fine: mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0:forceaudio:alsa:adevice=hw.0,0 -ovc lavc -oac copy -o test.avi in N900 this is what happens Nokia-N900:~# mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0:forceaudio:alsa:adevice=hw.0,0 -ovc lavc -oac copy -o test.avi -v -v -v MEncoder SVN-r30099-4.2.1 (C) 2000-2009 MPlayer Team this_opt = option: v Setting v=(null) Configuration: --prefix=/usr --extra-cflags=-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp --disable-speex --disable-dvdnav --disable-dvdread --disable-dvdread-internal --disable-real --disable-xanim init_freetype Using Unoptimized OnScreenDisplay Config pushed level is now 2 Config pushed level is now 3 Setting tv=driver=v4l2:width=320:height=240:device=/dev/video0:forceaudio:alsa:adevice=hw.0,0 STREAM: [tv] tv:// STREAM: Description: TV Input STREAM: Author: Benjamin Zores, Albeu STREAM: Comment: success: format: 9 data: 0x0 - 0x0 s->pos=0 newpos=0 new_bufpos=0 buflen=0 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 ;-) v4l2: video fd: /dev/video0: 3 Selected device: omap3/et8ek8/ad5820/adp1653 Capabilites: video capture streaming supported norms: inputs: 0 = camera; Current input: 0 Format UYVY (16 bits, UYVY, packed): Packed UYVY Format YUYV (16 bits, YUYV (YUV 4:2:2), packed): Packed YUY2 Format unknown (0x30314142) ( 0 bits, Bayer10 (GrR/BGb)): Unknown 0x30314142 Current format: YUYV v4l2: set format: YVU420 v4l2: set input: 0 tv.c: norm_from_string(pal): Bogus norm parameter, setting default. Selected norm : pal v4l2: ioctl enum norm failed: Invalid argument Error: Cannot set norm! v4l2: set width: 320 v4l2: set height: 240 Selected input hasn't got a tuner! ==> Found video stream: 0 v4l2: get format: YUYV v4l2: Cannot get fps v4l2: get width: 320 v4l2: get height: 240 Hardware PCM card 0 'RX51' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 44100 exact rate : 44100 (44100/1) msbits : 16 buffer_size : 32768 period_size : 512 period_time : 11609 tstamp_mode : NONE period_step : 1 avail_min : 512 period_event : 0 start_threshold : 0 stop_threshold : 32768 silence_threshold: 0 silence_size : 0 boundary : 1073741824 appl_ptr : 0 hw_ptr : 0 v4l2: set audio samplerate: 44100 Hardware PCM card 0 'RX51' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 44100 exact rate : 44100 (44100/1) msbits : 16 buffer_size : 32768 period_size : 512 period_time : 11609 tstamp_mode : NONE period_step : 1 avail_min : 512 period_event : 0 start_threshold : 0 stop_threshold : 32768 silence_threshold: 0 silence_size : 0 boundary : 1073741824 appl_ptr : 0 hw_ptr : 0 v4l2: get audio format: 9 ==> Found audio stream: 0 v4l2: get audio samplerate: 44100 v4l2: get audio samplesize: 2 v4l2: get audio channels: 2 TV audio: 2 channels, 16 bits, 44100 Hz Audio capture - buffer 2671 blocks of 2048 bytes, skew average from 87 meas. Floating point exception Anyone?? |
Re: Grab audio/video with meconder.
When you say "grab", which do you mean: download or encode?
ffmpeg is considered to work well by many for encoding, but at the moment I'm having trouble with its apparently absent libx264 encoder. |
Re: Grab audio/video with meconder.
grab=capture from cam (/dev/video0 or /dev/video1) and mic and consequently encode that to an mp4/avi file.
Regarding ffmpeg I'm having stange behaviours: ffmpeg -f alsa -ac 2 -i hw:0 -f video4linux2 -i /dev/video0 -acodec ac3 -ab 128k -vcodec mpeg4 -b 6000k -r 25 test5.avi ffmpeg -f alsa -ac 2 -i hw:0 -f video4linux2 -s 320x240 -i /dev/video0 -acodec ac3 -ab 128k -vcodec mpeg4 -b 6000k -r 25 test5.avi ffmpeg -f alsa -ac 2 -i hw:0 -f video4linux2 -s 320x240 -i /dev/video1 -vcodec libx264 -acodec libfaac test.mp4 ffmpeg -f alsa -ac 2 -i hw:0 -f video4linux2 -s 320x240 -i /dev/video1 test.mp4 none of these produced any file and in the top of that, when /dev/video0 is specified my phone reboots. When /dev/video1 is specified, nothing happens, I can see the front red light but no file is produced also. |
Re: Grab audio/video with meconder.
There are two/three processes here:
A 1. Record video, i.e. the capture and storage of visual infomation A 2. Record sound i.e. the capture and storage of auditory information. B. Encode audio-video, i.e. transformation and combination of data from at least one source and configuration into another. Aside from whether the device is up to doing all of this at once, you need to ensure both the recording and encoding processes are operating before you can try to join them up. Re: encoding On you N900, what software do you have installed capable of encoding videos? What formats is it capable of producing? Tests: - Try simply changing a pre-recorded video from one format to another. - Try combining a pre-recorded sound track with a pre-recorded video file. ** can you synchroise the two files well enough for tv playback? re Recording: - Are you actually capturing visual information? - If so, is this data being stored for more than 1 frame? - once you know the data is being stored, try encoding it offline (once record is complete) - if recording sound with video rolling is a problem, try something like "recaller" and tying the audio and video together with ffmpeg (or similar). -post 200 |
Re: Grab audio/video with meconder.
Your best bet would be to use gstreamer, as it has access to the dsp acceleration for encoding to h.264. First you will need to install "gstreamer0.10-tools"
This (single) line should get you started: Code:
gst-launch v4l2camsrc device=/dev/video0 ! dsph264enc ! avimux ! filesink location=test.avi
|
All times are GMT. The time now is 19:26. |
vBulletin® Version 3.8.8