[FFmpeg-user] Newbie streaming problem

Steven Occhipinti public at stevenocchipinti.com
Wed Oct 12 14:07:48 CEST 2011


Thanks, must be close now.

I thought the -an would be a little contradicting, but I tried removing one
of the -map options instead of removing the -an option. Either way,
rearranging the options as you suggested helped, but I'm getting a different
error now.

# ffmpeg -i /dev/video0 -vcodec mpeg4 -map 0.3 -map 0.2 -vtag DIVX -f
video4linux2 -s 320x240 -r 15 http://localhost:8090/feed1.ffm
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.2, Copyright (c) 2000-2009
Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1.2 --prefix=/usr
--enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib
--enable-libgsm --enable-libschroedinger --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib
--disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl
--enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394
--enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Sep 16 2011 17:04:18, gcc: 4.4.3
/dev/video0: Unknown format


Sorry to keep asking like this :(
I wouldn't have thought it would compain about "-f video4linux2" as that was
one of the options I thought I got right initially when I recorded my first
video clip.

Any ideas?
I appreciate you help!


On Wed, Oct 12, 2011 at 1:42 AM, belcampo <belcampo at zonnet.nl> wrote:

> On 10/11/2011 12:15 PM, Steven Occhipinti wrote:
>
>> On Tue, Oct 11, 2011 at 6:43 PM, belcampo<belcampo at zonnet.nl>  wrote:
>>
>>> On 10/11/2011 04:26 AM, Steven Occhipinti wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm pretty new to ffmpeg and am a little confused on how ffserver works.
>>>> My goal is to stream a webcam from one machine to (one or more) others.
>>>> Ideally I would want the client machine to only require a web browser
>>>> and the basic plugins, etc. to view the stream.
>>>>
>>>> I have Ubuntu 10.04.3 server installed and ffmpeg/ffserver from the
>>>> repo.
>>>> If I run this command to test the webcam and it starts up and a video
>>>> file is successfully recorded /tmp/test.mp4:
>>>>   #>    ffmpeg -an -f video4linux2 -s 320x240  -r 15 -i /dev/video0
>>>> -vcodec mpeg4 -vtag DIVX /tmp/test.mp4
>>>> I copied /etc/ffserver.conf to my home dir - I think I need to tweak
>>>> this file a bit, but need a little help.
>>>> I ran this command and it started a server on localhost:8090
>>>>   #>    ffserver -f ~/ffserver.conf
>>>> I then ran
>>>>   #>    ffmpeg -an -f video4linux2 -s 320x240  -r 15 -i /dev/video0
>>>> -vcodec mpeg4 -vtag DIVX http://localhost:8090/feed1.**ffm<http://localhost:8090/feed1.ffm>
>>>>
>>>> and this is the output I get:
>>>>
>>>>   #>    ffmpeg -an -f video4linux2 -s 320x240  -r 15 -i /dev/video0
>>>> -vcodec mpeg4 -vtag DIVX http://localhost:8090/feed1.**ffm<http://localhost:8090/feed1.ffm>
>>>> FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.2, Copyright (c) 2000-2009
>>>> Fabrice Bellard, et al.
>>>>   configuration: --extra-version=4:0.5.1-**1ubuntu1.2 --prefix=/usr
>>>> --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib
>>>> --enable-libgsm --enable-libschroedinger --enable-libspeex
>>>> --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib
>>>> --disable-stripping --disable-vhook --enable-runtime-cpudetect
>>>> --enable-gpl --enable-postproc --enable-swscale --enable-x11grab
>>>> --enable-libdc1394 --enable-shared --disable-static
>>>>   libavutil     49.15. 0 / 49.15. 0
>>>>   libavcodec    52.20. 1 / 52.20. 1
>>>>   libavformat   52.31. 0 / 52.31. 0
>>>>   libavdevice   52. 1. 0 / 52. 1. 0
>>>>   libavfilter    0. 4. 0 /  0. 4. 0
>>>>   libswscale     0. 7. 1 /  0. 7. 1
>>>>   libpostproc   51. 2. 0 / 51. 2. 0
>>>>   built on Sep 16 2011 17:04:18, gcc: 4.4.3
>>>> [video4linux2 @ 0x89092c0][3]Capabilities: 4000001
>>>> [video4linux2 @ 0x89092c0]The V4L2 driver changed the video from
>>>> 320x240 to 176x144
>>>> Input #0, video4linux2, from '/dev/video0':
>>>>   Duration: N/A, start: 1318298315.446232, bitrate: 6082 kb/s
>>>>     Stream #0.0: Video: rawvideo, yuyv422, 176x144, 6082 kb/s, 15 tbr,
>>>> 1000k tbn, 15 tbc
>>>> Output #0, ffm, to 'http://localhost:8090/feed1.**ffm<http://localhost:8090/feed1.ffm>
>>>> ':
>>>>     Stream #0.0: Audio: mp2, 44100 Hz, mono, s16, 32 kb/s
>>>>     Stream #0.1: Video: mpeg1video, yuv420p, 176x144, q=3-31, 64 kb/s,
>>>> 1000k tbn, 3 tbc
>>>>     Stream #0.2: Audio: mp2, 22050 Hz, mono, s16, 64 kb/s
>>>>     Stream #0.3: Video: msmpeg4, yuv420p, 352x240, q=3-31, 256 kb/s,
>>>> 1000k tbn, 15 tbc
>>>> Could not find input stream matching output stream #0.0
>>>> ioctl(VIDIOC_QBUF)
>>>>
>>>>
>>>> I'm assuming I need to setup a more suitable<feed>    definition to
>>>> match the input, but after some fiddling I can't seem to get it
>>>> working.
>>>>
>>> Your camera is providing 2 video and 2 audio streams you need to use the
>>> map
>>> function to make it work.
>>> Adding -map 0.3 -map 0.2 to your ffmpeg command line will choose the
>>> higher
>>> definition video and audio.
>>>
>>>> I've attached my ffserver.conf - Any help is much appreciated.
>>>>
>>>>
>>>> Cheers,
>>>> Steve
>>>>
>>>>
>>>> ______________________________**_________________
>>>> ffmpeg-user mailing list
>>>> ffmpeg-user at ffmpeg.org
>>>> http://ffmpeg.org/mailman/**listinfo/ffmpeg-user<http://ffmpeg.org/mailman/listinfo/ffmpeg-user>
>>>>
>>> ______________________________**_________________
>>> ffmpeg-user mailing list
>>> ffmpeg-user at ffmpeg.org
>>> http://ffmpeg.org/mailman/**listinfo/ffmpeg-user<http://ffmpeg.org/mailman/listinfo/ffmpeg-user>
>>>
>>>
>>
>> Thanks for your prompt reply.
>> Your reply makes sense to me, but when I add those 2 map options, I
>> get this error:
>> "Number of stream maps must match number of output streams"
>>
> I think the order of options is important, try to change in something like:
>
> ffmpeg -i /dev/video0 -vcodec mpeg4 -map 0.3 -map 0.2 -vtag DIVX -f
> video4linux2 -s 320x240 -r 15
> http://localhost:8090/feed1.**ffm <http://localhost:8090/feed1.ffm>
>
>
>
>> I tried just the video stream too, but that gives the same result..
>> what are the output streams?
>>
>> # ffmpeg -map 0.3 -map 0.2 -an -f video4linux2 -s 320x240  -r 15 -i
>> /dev/video0 -vcodec mpeg4 -vtag DIVX http://localhost:8090/feed1.**ffm<http://localhost:8090/feed1.ffm>
>>
> You choose 0.3 and 0.2 as input and therefore output,and then disable audio
> with -an that won't work.
>
>> FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.2, Copyright (c) 2000-2009
>> Fabrice Bellard, et al.
>>   configuration: --extra-version=4:0.5.1-**1ubuntu1.2 --prefix=/usr
>> --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib
>> --enable-libgsm --enable-libschroedinger --enable-libspeex
>> --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib
>> --disable-stripping --disable-vhook --enable-runtime-cpudetect
>> --enable-gpl --enable-postproc --enable-swscale --enable-x11grab
>> --enable-libdc1394 --enable-shared --disable-static
>>   libavutil     49.15. 0 / 49.15. 0
>>   libavcodec    52.20. 1 / 52.20. 1
>>   libavformat   52.31. 0 / 52.31. 0
>>   libavdevice   52. 1. 0 / 52. 1. 0
>>   libavfilter    0. 4. 0 /  0. 4. 0
>>   libswscale     0. 7. 1 /  0. 7. 1
>>   libpostproc   51. 2. 0 / 51. 2. 0
>>   built on Sep 16 2011 17:04:18, gcc: 4.4.3
>> [video4linux2 @ 0x9ce02c0][3]Capabilities: 4000001
>> [video4linux2 @ 0x9ce02c0]The V4L2 driver changed the video from
>> 320x240 to 176x144
>> Input #0, video4linux2, from '/dev/video0':
>>   Duration: N/A, start: 1318328002.348537, bitrate: 6082 kb/s
>>     Stream #0.0: Video: rawvideo, yuyv422, 176x144, 6082 kb/s, 15 tbr,
>> 1000k tbn, 15 tbc
>> Number of stream maps must match number of output streams
>> ioctl(VIDIOC_QBUF)
>> ______________________________**_________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/**listinfo/ffmpeg-user<http://ffmpeg.org/mailman/listinfo/ffmpeg-user>
>>
>
> ______________________________**_________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/**listinfo/ffmpeg-user<http://ffmpeg.org/mailman/listinfo/ffmpeg-user>
>


More information about the ffmpeg-user mailing list