ffmpeg - ffserver leave original stream size -
hope guys me, because have got stuck , can't find solution problem myself. trying stream video webcam users using ffmpeg+ffserver. have faced problem:
ffmpeg gets stream camera , pushes feed of ffserver: ffmpeg -rtsp_transport tcp -i rtsp://admin:admin@192.168.10.76:80 -y -vcodec libvpx http://127.0.0.1:8090/1.ffm
ffserver stream options:
<stream 1.webm> feed 1.ffm format webm noaudio #videocodec libvpx #videosize 480x320 videoframerate 24 avoptionvideo flags +global_header avoptionvideo cpu-used 0 avoptionvideo qmin 1 avoptionvideo qmax 31 avoptionvideo quality preroll 0 startsendonkey videobitrate 128 </stream>
(note, videosize option commented). default videosize (160x128), ffserver doesn't respond each request. browser gets:
http/1.0 200 ok pragma: no-cache content-type: video/webm
but video content not sent.
if uncomment videosize option - same problem less successfull requests comparing default video size.
ffserver log looks regular no errors. can see sends headers client:
thu nov 27 12:49:11 2014 127.0.0.1 - - [post] "/1.ffm http/1.1" 200 459 thu nov 27 12:49:25 2014 127.0.0.1 - - [post] "/1.ffm http/1.1" 200 459 thu nov 27 12:49:36 2014 127.0.0.1 - - [post] "/1.ffm http/1.1" 200 459 thu nov 27 12:50:52 2014 127.0.0.1 - - [post] "/1.ffm http/1.1" 200 459 thu nov 27 12:53:54 2014 127.0.0.1 - - [post] "/1.ffm http/1.1" 200 459 thu nov 27 13:30:19 2014 127.0.0.1 - - [get] "/1.ffm http/1.1" 200 4175 thu nov 27 13:30:34 2014 127.0.0.1 - - [get] "/1.webm http/1.1" 200 385731 thu nov 27 13:30:34 2014 127.0.0.1 - - [post] "/1.ffm http/1.1" 200 458752 thu nov 27 13:30:36 2014 127.0.0.1 - - [get] "/1.ffm http/1.1" 200 4175 thu nov 27 13:30:58 2014 127.0.0.1 - - [get] "/1.webm http/1.1" 200 493 thu nov 27 13:30:58 2014 127.0.0.1 - - [post] "/1.ffm http/1.1" 200 622592
does know be? need save original videosize stream. trying override ffserver stream options ffmpeg using command (passing same parameters in ffserver's stream):
ffmpeg -re -override_ffserver -rtsp_transport tcp -i rtsp://admin:admin@192.168.10.76:80 -an -r 24 -qmin 1 -qmax 31 -cpu-used 0 -quality -flags:v +global_header -b:v 128 -vcodec libvpx -f webm -y http://127.0.0.1:8090/1.ffm
but @ momment still have error message 'output file empty, nothing encoded'. here ffmpeg's output:
ffmpeg version 2.4.2 copyright (c) 2000-2014 ffmpeg developers built on oct 6 2014 17:33:05 gcc 4.8 (ubuntu 4.8.2-19ubuntu1) configuration: --prefix=/opt/ffmpeg --libdir=/opt/ffmpeg/lib/ --enable-shared --enable-avresample --disable-stripping --enable-gpl --enable-version3 --enable-runtime-cpudetect --build-suffix=.ffmpeg --enable-postproc --enable-x11grab --enable-libcdio --enable-vaapi --enable-vdpau --enable-bzlib --enable-gnutls --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libfaac --enable-libvo-aacenc --enable-nonfree --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk_aac --enable-libopus --enable-pthreads --enable-zlib --enable-libvpx --enable-libfreetype --enable-libpulse --enable-debug=3 libavutil 54. 7.100 / 54. 7.100 libavcodec 56. 1.100 / 56. 1.100 libavformat 56. 4.101 / 56. 4.101 libavdevice 56. 0.100 / 56. 0.100 libavfilter 5. 1.100 / 5. 1.100 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 0.100 / 3. 0.100 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 0.100 / 53. 0.100 guessed channel layout input stream #0.1 : mono input #0, rtsp, 'rtsp://admin:admin@192.168.10.76:80': metadata: title : rtsp session/2.0 duration: n/a, start: 0.000000, bitrate: 128 kb/s stream #0:0: video: h264 (high), yuvj420p(pc, bt709), 1280x720 [sar 1:1 dar 16:9], 25 fps, 100 tbr, 90k tbn, 50 tbc stream #0:1: audio: pcm_alaw, 16000 hz, 1 channels, s16, 128 kb/s [swscaler @ 0x197f7a0] deprecated pixel format used, make sure did set range correctly [libvpx @ 0x1a0c080] bitrate 128 extremely low, maybe mean 128k [libvpx @ 0x1a0c080] v1.3.0 bitrate parameter set low. takes bits/s argument, not kbits/s output #0, webm, 'http://127.0.0.1:8090/1.ffm': metadata: title : rtsp session/2.0 encoder : lavf56.4.101 stream #0:0: video: vp8 (libvpx), yuv420p, 480x320 [sar 32:27 dar 16:9], q=1-31, 0 kb/s, 24 fps, 1k tbn, 24 tbc metadata: encoder : lavc56.1.100 libvpx stream mapping: stream #0:0 -> #0:0 (h264 (native) -> vp8 (libvpx)) press [q] stop, [?] frame= 33 fps= 22 q=0.0 size= 0kb time=00:00:00.00 bitrate=n/a dup=0 droframe= 43 fps= 22 q=0.0 lsize= 0kb time=00:00:00.00 bitrate=n/a dup=0 drop=1 video:0kb audio:0kb subtitle:0kb other streams:0kb global headers:0kb muxing overhead: unknown output file empty, nothing encoded (check -ss / -t / -frames parameters if used) received signal 2: terminating.
thanks in advance.
as far understand want to:
- get stream ip camera.
- encode stream using ffmpeg vp8 codec preserving original video resolution.
- send ffserver.
- stream further.
to need to:
- create ffserver.config file
- launch ffserver
- launch ffmpeg console script
your case requires:
- in config file uncomment video codec , remove bit rate
after launching server type in ffmpeg command:
ffmpeg -i rtsp://admin:admin@192.168.10.76:80 -c:v libvpx -b:v 800 -an htt_p://xxx.xx.xxx.xxx:server_http_port/feed1.ffm
[remove '_' http]
please note if camera supports more 1 resolution, ffmpeg choose worst if don't specify 1 need. can check supported resolution in web cams typing ffmpeg -f v4l2 -list_formats -i /dev/video0
. should work ip cam if replace /dev/video0
rtsp://admin:admin@192.168.10.76:80
.
also remember video bit rate (-b:v) depends on frame size.
Comments
Post a Comment