Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
How can I capture audio AND video simultenaous with ffmpeg from an USB capture device
5 octobre 2011, par obanI'm capturing a video by means of an USB Terratec Grabster AV350 (which is based on the em2860 chip).
I don't succeed to get the audio when it is played . If I play the captured video with vlc or with ffplay I got only 3 seconds sound and then a silence for the rest of the video ...
During the capturing I don't get any errors. At the end it indicates the size of the video and audio captured ....
I'm using the ffmpeg command for this :
ffmpeg -f alsa -ac 2 -i hw:3 -f video4linux2 -i /dev/video0 -acodec ac3 -ab 128k -vcodec mpeg4 -b 6000k -r 25 test5.avi
The log is :
[alsa @ 0x9bcd420]Estimating duration from bitrate, this may be inaccurate Input #0, alsa, from 'hw:3': Duration: N/A, start: 69930.998994, bitrate: N/A Stream #0.0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s [video4linux2 @ 0x9bf5d30]Estimating duration from bitrate, this may be inaccurate Input #1, video4linux2, from '/dev/video0': Duration: N/A, start: 1307111377.654173, bitrate: -2147483 kb/s Stream #1.0: Video: rawvideo, yuyv422, 720x576, -2147483 kb/s, 1000k tbr, 1000k tbn, 1000k tbc [ac3 @ 0x9bf9590]No channel layout specified. The encoder will guess the layout, but it might be incorrect. Output #0, avi, to 'test5.avi': Metadata: ISFT : Lavf52.64.2 Stream #0.0: Video: mpeg4, yuv420p, 720x576, q=2-31, 6000 kb/s, 25 tbn, 25 tbc Stream #0.1: Audio: ac3, 44100 Hz, stereo, s16, 128 kb/s Stream mapping: Stream #1.0 -> #0.0 Stream #0.0 -> #0.1 Press [q] to stop encoding frame= 1283 fps= 25 q=2.3 Lsize= 38677kB time=51.32 bitrate=6173.9kbits/s video:37755kB audio:846kB global headers:0kB muxing overhead 0.198922%
If I reduce the command for only capturing audio, then the audio file can be played successfully :
ffmpeg -f alsa -ac 2 -i hw:3,0 -acodec ac3 -ab 128k test5.avi
[alsa @ 0x8ede420]Estimating duration from bitrate, this may be inaccurate Input #0, alsa, from 'hw:3,0': Duration: N/A, start: 70395.998935, bitrate: N/A Stream #0.0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s [ac3 @ 0x8eebac0]No channel layout specified. The encoder will guess the layout, but it might be incorrect. Output #0, avi, to 'test5.avi': Metadata: ISFT : Lavf52.64.2 Stream #0.0: Audio: ac3, 44100 Hz, stereo, s16, 128 kb/s Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding size= 227kB time=13.62 bitrate= 136.8kbits/s video:0kB audio:213kB global headers:0kB muxing overhead 6.902375%
If I run the command for only video capturing then vlc or ffplay can play the video successfully :
ffmpeg -f video4linux2 -i /dev/video0 -vcodec mpeg4 -b 12000k -r 25 test5.avi
[video4linux2 @ 0x91d6420]Estimating duration from bitrate, this may be inaccurate Input #0, video4linux2, from '/dev/video0': Duration: N/A, start: 1307112044.025687, bitrate: -2147483 kb/s Stream #0.0: Video: rawvideo, yuyv422, 720x576, -2147483 kb/s, 1000k tbr, 1000k tbn, 1000k tbc Output #0, avi, to 'test5.avi': Metadata: ISFT : Lavf52.64.2 Stream #0.0: Video: mpeg4, yuv420p, 720x576, q=2-31, 12000 kb/s, 25 tbn, 25 tbc Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding frame= 388 fps= 25 q=2.0 Lsize= 12963kB time=15.52 bitrate=6842.5kbits/s video:12949kB audio:0kB global headers:0kB muxing overhead 0.114584%
Strange behaviour I noticed is that when I tried capturing video and audio, I can not capture the audio afterwards any more, unless I unplug the AV350 first.
The G350 is located at card 3 :
htpc@htpc-01:/proc/asound/G350/pcm0c$ more info card: 3 device: 0 subdevice: 0 stream: CAPTURE id: USB Audio name: USB Audio subname: subdevice #0 class: 0 subclass: 0 subdevices_count: 1 subdevices_avail: 1
The OS is a Linux 2.6.38-8-generic with the Ubuntu Natty Narwhal version
Any help on how to tackle this issue would be great ....
Thanks !
-
ffmpeg : convert audio-only flv to swf
5 octobre 2011, par Michael Brewer-DavisMy Flex application records audio-only FLV files using red5--I'd like to convert these to SWF files so I can embed them in other SWF files. (I could also convert to MP3 and then embed them into SWFs myself, but I'd prefer a one step solution.)
Anyone have experience doing this?
What I've tried:
The following naive ffmpeg command fails:
> ffmpeg -i 3139747641.flv -vn movie.swf FFmpeg version SVN-r21751-snapshot, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Feb 11 2010 09:15:42 with gcc 4.2.1 (SUSE Linux) configuration: --enable-gpl --enable-nonfree libavutil 50. 9. 0 / 50. 9. 0 libavcodec 52.53. 0 / 52.53. 0 libavformat 52.52. 0 / 52.52. 0 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0.10. 0 / 0.10. 0 [flv @ 0x8a5e3a0]Could not find codec parameters (Video: 0x0000) [flv @ 0x8a5e3a0]Estimating duration from bitrate, this may be inaccurate Input #0, flv, from '3139747641.flv': Metadata: audiocodecid : -1 duration : 0 videocodecid : -1 canSeekToEnd : true Duration: 00:00:14.88, start: 0.000000, bitrate: N/A Stream #0.0: Video: 0x0000, 1k tbr, 1k tbn, 1k tbc Stream #0.1: Audio: nellymoser, 8000 Hz, mono, s16 Output #0, swf, to 'movie.swf': Stream #0.0: Audio: 0x0000, 8000 Hz, mono, s16, 64 kb/s Stream mapping: Stream #0.1 -> #0.0 Encoder (codec id 86017) not found for output stream #0.0
I've tried adding a dummy video, but this also failed:
> ffmpeg -i dummy.mov -i 3139747641.flv movie.swf Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'dummy.mov': Metadata: major_brand : qt minor_version : 512 compatible_brands: qt encoder : Lavf52.52.0 encoder-eng : Lavf52.52.0 Duration: 00:00:00.10, start: 0.000000, bitrate: 62 kb/s Stream #0.0(eng): Video: mpeg4, yuv420p, 10x10 [PAR 1:1 DAR 1:1], 1 kb/s, 10 fps, 10 tbr, 10 tbn, 10 tbc [flv @ 0x8a67fa0]Could not find codec parameters (Video: 0x0000) [flv @ 0x8a67fa0]Estimating duration from bitrate, this may be inaccurate Input #1, flv, from '3139747641.flv': Metadata: audiocodecid : -1 duration : 0 videocodecid : -1 canSeekToEnd : true Duration: 00:00:14.88, start: 0.000000, bitrate: N/A Stream #1.0: Video: 0x0000, 1k tbr, 1k tbn, 1k tbc Stream #1.1: Audio: nellymoser, 8000 Hz, mono, s16 picture size invalid (0x0) Cannot allocate temp picture, check pix fmt
-
encode and segment at the same time ?
4 octobre 2011, par lvreinyI want to implement HTTP streaming server, which is similar to this (http://www.ioncannon.net/programming/452/iphone-http-streaming-with-ffmpeg-and-an-open-source-segmenter/) But, instead of segment the video file after it is completely converted by ffmpeg, I want to do encoding and segmenting at the same time (something like if the output stream from the encoder is sent to the segmenter immediately).
what should be the appropriate solution for this?
Thanks
lvreiny
-
How to play wma file in iphone ?
3 octobre 2011, par MohasinI want to build a radio app in iPhone for which wma streaming is necessary. So if u have any idea please help me. thanks in advance
-
Is -vfilter not available on Debian 5 ?
3 octobre 2011, par KorI'm getting problems trying to make my website (done in PHP) work online. At a specific time, I need to upload a video and convert it, also scaling its dimensions. I use a call like this one:
ffmpeg -y -i '/path/to/video.mp4' -f flv -ab 56 -ar 22050 -r 20 -vfilter "scale=704:-1" '/path/to/new/video.flv'
It works offline on my computer (Ubuntu 10.10), but it doesn't do the same online (Debian Lenny 5.0). The response I get from the server is:
[Mon Oct 03 15:48:56 2011] [error] [client 81.184.6.124] /servers/path/to/ffmpeg: unrecognized option '-vfilter'
I have also tried with '-vf', but it just doesn't work at all. So my question is, am I doing it wrong, or is it that Debian unables video filters for some reason?
I give you some info about this server:
Debian 5.0 PHP: 5.2.6 FFmpeg r11872+debian_0.svn20080206-18+lenny1 libavutil 3212800 libavcodec 3355136 libavformat 3409664 libavdevice 3407872
EDIT: Oh my, I just saw it. No libavfilter installed. I'll tell you what their support tells me in a couple hours.