[FFmpeg-user] Newbie streaming problem
Steven Occhipinti
public at stevenocchipinti.com
Tue Oct 11 12:15:43 CEST 2011
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
>>
>> 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
>> 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':
>> 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
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> 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 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
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)
More information about the ffmpeg-user
mailing list