[FFmpeg-user] Reading from an ipcam via HTTP and streaming to a file

John Baker jbaker at dryfish.org.uk
Tue Mar 1 22:27:45 CET 2016


Hello,

I'm trying to use ffmpeg to stream from a Foscam FI8904 camera to an mp4
file. The camera only supports a jpeg or something stream via a CGI
(videostream.cgi). Output from wget:

Connecting to 192.168.0.123:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Server: Netwave IP Camera
  Date: Tue, 01 Mar 2016 21:17:14 GMT
  Accept-Ranges: bytes
  Connection: close
  Content-Type: multipart/x-mixed-replace;boundary=ipcamera
Length: unspecified [multipart/x-mixed-replace]
Saving to: ‘videostream.cgi.1’

...

Here's my attempt at ffmpeg command line usage, but given it won't work,
I'd be grateful if someone could correct me. I've copied it from an
online example and am not sure if I need all the parameters.

$ ffmpeg -i http://user:pass@192.168.0.123/videostream.cgi  -c copy -map
0 -f segment -segment_time 300 -segment_format mp4 -vcodec mjpeg x.mp4 
ffmpeg version 2.7.6-0ubuntu0.15.10.1 Copyright (c) 2000-2016 the FFmpeg
developers
  built with gcc 5.2.1 (Ubuntu 5.2.1-22ubuntu2) 20151010
  configuration: --prefix=/usr --extra-version=0ubuntu0.15.10.1
  --build-suffix=-ffmpeg --toolchain=hardened
  --libdir=/usr/lib/x86_64-linux-gnu
  --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared
  --disable-stripping --enable-avresample --enable-avisynth
  --enable-frei0r --enable-gnutls --enable-ladspa --enable-libass
  --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio
  --enable-libflite --enable-libfontconfig --enable-libfreetype
  --enable-libfribidi --enable-libgme --enable-libgsm
  --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg
  --enable-openal --enable-libopus --enable-libpulse --enable-librtmp
  --enable-libschroedinger --enable-libshine --enable-libspeex
  --enable-libtheora --enable-libtwolame --enable-libvorbis
  --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid
  --enable-libzvbi --enable-opengl --enable-x11grab --enable-libdc1394
  --enable-libiec61883 --enable-libzmq --enable-libssh --enable-libsoxr
  --enable-libx264 --enable-libopencv --enable-libx265
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr
  --extra-version=0ubuntu0.15.10.1 --build-suffix=-ffmpeg
  --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
  --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared
  --disable-stripping --enable-avresample --enable-avisynth
  --enable-frei0r --enable-gnutls --enable-ladspa --enable-libass
  --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio
  --enable-libflite --enable-libfontconfig --enable-libfreetype
  --enable-libfribidi --enable-libgme --enable-libgsm
  --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg
  --enable-openal --enable-libopus --enable-libpulse --enable-librtmp
  --enable-libschroedinger --enable-libshine --enable-libspeex
  --enable-libtheora --enable-libtwolame --enable-libvorbis
  --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid
  --enable-libzvbi --enable-opengl --enable-x11grab --enable-libdc1394
  --enable-libiec61883 --enable-libzmq --enable-libssh --enable-libsoxr
  --enable-libx264 --enable-libopencv --enable-libx265 --enable-version3
  --disable-doc --disable-programs --disable-avdevice --disable-avfilter
  --disable-avformat --disable-avresample --disable-postproc
  --disable-swscale --enable-libopencore_amrnb
  --enable-libopencore_amrwb --enable-libvo_aacenc
  --enable-libvo_amrwbenc
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
[ingenient @ 0x1e8fb40] Could not find codec parameters for stream 0
(Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
http://user:pass@192.168.0.123/videostream.cgi: could not find codec
parameters
Input #0, ingenient, from
'http://user:pass@192.168.0.123/videostream.cgi':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg, none(bt470bg/unknown/unknown), 25 tbr,
    1200k tbn, 25 tbc
[buffer @ 0x1e74820] Unable to parse option value "0x0" as image size
[buffer @ 0x1e74820] Unable to parse option value "-1" as pixel format
[buffer @ 0x1e74820] Unable to parse option value "0x0" as image size
[buffer @ 0x1e74820] Error setting option video_size to value 0x0.
[graph 0 input from stream 0:0 @ 0x1e74a00] Error applying options to
the filter.
Error opening filters!

Thanks!


John


More information about the ffmpeg-user mailing list