Re: [FFmpeg-user] h264 stream from Arecont camera

2016-01-13 Thread Jannes Faber
On 13 January 2016 at 14:46, Carl Eugen Hoyos  wrote:

> Jannes Faber  gmail.com> writes:
>
> > Is there any way ffmpeg can deal with such a stream directly?
>
> I believe it deals fine with the stream;-)
>

Wow you're right! I just tried to play it from the file and it just works!

However, I just tested the direct stream again:

ffplay 'http://10.1.1.233/h264stream1?ssn=1223&res=half&qp=1'

Takes about a minute of waiting and then only 1 frame appears.

(full output below, maybe I should have run it more vebose)

Piping curl to ffplay -  doesn't seem to work at all.

Knowing that it does work when first dumped into a file, would there be a
trick to get it to work while streaming? I ask because I was intending to
use tee to both record the stream as well as broadcast it over the network
(as this overpriced proprietary piece of xx doesn't support multicast
either).

And one more question if you don't mind: do you see any sort of (absolute)
timestamp in these frames? The camera is supposed to do 15 fps, but
depending on the uptime that slows down to 1fps or less. I would be awesome
to have some sort of time indication it is a security camera afterall.


> And even with your sed magic, I believe
> that the trailing 0's do not disappear, so
> remuxing may not have any advantages...
>
> I opened #5154 for your issue, on of the problems is
> that I was unable to find a specification;-(
>

Thank you! Just to add some more information, just in case it's relevant.

The device is 4 cameras in one dome, so there are 4 channels. You can see ETag:
Channel=1 in each of the "headers" in the h264stream.dump file I provided.

When I change the URL from 10.1.1.233/h264stream1
 to
10.1.1.233/h264stream 
(without the channel nr in the end) I get one stream that alternates ALL 4
channels. So each header will have  ETag: Channel=1  or  ETag: Channel=2
etc. Some way to split those out into 4 streams within ffmpeg would be
cool, but I understand that that's a whole different feature request.

The device also has some other proprietary streaming protocol over TFTP.
They offer NDA's for whoever want to use that. I've only had a cursory look
at that, but I could make some wireshark captures there if you wish.

http://www.arecontvision.com/pr/forcedown.php?file_name=ekViK2tsY2ZjRFlXeDdzVmFQd0Rvc0hRMzNxQjQzbm9BbVRCRnExTmNNQT0=&file_path=ZXo5V1dWSEhIL3F3SHNCbDJ0ZEtkbDlpaGFNTXkwNnNyMVgvWlljWUZIZz0=&file_path=Wkh5Q2FBc2VCSFhEeXFhQWNUTy9aL0ZzL0plaE9sWGd4VUpncUxOMzNPMD0=
contains some mentions of the fbdr boundary thing.


Please don't hesitate to ask if you need more information or want me to
test anything.

Thanks,
Jannes



ffplay version 2.8.4 Copyright (c) 2003-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
  libavformat56. 40.101 / 56. 40.101
  libavdevice56.  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
  libpostproc53.  3.100 / 53.  3.100
[h264 @ 0x7f3fec009260] Stream #0: not enough frames to estimate rate;
consider increasing probesize
Input #0, h264, from 'http://10.1.1.233/h264stream1?ssn=1223&res=half&qp=1':
  Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuv420p, 1280x960, 25 fps, 25 tbr,
1200k tbn, 50 tbc
nan M-V:nan fd=   0 aq=0KB vq=0KB sq=0B f=0/0
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


Re: [FFmpeg-user] h264 stream from Arecont camera

2016-01-13 Thread Carl Eugen Hoyos
Jannes Faber  gmail.com> writes:

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

I believe it deals fine with the stream;-)
And even with your sed magic, I believe 
that the trailing 0's do not disappear, so 
remuxing may not have any advantages...

I opened #5154 for your issue, on of the problems is 
that I was unable to find a specification;-(

Carl Eugen

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


Re: [FFmpeg-user] h264 stream from Arecont camera

2016-01-12 Thread Jannes Faber
https://drive.google.com/file/d/0BxMfj-zbDB1dOXh5djllY0lkLU0/view?usp=sharing

This still works for me on the file above:

cat h264stream.dump | sed -u -b -e '/^--fbdr\r$/ {N;N;N;d}' | ffmpeg -i -
-c:v copy bla.avi

Thank you for taking the time.

--
Jannes

On 12 January 2016 at 16:21, Carl Eugen Hoyos  wrote:

> On Tuesday 12 January 2016 03:35:32 pm Jannes Faber wrote:
> > 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?
>
> Please upload a sample as provided by curl (without sed).
>
> Carl Eugen
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


Re: [FFmpeg-user] h264 stream from Arecont camera

2016-01-12 Thread Carl Eugen Hoyos
On Tuesday 12 January 2016 03:35:32 pm Jannes Faber wrote:
> 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?

Please upload a sample as provided by curl (without sed).

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


[FFmpeg-user] h264 stream from Arecont camera

2016-01-12 Thread Jannes Faber
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:

  2d 2d 66 62 64 72 0d 0a  43 6f 6e 74 65 6e 74 2d
|--fbdr..Content-|
0010  54 79 70 65 3a 20 76 69  64 65 6f 2f 48 2e 32 36  |Type:
video/H.26|
0020  34 49 0d 0a 45 54 61 67  3a 20 43 68 61 6e 6e 65  |4I..ETag:
Channe|
0030  6c 3d 32 0d 0a 0d 0a 00  00 00 01 67 42 80 33 e9
|l=2gB.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
|=2A."..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
  libavformat56. 40.101 / 56. 40.101
  libavdevice56.  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
  libpostproc53.  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
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user