FFMPEG Failed to open codec in avformat_find_stream_info for RTSP feed

0

I'm having an issue using FFMPEG when the version is greater than 2.8.15 (not a boundary - it's just that v3 and v4 do not work). ffprobe doesn't work either.

Version 3:

ffprobe -rtsp_transport tcp rtsp://user:password@ipaddress:5544/live0.264

returns:

[h264 @ 0xcd6e70] Overread VUI by 8 bits
[rtsp @ 0xcd3b10] Failed to open codec in av_find_stream_info
[NULL @ 0xcd6e70] Overread VUI by 8 bits
[h264 @ 0xcd6e70] Overread VUI by 8 bits
[rtsp @ 0xcd3b10] Could not find codec parameters for stream 0 (Video: h264 (High), none(progressive)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, rtsp, from 'rtsp://user:password@ipaddress:5544/live0.264':
  Metadata:
    title           : Session Streamed by LIBZRTSP
    comment         : live0.264
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (High), none(progressive), 90k tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s

and

ffmpeg -f rtsp -rtsp_transport tcp -y -i "rtsp://user:password@ipaddress:5544/live0.264" -f image2 -vframes 1 -vsync 2 -pix_fmt yuvj420p "/home/james/photo_$(date +%Y.%m.%d_%H:%M:%S).jpg"

returns

[h264 @ 0x1634680] Overread VUI by 8 bits
[rtsp @ 0x16312f0] Failed to open codec in av_find_stream_info
[NULL @ 0x1634680] Overread VUI by 8 bits
[h264 @ 0x1634680] Overread VUI by 8 bits
[rtsp @ 0x16312f0] Could not find codec parameters for stream 0 (Video: h264 (High), none(progressive)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://user:password@ipaddress:5544/live0.264':
  Metadata:
    title           : Session Streamed by LIBZRTSP
    comment         : live0.264
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (High), none(progressive), 90k tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
[buffer @ 0x177e510] Unable to parse option value "0x0" as image size
[buffer @ 0x177e510] Unable to parse option value "-1" as pixel format
[buffer @ 0x177e510] Unable to parse option value "0x0" as image size
[buffer @ 0x177e510] Error setting option video_size to value 0x0.
[graph 0 input from stream 0:0 @ 0x177e490] Error applying options to the filter.
Error opening filters!

Version 4 is identical, except it mentions avformat_find_stream_info instead of av_find_stream_info

But...

Version 2.8.15:

ffmpeg -f rtsp -rtsp_transport tcp -y -i "rtsp://user:password@ipaddress:5544/live0.264" -f image2 -vframes 1 -vsync 2 -pix_fmt yuvj420p "/home/james/photo_$(date +%Y.%m.%d_%H:%M:%S).jpg"

returns:

[h264 @ 0x2243e80] Overread VUI by 8 bits
    Last message repeated 5 times
Invalid UE golomb code
    Last message repeated 1 times
Guessed Channel Layout for  Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://user:password@ipaddress:5544/live0.264':
  Metadata:
    title           : Session Streamed by LIBZRTSP
    comment         : live0.264
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709), 1920x1080, 10 fps, 10 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s
[h264 @ 0x242bd60] Overread VUI by 8 bits
    Last message repeated 2 times
Output #0, image2, to '/home/james/photo_2019.04.04_10:17:03.jpg':
  Metadata:
    title           : Session Streamed by LIBZRTSP
    comment         : live0.264
    encoder         : Lavf56.40.101
    Stream #0:0: Video: mjpeg, yuvj420p(pc), 1920x1080, q=2-31, 200 kb/s, 10 fps, 10 tbn, 10 tbc
    Metadata:
      encoder         : Lavc56.60.100 mjpeg
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
Invalid UE golomb code
frame=    1 fps=0.0 q=9.5 Lsize=N/A time=00:00:00.10 bitrate=N/A
video:146kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

But definitely works and returns the correct photo.

For diagnostic purposes, I also have a lower res stream coming out of the camera: rtsp://user:password@ipaddress:5544/live1.264 Which works on all versions!

Is there anyway I can see the steam info to see the difference?

Is it because the RTSP stream is invalid, but workable for v2 (and rejected for v3)? Or is there something else wrong that I can fix by changing parameters?

Any guidance for getting this to work on a at least v3 would be greatly appreciated.

Unfortunately, these cameras are made to look like PIR alarm sensors, and are powered over Ethernet so there aren't really any other options on the market.

Thanks, let me know if you want any other info?

Update 04/04/2019 17:20 London: I have played with the stream settings in the camera and found that the higher res stream works when I set the stream to 720p. But as soon as I switch back to 1080p it fails again. Not sure if this is helpful.

James Jennett-Wheeler

Posted 2019-04-04T11:58:11.763

Reputation: 1

Answers

0

The camera is producing and invalid VUI, which is part of the SPS. You will need to patch ffmpeg to handle this error more gracefully, or the camera manufacture needs fix it via a firmware update.

szatmary

Posted 2019-04-04T11:58:11.763

Reputation: 2 181

Thank you, I have messaged the camera seller on ali express. I will update once I know.

I have also posted an update on some recent info I accidentally discovered, but not sure if this is relevant. – James Jennett-Wheeler – 2019-04-04T16:22:50.010