W
W
WayMax2016-06-27 11:27:13
fmpeg
WayMax, 2016-06-27 11:27:13

ffserver and ffmpeg restream settings from rtsp to mp4?

Contents of "ffserver.conf" file:

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 200M
</Feed>

<Stream live.h264>
Format rtp
Feed feed1.ffm
VideoCodec libx264
NoAudio
</Stream>

Run "ffserver":
[email protected]:~# ffserver -d -f /etc/ffserver.conf
ffserver version 1.0.10 Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 25 2014 07:50:40 with gcc 4.7 (Debian 4.7.2-5)
configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4-Wformat -Werror=format-security ' --extra-ldflags=' -Wl,-z,relro' --cc='ccache cc'--enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx - -enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable- frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libfdk-aac --enable-libdc1394 --disable-altivec --dis libavutil51.73.101 / 51.73.101
Libavcodec 54. 59.100 / 54. 59.100 LibavFormat
54. 29.104 / 54. 29.104
LIBAVDEVICE 54. 2.101 / 54. 2.101
LibavFilter 3. 17.100 / 3. 17.100
LIBSWSCALE 2. 1.101 / 2.
1.101 LIBSWRESAMPLE 0. 15.100 / 0. 15.100
LibpostProc 52 0.100 / 52. 0.100
Thu Jun 23 20:07:26 2016 FFserver started.
Run "ffmpeg":
[email protected]:~# ffmpeg -i "rtsp://10.1.1.60/axis-media/media.amp?videocodec=h264&resolution=640x480" -c copy " 127.0.0.1:8090/feed1.ffm "
ffmpeg version 1.0.10 Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 25 2014 07:50:40 with gcc 4.7 (Debian 4.7.2-5)
configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4-Wformat -Werror=format-security ' --extra-ldflags=' -Wl,-z,relro' --cc='ccache cc'--enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx - -enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable- frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libfdk-aac --enable-libdc1394 --disable-altivec --dis libavutil51.73.101 / 51.73.101
Libavcodec 54. 59.100 / 54. 59.100 LibavFormat
54. 29.104 / 54. 29.104
LIBAVDEVICE 54. 2.101 / 54. 2.101
LibavFilter 3. 17.100 / 3. 17.100
LIBSWSCALE 2. 1.101 / 2.
1.101 LIBSWRESAMPLE 0. 15.100 / 0. 15.100
LibpostProc 52 0.100 / 52. 0.100
[rtsp @ 0x1147ca0] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://10.1.1.60/axis-media/media.amp?videocodec=h264&resolution=640x480' :
Metadata:
title : Media Presentation
Duration: N/A, start: 0.099878, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuvj420p, 640x480 [SAR 1:1 DAR 4:3], 30 tbr, 90k tbn, 180k tbc
Output #0, ffm, to ' 127.0.0.1:8090/feed1.ffm ':
Metadata:
title : Media Presentation
encoder : Lavf54.29.104
Stream #0:0: Video: h264, yuvj420p, 640x480 [SAR 1:1 DAR 4 :3], q=2-31, 1000k tbn, 90k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=25667 fps= 21 q=-1.0 Lsize= 157748kB time=00:20:33.11 bitrate=1048.0kbits/s
When trying to access the stream " 10.1.1.40:8090/live.h264 " ffserver returns:
Thu Jun 23 20:07:33 2016 127.0. 0.1 - - New connection: GET /feed1.ffm
Thu Jun 23 20:07:33 2016 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200 4175
Thu Jun 23 20:07:33 2016 127.0.0.1 - - New connection: POST /feed1.ffm
Thu Jun 23 20:07:50 2016 10.1.1.41 - - New connection: GET /live.h264
Thu Jun 23 20:07 :50 2016 Max packet size 0 too low
Thu Jun 23 20:07:50 2016 Error writing output header

Thu Jun 23 20:07:50 2016 10.1.1.41 - - [GET] "/live.h264 HTTP/1.1" 200 79
PS:
There is an ip-camera that can use rtsp, there is an html5 video player that can't use rtsp. Wanted to solve this problem with ffserver and ffmpeg.
PPS:
I have already seen a comment to a similar question "use a bunch of nginx + rtmp module. And broadcast in hls and dash". But this one does not carry a semantic load, because is just a list of words.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question