[FFmpeg-user] h264 stream from Arecont camera

Jannes Faber jannes.faber at gmail.com
Tue Jan 12 15:35:32 CET 2016


I'm getting headaches from this Arecont Vision AV20365CO in all sorts of
ways. I can get an mjpeg stream out of it and successfully store that with
ffmpeg.

http://10.1.1.233/mjpeg1?ssn=501&res=full&quality=10

But in an attempt to avoid many other (non ffmpeg related) problems with
that method, I'm now trying to get the h264 stream out of it. That stream
however contains a MIME header between each frame:

00000000  2d 2d 66 62 64 72 0d 0a  43 6f 6e 74 65 6e 74 2d
|--fbdr..Content-|
00000010  54 79 70 65 3a 20 76 69  64 65 6f 2f 48 2e 32 36  |Type:
video/H.26|
00000020  34 49 0d 0a 45 54 61 67  3a 20 43 68 61 6e 6e 65  |4I..ETag:
Channe|
00000030  6c 3d 32 0d 0a 0d 0a 00  00 00 01 67 42 80 33 e9
|l=2........gB.3.|
....
000ac100  00 00 00 00 00 00 00 00  00 00 00 00 00 0d 0a 2d
|...............-|
000ac110  2d 66 62 64 72 0d 0a 43  6f 6e 74 65 6e 74 2d 54
|-fbdr..Content-T|
000ac120  79 70 65 3a 20 76 69 64  65 6f 2f 48 2e 32 36 34  |ype:
video/H.264|
000ac130  50 0d 0a 45 54 61 67 3a  20 43 68 61 6e 6e 65 6c  |P..ETag:
Channel|
000ac140  3d 32 0d 0a 0d 0a 00 00  00 01 41 9a 22 00 b5 43
|=2........A."..C|

I can get it to work as follows, but this seems ridiculous and sed ends up
eating 10x as much CPU as ffmpeg and curl combined.

curl -s -o - 'http://10.1.1.233/h264stream2?ssn=121&res=half&qp=1' | sed -u
-b -e '/^--fbdr\r$/ {N;N;N;d}' | ffmpeg -i - -c:v copy bla.avi

Is there any way ffmpeg can deal with such a stream directly?

In the spirit of uncut output, an ffprobe below:

curl -s -o - 'http://10.1.1.233/h264stream2?ssn=121&res=half&qp=1' | sed -u
-b -e '/^--fbdr\r$/ {N;N;N;d}' | ffprobe -
ffprobe version 2.8.4 Copyright (c) 2007-2015 the FFmpeg developers
  built with gcc 5.1.1 (GCC) 20150618 (Red Hat 5.1.1-4)
  configuration: --prefix=/usr --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2
-g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic'
--enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls
--enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394
--disable-indev=jack --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg
--enable-libopus --enable-libpulse --enable-libschroedinger
--enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis
--enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265
--enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample
--enable-postproc --enable-pthreads --disable-static --enable-shared
--enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64
--enable-runtime-cpudetect
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[h264 @ 0x1333560] Stream #0: not enough frames to estimate rate; consider
increasing probesize
Input #0, h264, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuv420p, 1280x960, 25 fps, 25 tbr,
1200k tbn, 50 tbc

Thanks,

--
Jannes


More information about the ffmpeg-user mailing list