Hi Jose,

do you manage to stream a video encoded in another codec than h264
over RTP? And how do you do it, can you please post some ffserver
config and instructions how to call ffmpeg?

I just managed to fix the ffmpeg-error by filling the ffserver feed
with rawvideo, given by my webcam.

1.) ffserverwebcam.config, preparing ffserver to stream rawvideo over RTP:


Port 8090
BindAddress 0.0.0.0
RTSPPort 5004
RTSPBindAddress 0.0.0.0
MaxClients 10
MaxBandwidth 40000
NoDaemon

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 500M # just for testing, i try to stream rawvideo so make
room for it
ACL allow localhost
ACL allow 127.0.0.1
ACL allow 192.168.0.0 192.168.255.255
</Feed>

<stream webcamvideo.avi>
    Feed feed1.ffm
    Format rtp

    VideoCodec rawvideo
    VideoFrameRate 10
    VideoBufferSize 40
    VideoBitRate 36864
    VideoSize 640x480
    VideoGopSize 10

    NoAudio
    AVOptionVideo flags +global_header
</Stream>

<Stream stat.html>
Format status
ACL allow localhost
ACL allow 127.0.0.1
ACL allow 192.168.0.0 192.168.255.255
</Stream>

<Redirect index.html>
URL http://www.ffmpeg.org/
</Redirect>


Then I start ffserver with:
ffserver -d -f ffserverwebcam.conf


2.) Now the feed of the ffserver is filled by ffmpeg which gives the
rawvideo of my webcam to it:
ffmpeg -f video4linux2 -s 640x480 -r 10 -i /dev/video0 -an -vcodec
rawvideo http://localhost:8090/feed1.ffm

It works, ffmpeg is continously giving frames to the feed of ffserver.
It writes continously similiar output to these to the console:

frame=  196 fps= 10 q=0.0 size=   88508kB time=19.60 bitrate=36992.7kbits/s dup=
frame=  202 fps= 10 q=0.0 size=   91216kB time=20.20 bitrate=36992.2kbits/s dup=
frame=  208 fps= 10 q=0.0 size=   93928kB time=20.80 bitrate=36993.2kbits/s dup=
etc.


3.) Now I try to watch the stream.

3.1) At first I ve tried it with ffplay:
ffplay rtsp://localhost:5004/webcamvideo.avi

It fails with the output:
FFplay version SVN-r22390, Copyright (c) 2003-2010 the FFmpeg developers
  built on Mar 10 2010 11:30:16 with gcc 4.4.1
  configuration: --prefix=/usr/local --enable-bzlib
--enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libdirac --enable-libfaac --enable-libfaad
--enable-libfaadbin --enable-libmp3lame --enable-libvorbis
--enable-libschroedinger --enable-libspeex --enable-libx264
--enable-libxvid --enable-zlib --enable-pthreads --enable-postproc
--enable-avfilter --enable-avfilter-lavf --enable-gpl
--enable-version3 --enable-nonfree --enable-x11grab --arch=x86_64
--disable-stripping --disable-optimizations --enable-debug
  libavutil     50.11. 0 / 50.11. 0
  libavcodec    52.58. 0 / 52.58. 0
  libavformat   52.55. 0 / 52.55. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libavfilter    1.17. 0 /  1.17. 0
  libswscale     0.10. 0 /  0.10. 0
  libpostproc   51. 2. 0 / 51. 2. 0
rtsp://localhost:5004/webcamvideo.avi: Unsupported network protocol

3.2) Ive tried it with mplayer too:
mplayer rtsp://localhost:5004/webcamvideo.avi

It fails, too, with the output:

MPlayer UNKNOWN-4.4.1 (C) 2000-2009 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing rtsp://localhost:5004/webcamvideo.avi.
Resolving localhost for AF_INET6...
Connecting to server localhost[0.0.0.0]: 5004...
connect error: Connection refused
Resolving localhost for AF_INET...
Connecting to server localhost[127.0.0.1]: 5004...
rtsp_session: unsupported RTSP server. Server type is 'unknown'.
STREAM_LIVE555, URL: rtsp://localhost:5004/webcamvideo.avi
Stream not seekable!
 file format detected.


Exiting... (End of file)


It comes to the end of file.. Looking a bit strange to me. Something
is wrong in the ffserver config, I think. Please look to the config
"<stream webcamvideo.avi>". I say here ".avi". Does this mean that
ffserver uses automatically the container AVI to put the rawvideo
stream in? Does it really use AVI or just naming the rtp stramfile
webcamvideo.avi?

Whats your experience with streaming video (if realtimevideo like
webcam video or a file video) over RTP?
Please post your experiences..

Thanks,
Ali Ayhan D.




2010/3/10 Jose Antonio Caso Jacobs <joseantonioc...@gmail.com>:
> Welcome to my world, Ali! I'm having the same problems to do live streaming
> of any kind using H.264. If someone has an idea on how to do this, please
> share it!
>
> Thanks,
> José Antonio
>
> On Wed, Mar 10, 2010 at 6:21 AM, Ali Ayhan <smutje.sa...@googlemail.com>
> wrote:
>>
>> Hello,
>> any hints about the setup would be great. My aim is to stream with
>> ffserver webcam video which is delivered and encodey by ffmpeg.
>>
>> Iam setting up ffserver with this config:
>>
>>
>> Port 8090
>> BindAddress 0.0.0.0
>> RTSPPort 5004
>> RTSPBindAddress 0.0.0.0
>> MaxClients 10
>> MaxBandwidth 40000
>> NoDaemon
>>
>> <Feed feed1.ffm>
>>     File /tmp/feed1.ffm
>>     FileMaxSize 5M
>>     ACL allow localhost
>>     ACL allow 192.168.0.0 192.168.255.255
>> </Feed>
>>
>> <stream webcamvideo.mp4>
>>     Feed feed1.ffm
>>     Format rtp
>>
>>     VideoCodec libx264
>>     VideoFrameRate 15
>>     VideoBufferSize 40
>>     VideoBitRate 500
>>     VideoSize 640x480
>>    # which value?
>>     VideoGopSize 15
>>
>>     NoAudio
>>
>>    # i had problems with videostreaming with file. player said that
>> header were corrupted, so i used this config, but it doesnt help. i
>> still let it in.
>>     AVOptionVideo flags +global_header
>> </Stream>
>>
>> <Stream stat.html>
>> Format status
>> ACL allow localhost
>> ACL allow 192.168.0.0 192.168.255.255
>> </Stream>
>>
>> <Redirect index.html>
>> URL http://www.ffmpeg.org/
>> </Redirect>
>>
>>
>> Starting the server with, which is working
>> ffserver -d -f ffserverwebcam.conf
>>
>> Now I want to use ffmpeg to deliver the webcamvideo with
>> ffmpeg -f video4linux2 -s 640x480 -r 15 -i /dev/video0 -an -vcodec
>> libx264 -vpre default -bf 5 http://localhost:8090/feed1.ffm
>>
>> ffmpeg doesnt encode the video and ends with this output
>>
>>
>> FFmpeg version SVN-r22390, Copyright (c) 2000-2010 the FFmpeg developers
>>  built on Mar 10 2010 11:30:16 with gcc 4.4.1
>>  configuration: --prefix=/usr/local --enable-bzlib
>> --enable-libopencore-amrnb --enable-libopencore-amrwb
>> --enable-libdirac --enable-libfaac --enable-libfaad
>> --enable-libfaadbin --enable-libmp3lame --enable-libvorbis
>> --enable-libschroedinger --enable-libspeex --enable-libx264
>> --enable-libxvid --enable-zlib --enable-pthreads --enable-postproc
>> --enable-avfilter --enable-avfilter-lavf --enable-gpl
>> --enable-version3 --enable-nonfree --enable-x11grab --arch=x86_64
>> --disable-stripping --disable-optimizations --enable-debug
>>  libavutil     50.11. 0 / 50.11. 0
>>  libavcodec    52.58. 0 / 52.58. 0
>>  libavformat   52.55. 0 / 52.55. 0
>>  libavdevice   52. 2. 0 / 52. 2. 0
>>  libavfilter    1.17. 0 /  1.17. 0
>>  libswscale     0.10. 0 /  0.10. 0
>>  libpostproc   51. 2. 0 / 51. 2. 0
>> [video4linux2 @ 0x2800050][3]Capabilities: 5000001
>> [video4linux2 @ 0x2800050]Estimating duration from bitrate, this may
>> be inaccurate
>> Input #0, video4linux2, from '/dev/video0':
>>  Duration: N/A, start: 1268222505.539241, bitrate: 55296 kb/s
>>    Stream #0.0: Video: rawvideo, yuv420p, 640x480, 55296 kb/s, 15
>> tbr, 1000k tbn, 15 tbc
>> [libx264 @ 0x2807500]broken ffmpeg default settings detected
>> [libx264 @ 0x2807500]use an encoding preset (vpre)
>> Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
>>    Stream #0.0: Video: libx264, yuv420p, 640x480, q=3-31, 500 kb/s,
>> 1000k tbn, 15 tbc
>> Stream mapping:
>>  Stream #0.0 -> #0.0
>> Error while opening encoder for output stream #0.0 - maybe incorrect
>> parameters such as bit_rate, rate, width or height
>> ioctl(VIDIOC_QBUF)
>>
>>
>> Thats it...
>>
>> ffmpeg is always telling me
>> [libx264 @ 0x2807500]broken ffmpeg default settings detected
>> [libx264 @ 0x2807500]use an encoding preset (vpre)
>>
>> I put all libx264-*.ffpreset to [home]/[user]/.ffmpeg so ffmpeg should
>> find the presets. He will lookup to .ffmpeg-folder concatenate the
>> string of the ffmpeg params -vcodec with -vpre and with ".ffpreset",
>> so it should find a "libx264-default.ffpreset". But its still
>> complaining that it doesnt find it. But it runs, so I think its ok ?!
>>
>> The next message is more problematic
>> Error while opening encoder for output stream #0.0 - maybe incorrect
>> parameters such as bit_rate, rate, width or height
>> ioctl(VIDIOC_QBUF
>>
>>
>> Any hints and help would be appreciated...
>>
>> Thank you,
>> Ali Ayhan D.
>> _______________________________________________
>> ffserver-user mailing list
>> ffserver-user@mplayerhq.hu
>> https://lists.mplayerhq.hu/mailman/listinfo/ffserver-user
>
>
> _______________________________________________
> ffserver-user mailing list
> ffserver-user@mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffserver-user
>
>
_______________________________________________
ffserver-user mailing list
ffserver-user@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffserver-user

Reply via email to