Shade
Shade

Reputation: 10001

FFmpeg cannot find codec parameters for yuv420p stream

I am trying to use FFmpeg (with IJKPlayer) to stream an RTSP stream from a camera. I am trying to do this on iOS, so I compiled FFmpeg by myself.

However, when I try to play the stream, it seems to produce an error:

Could not find codec parameters for stream 0 (Video: h264, 1 reference frame, none(left)): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options

Further down, the stream information displayed is as follows:

  Metadata:
    title           : streamed by the Santachi RTSP server
  Duration: N/A, start: 0.000000, bitrate: 64 kb/s
    Stream #0:0, 0, 1/90000: Video: h264, 1 reference frame, none(left), 90k tbr, 90k tbn, 180k tbc
    Stream #0:1, 0, 1/8000: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s

For reference, when I try to connect to the stream from my PC, it works, and the stream info I get is as follows:

  Metadata:
    title           : streamed by the Santachi RTSP server
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0, 28, 1/90000: Video: h264 (Main), 1 reference frame, yuv420p(progressive, left), 1280x720, 0/1, 20 tbr, 90k tbn, 180k tbc
    Stream #0:1, 17, 1/8000: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s

Seeing that the codec is yuv420p, I recompiled FFmpeg with the following options included:

COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=yuv4"
COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-demuxer=yuv4mpegpipe"

H264 decoder and parser are already enabled. However, the result was the same. Also, other streams, from different sources seem to work fine. It's just this particular camera's stream that doesn't work.

Since it seems that FFmpeg, when compiled correctly, can consume the stream, it seems that I am missing some options when compiling it, but I have no idea which options. Any help?

Upvotes: 1

Views: 2020

Answers (1)

Shade
Shade

Reputation: 10001

I managed to solve my problem by switching to VLCKit (available as a Pod for iOS). Although it still uses ffmpeg underneath, it does some "magic" with the stream and it seems to work fine.

Upvotes: 1

Related Questions