Pushing IP camera stream to MistServer with ffmpeg

1,574 views
Skip to first unread message

Drew Eidt

unread,
Oct 11, 2016, 1:03:34 PM10/11/16
to Mistserver.org

Hello,


I am trying to push an RTSP stream to my Mistserver with ffmpeg as suggested in other posts and have having issues. Any help is greatly appreciated.

On the same server as the Mistserver, I installed ffmpeg and am trying to execute:

 ffmpeg -i rtsp://admin:pass...@sub.domain.com:88/live/ch0 -vcodec libx264 -preset veryfast -profile:v baseline -level 30 -b 800 -f flv - | MistFLV2DTSC | MistBuffer stream_name


However, I am receiving the following error:


-bash: MistFLV2DTSC: command not found
-bash: MistBuffer: command not found
ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jun 17 2014 01:25:46 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --en                                                              able-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libdc1394 --enable-libgsm --enable-libmp3lame --e                                                              nable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvp                                                              x --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4                                                               -grecord-gcc-switches -m64 -mtune=generic -fPIC' --disable-stripping
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
[rtsp @ 0x100fa80] UDP timeout, retrying with TCP
[rtsp @ 0x100fa80] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, rtsp, from 'rtsp://admin:pass...@sub.domain.com:88/live/ch0':
  Metadata:
    title           : hysxrtpsion
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264, 90k tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: aac, 16000 Hz, mono, fltp
    Stream #0:2: Data: none
Please use -b:a or -b:v, -b is ambiguous
Codec AVOption preset (Set the encoding preset (cf. x264 --fullhelp)) specified for output file #0 (pipe:) has not been used for any stream. The most likely reason is either w                                                              rong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (pipe:) has not been used for any stream. The most likely reason is either wrong type (e.g. a video opt                                                              ion with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Codec AVOption profile () specified for output file #0 (pipe:) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video                                                               streams) or that it is a private option of some encoder which was not actually used for any stream.
[flv @ 0x1079dc0] FLV does not support sample rate 16000, choose from (44100, 22050, 11025)
Output #0, flv, to 'pipe:':
  Metadata:
    title           : hysxrtpsion
    encoder         : Lavf55.33.100
    Stream #0:0: Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 16000 Hz, mono, fltp
Stream mapping:
  Stream #0:1 -> #0:0 (aac -> libmp3lame)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input

Jaron Viëtor

unread,
Oct 11, 2016, 1:20:56 PM10/11/16
to mists...@googlegroups.com
On Tue, Oct 11, 2016 at 7:03 PM, Drew Eidt <eid...@gmail.com> wrote:

Hello,


I am trying to push an RTSP stream to my Mistserver with ffmpeg as suggested in other posts and have having issues. Any help is greatly appreciated.

On the same server as the Mistserver, I installed ffmpeg and am trying to execute:

 ffmpeg -i rtsp://admin:password@sub.domain.com:88/live/ch0 -vcodec libx264 -preset veryfast -profile:v baseline -level 30 -b 800 -f flv - | MistFLV2DTSC | MistBuffer stream_name


Hello Drew,

The problem is simple: the command you're using is for MistServer 0.X and we're now in the 2.X versions. Things have changed quite a bit since then!
The most portable equivalent would be something along these lines:

ffmpeg -i rtsp://admin:pass...@sub.domain.com:88/live/ch0 -vcodec libx264 -preset veryfast -profile:v baseline -level 30 -b 800 -f flv rtmp://localhost//STREAM_NAME

Where you'd replace "STREAM_NAME" with the name of the stream as configured through the web interface. Make sure to set the "source" parameter of this stream to "push://127.0.0.1" to accept pushes from localhost.
It is also possible to do this without using RTMP or sockets, but the method I just gave you is the most convenient to use.

Hope that helps!

Regards,
Jaron Viëtor
CTO, DDVTech
 

Drew Eidt

unread,
Oct 11, 2016, 9:20:17 PM10/11/16
to Mistserver.org
Thank you very much Jaron!

I think I am a lot closer, but it could not find the codec parameters. Do you have any ideas?

Thank you!


ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers

  built on Jun 17 2014 01:25:46 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)

  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --disable-stripping

  libavutil      52. 66.100 / 52. 66.100

  libavcodec     55. 52.102 / 55. 52.102

  libavformat    55. 33.100 / 55. 33.100

  libavdevice    55. 10.100 / 55. 10.100

  libavfilter     4.  2.100 /  4.  2.100

  libswscale      2.  5.102 /  2.  5.102

  libswresample   0. 18.100 /  0. 18.100

  libpostproc    52.  3.100 / 52.  3.100

[rtsp @ 0x165ba80] UDP timeout, retrying with TCP

[rtsp @ 0x165ba80] Could not find codec parameters for stream 0 (Video: h264): unspecified size

Consider increasing the value for the 'analyzeduration' and 'probesize' options

Input #0, rtsp, from 'rtsp://admin:password@sub.domain.com:88/live/ch0':

  Metadata:

    title           : hysxrtpsion

  Duration: N/A, start: 0.000000, bitrate: N/A

    Stream #0:0: Video: h264, 90k tbr, 90k tbn, 180k tbc

    Stream #0:1: Audio: aac, 16000 Hz, mono, fltp

    Stream #0:2: Data: none

Please use -b:a or -b:v, -b is ambiguous

Codec AVOption preset (Set the encoding preset (cf. x264 --fullhelp)) specified for output file #0 (rtmp://localhost/pc275_unboardroom) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.

Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (rtmp://localhost/pc275_unboardroom) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.

Codec AVOption profile () specified for output file #0 (rtmp://localhost/pc275_unboardroom) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.



On Tuesday, 11 October 2016 13:20:56 UTC-4, Jaron Viëtor wrote:
On Tue, Oct 11, 2016 at 7:03 PM, Drew Eidt <eid...@gmail.com> wrote:

Hello,


I am trying to push an RTSP stream to my Mistserver with ffmpeg as suggested in other posts and have having issues. Any help is greatly appreciated.

On the same server as the Mistserver, I installed ffmpeg and am trying to execute:

 ffmpeg -i rtsp://admin:password@sub.domain.com:88/live/ch0 -vcodec libx264 -preset veryfast -profile:v baseline -level 30 -b 800 -f flv - | MistFLV2DTSC | MistBuffer stream_name


Hello Drew,

The problem is simple: the command you're using is for MistServer 0.X and we're now in the 2.X versions. Things have changed quite a bit since then!
The most portable equivalent would be something along these lines:

ffmpeg -i rtsp://admin:password@sub.domain.com:88/live/ch0 -vcodec libx264 -preset veryfast -profile:v baseline -level 30 -b 800 -f flv rtmp://localhost//STREAM_NAME

Jaron Viëtor

unread,
Oct 12, 2016, 3:35:24 AM10/12/16
to mists...@googlegroups.com
On Wed, Oct 12, 2016 at 3:20 AM, Drew Eidt <eid...@gmail.com> wrote:
Thank you very much Jaron!

I think I am a lot closer, but it could not find the codec parameters. Do you have any ideas?

Thank you!

That doesn't look like it will stop ffmpeg.
But I just noticed that your camera is already in H264/AAC format, which means you can simplify the command a lot, to:

ffmpeg -i rtsp://admin:pass...@sub.domain.com:88/live/ch0 -c copy -f flv rtmp://localhost//STREAM_NAME

That should give you much better results, and also reduce the strain on your CPU significantly.
Sorry that I didn't notice that in your first post already.

- Jaron

Drew Eidt

unread,
Oct 12, 2016, 8:52:05 AM10/12/16
to Mistserver.org
Thank you very much Jaron and no worries at all!

I am receiving a lot less warnings/errors but am still receiving ''Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options"

Any ideas are greatly appreciated. Thank you!


ffmpeg -i rtsp://admin:pass...@sub.domain.com:88/live/ch0 -c copy -f flv rtmp://localhost/STREAM_NAME


ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jun 17 2014 01:25:46 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --disable-stripping
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
[rtsp @ 0x11949c0] UDP timeout, retrying with TCP
[rtsp @ 0x11949c0] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, rtsp, from 'rtsp://admin:pass...@sub.domain.com:88/live/ch0':
  Metadata:
    title           : hysxrtpsion
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264, 90k tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: aac, 16000 Hz, mono, fltp
    Stream #0:2: Data: none


On Wednesday, 12 October 2016 03:35:24 UTC-4, Jaron Viëtor wrote:
On Wed, Oct 12, 2016 at 3:20 AM, Drew Eidt <eid...@gmail.com> wrote:
Thank you very much Jaron!

I think I am a lot closer, but it could not find the codec parameters. Do you have any ideas?

Thank you!

That doesn't look like it will stop ffmpeg.
But I just noticed that your camera is already in H264/AAC format, which means you can simplify the command a lot, to:

ffmpeg -i rtsp://admin:password@sub.domain.com:88/live/ch0 -c copy -f flv rtmp://localhost//STREAM_NAME

Jaron Viëtor

unread,
Nov 14, 2016, 11:58:37 AM11/14/16
to mists...@googlegroups.com
Hello Drew,

Sorry for not getting back to you earlier.

It seems like ffmpeg really wants to know the picture size and cannot get it from the RTSP data for some reason.
You might want to try adding it manually with the -s WIDTHxHEIGHT option. E.g. something like:
ffmpeg -i rtsp://admin:password@sub.domain.com:88/live/ch0 -s 320x240 -c copy -f flv rtmp://localhost/STREAM_NAME
Obviously use the actual width/height instead, if you know them. Worst case you could do a re-encode, which will definitely work, but will be significantly slower. To do that, replace "-c copy" with "-c h264".
It also looks like your source has trouble connecting over UDP - you can force the connection to use TCP (instead of waiting for the slower autodetection as it does now) with the "-rtsp_transport tcp" option (put that all the way in front, right behind "ffmpeg" and before "-i", to use it).

Hopefully that will get everything up and running for you. Good luck!

Regards,
Jaron





On Wed, Oct 12, 2016 at 2:52 PM, Drew Eidt <eid...@gmail.com> wrote:
Thank you very much Jaron and no worries at all!

I am receiving a lot less warnings/errors but am still receiving ''Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options"

Any ideas are greatly appreciated. Thank you!


ffmpeg -i rtsp://admin:password@sub.domain.com:88/live/ch0 -c copy -f flv rtmp://localhost/STREAM_NAME


ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jun 17 2014 01:25:46 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --disable-stripping
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
[rtsp @ 0x11949c0] UDP timeout, retrying with TCP
[rtsp @ 0x11949c0] Could not find codec parameters for stream 0 (Video: h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, rtsp, from 'rtsp://admin:password@sub.domain.com:88/live/ch0':
  Metadata:
    title           : hysxrtpsion
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264, 90k tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: aac, 16000 Hz, mono, fltp
    Stream #0:2: Data: none


On Wednesday, 12 October 2016 03:35:24 UTC-4, Jaron Viëtor wrote:
On Wed, Oct 12, 2016 at 3:20 AM, Drew Eidt <eid...@gmail.com> wrote:
Thank you very much Jaron!

I think I am a lot closer, but it could not find the codec parameters. Do you have any ideas?

Thank you!

That doesn't look like it will stop ffmpeg.
But I just noticed that your camera is already in H264/AAC format, which means you can simplify the command a lot, to:

ffmpeg -i rtsp://admin:pass...@sub.domain.com:88/live/ch0 -c copy -f flv rtmp://localhost//STREAM_NAME

That should give you much better results, and also reduce the strain on your CPU significantly.
Sorry that I didn't notice that in your first post already.

- Jaron

--
You received this message because you are subscribed to the Google Groups "Mistserver.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mistserver+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages