Discussion:
[Libav-user] Problems decoding h264 (Baseline, yuvj420p) ip camera stream
Alexander Wischnewski
2013-06-06 11:25:01 UTC
Permalink
Hello,

i am having troubles to decode a h264 live stream provided by an HD ip
camera. I tried first with the recent git version of ffmpeg on android and
then later on my mac, the results always looks the same as below.

Maybe someone can give me a hint what i am doing wrong.


ffmpeg -v 9 -loglevel 99 -report -i "
http://192.168.1.166:86/livestream/12?action=play&media=video" output.mp4
ffmpeg started on 2013-06-06 at 19:20:34
Report written to "ffmpeg-20130606-192034.log"
ffmpeg version N-53869-gb26bcd0 Copyright (c) 2000-2013 the FFmpeg
developers
built on Jun 6 2013 17:59:32 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/usr/local
libavutil 52. 35.100 / 52. 35.100
libavcodec 55. 15.100 / 55. 15.100
libavformat 55. 8.102 / 55. 8.102
libavdevice 55. 2.100 / 55. 2.100
libavfilter 3. 75.101 / 3. 75.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with
argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument '99'.
Reading option '-report' ... matched as option 'report' (generate a report)
with argument '1'.
Reading option '-i' ... matched as input file with argument '
http://192.168.1.166:86/livestream/12?action=play&media=video'.
Reading option 'output.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file
http://192.168.1.166:86/livestream/12?action=play&media=video.
Successfully parsed a group of options.
Opening an input file:
http://192.168.1.166:86/livestream/12?action=play&media=video.
[h264 @ 0x7f9f4b00f800] Format h264 probed with size=2048 and score=51
[h264 @ 0x7f9f4b00f800] File position before avformat_find_stream_info() is
0
[h264 @ 0x7f9f4b039a00] no picture
[h264 @ 0x7f9f4b039a00] left block unavailable for requested intra4x4 mode
-1 at 0 0
[h264 @ 0x7f9f4b039a00] error while decoding MB 0 0
[h264 @ 0x7f9f4b039a00] concealing 880 DC, 880 AC, 880 MV errors in I frame
[h264 @ 0x7f9f4b039a00] missing picture in access unit with size 17
Last message repeated 1 times
[h264 @ 0x7f9f4b039a00] sps_id out of range
[h264 @ 0x7f9f4b039a00] chroma_format_idc 9 is illegal
[h264 @ 0x7f9f4b039a00] chroma_format_idc 5 is illegal
[h264 @ 0x7f9f4b039a00] missing picture in access unit with size 17
[h264 @ 0x7f9f4b039a00] illegal bit depth value (10, 8)
[h264 @ 0x7f9f4b039a00] sps_id out of range
[h264 @ 0x7f9f4b039a00] illegal bit depth value (11, 8)
[h264 @ 0x7f9f4b039a00] sps_id out of range
[h264 @ 0x7f9f4b039a00] pps_id out of range
[h264 @ 0x7f9f4b039a00] sps_id out of range
[h264 @ 0x7f9f4b039a00] illegal bit depth value (8, 14)
[h264 @ 0x7f9f4b039a00] pps_id out of range
[h264 @ 0x7f9f4b039a00] non-existing PPS referenced
[h264 @ 0x7f9f4b00f800] max_analyze_duration 5000000 reached at 5000000
microseconds
[h264 @ 0x7f9f4b00f800] File position after avformat_find_stream_info() is
133692
Input #0, h264, from '
http://192.168.1.166:86/livestream/12?action=play&media=video':
Duration: N/A, bitrate: N/A
Stream #0:0, 152, 1/1200000: Video: h264 (Baseline), yuvj420p, 640x352,
1/60, 30 fps, 30 tbr, 1200k tbn, 60 tbc
Successfully opened the file.
Parsing a group of options: output file output.mp4.
Successfully parsed a group of options.
Opening an output file: output.mp4.
Successfully opened the file.
detected 4 logical cores
[graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'video_size' to
value '640x352'
[graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'pix_fmt' to value
'12'
[graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'time_base' to
value '1/1200000'
[graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'pixel_aspect' to
value '0/1'
[graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'sws_param' to
value 'flags=2'
[graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] Setting 'frame_rate' to
value '60/2'
[graph 0 input from stream 0:0 @ 0x7f9f4b8003a0] w:640 h:352
pixfmt:yuvj420p tb:1/1200000 fr:30/1 sar:0/1 sws_param:flags=2
[format @ 0x7f9f4b800a40] compat: called with args=[yuv420p]
[format @ 0x7f9f4b800a40] Setting 'pix_fmts' to value 'yuv420p'
[auto-inserted scaler 0 @ 0x7f9f4ac10d00] Setting 'flags' to value '0x4'
[auto-inserted scaler 0 @ 0x7f9f4ac10d00] w:iw h:ih flags:'0x4' interl:0
[format @ 0x7f9f4b800a40] auto-inserting filter 'auto-inserted scaler 0'
between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x7f9f4ac10e00] query_formats: 4 queried, 3 merged, 1
already done, 0 delayed
[auto-inserted scaler 0 @ 0x7f9f4ac10d00] w:640 h:352 fmt:yuvj420p sar:0/1
-> w:640 h:352 fmt:yuv420p sar:0/1 flags:0x4
[mpeg4 @ 0x7f9f4b036600] intra_quant_bias = 0 inter_quant_bias = -64
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf55.8.102
Stream #0:0, 0, 1/15360: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p,
640x352, 1/30, q=2-31, 200 kb/s, 15360 tbn, 30 tbc
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mpeg4)
Press [q] to stop, [?] for help
[h264 @ 0x7f9f4b038e00] no picture
[h264 @ 0x7f9f4b038e00] left block unavailable for requested intra4x4 mode
-1 at 0 0
[h264 @ 0x7f9f4b038e00] error while decoding MB 0 0
[h264 @ 0x7f9f4b038e00] concealing 880 DC, 880 AC, 880 MV errors in I frame
[h264 @ 0x7f9f4b023400] out of range intra chroma pred mode at 37 0
[h264 @ 0x7f9f4b023400] error while decoding MB 37 0
[h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b023400] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b023a00] cbp too large (111) at 32 0
[h264 @ 0x7f9f4b023a00] error while decoding MB 32 0
[h264 @ 0x7f9f4b023a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b023a00] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b025a00] P sub_mb_type 4 out of range at 10 4
[h264 @ 0x7f9f4b025a00] error while decoding MB 10 4
[h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b025a00] concealing 759 DC, 759 AC, 759 MV errors in P frame
[h264 @ 0x7f9f4b026000] mb_type 28 in P slice too large at 19 3
[h264 @ 0x7f9f4b026000] error while decoding MB 19 3
[h264 @ 0x7f9f4b026000] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b026000] concealing 790 DC, 790 AC, 790 MV errors in P frame
[h264 @ 0x7f9f4b038e00] top block unavailable for requested intra mode at
36 0
[h264 @ 0x7f9f4b038e00] error while decoding MB 36 0
[h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b038e00] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b023400] slice type too large (32) at 39 21
[h264 @ 0x7f9f4b023400] decode_slice_header error
[h264 @ 0x7f9f4b023400] no frame!
[h264 @ 0x7f9f4b023a00] mb_type 28 in P slice too large at 20 2
[h264 @ 0x7f9f4b023a00] error while decoding MB 20 2
[h264 @ 0x7f9f4b023a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b023a00] concealing 829 DC, 829 AC, 829 MV errors in P frame
[h264 @ 0x7f9f4b025a00] cbp too large (88) at 22 0
[h264 @ 0x7f9f4b025a00] error while decoding MB 22 0
[h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b025a00] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b026000] mb_type 28 in P slice too large at 12 1
[h264 @ 0x7f9f4b026000] error while decoding MB 12 1
[h264 @ 0x7f9f4b026000] Unknown NAL code: 17 (94 bits)
[h264 @ 0x7f9f4b026000] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b026000] concealing 877 DC, 877 AC, 877 MV errors in P frame
Error while decoding stream #0:0: Operation not permitted
[h264 @ 0x7f9f4b038e00] cbp too large (247) at 32 0
[h264 @ 0x7f9f4b038e00] error while decoding MB 32 0
[h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b038e00] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b023400] mb_type 29 in P slice too large at 19 4
[h264 @ 0x7f9f4b023400] error while decoding MB 19 4
[h264 @ 0x7f9f4b023400] Unknown NAL code: 24 (94 bits)
[h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b023400] concealing 750 DC, 750 AC, 750 MV errors in P frame
[h264 @ 0x7f9f4b023a00] P sub_mb_type 4 out of range at 14 1
[h264 @ 0x7f9f4b023a00] error while decoding MB 14 1
[h264 @ 0x7f9f4b023a00] Unknown NAL code: 17 (94 bits)
[h264 @ 0x7f9f4b023a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b023a00] concealing 875 DC, 875 AC, 875 MV errors in P frame
[h264 @ 0x7f9f4b025a00] P sub_mb_type 11 out of range at 5 3
[h264 @ 0x7f9f4b025a00] error while decoding MB 5 3
[h264 @ 0x7f9f4b025a00] Unknown NAL code: 23 (94 bits)
[h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b025a00] concealing 804 DC, 804 AC, 804 MV errors in P frame
[h264 @ 0x7f9f4b026000] out of range intra chroma pred mode at 34 6
[h264 @ 0x7f9f4b026000] error while decoding MB 34 6
[h264 @ 0x7f9f4b026000] Unknown NAL code: 31 (94 bits)
[h264 @ 0x7f9f4b026000] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b026000] concealing 655 DC, 655 AC, 655 MV errors in P frame
[h264 @ 0x7f9f4b038e00] mb_type 30 in P slice too large at 29 11
[h264 @ 0x7f9f4b038e00] error while decoding MB 29 11
[h264 @ 0x7f9f4b038e00] Unknown NAL code: 28 (94 bits)
[h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b038e00] concealing 460 DC, 460 AC, 460 MV errors in P frame
[h264 @ 0x7f9f4b023400] out of range intra chroma pred mode at 28 2
[h264 @ 0x7f9f4b023400] error while decoding MB 28 2
[h264 @ 0x7f9f4b023400] Unknown NAL code: 26 (94 bits)
[h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b023400] concealing 821 DC, 821 AC, 821 MV errors in P frame
[h264 @ 0x7f9f4b023a00] top block unavailable for requested intra mode at
18 0
[h264 @ 0x7f9f4b023a00] error while decoding MB 18 0
[h264 @ 0x7f9f4b023a00] Unknown NAL code: 23 (94 bits)
[h264 @ 0x7f9f4b023a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b023a00] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b025a00] P sub_mb_type 6 out of range at 5 7
[h264 @ 0x7f9f4b025a00] error while decoding MB 5 7
[h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b025a00] concealing 644 DC, 644 AC, 644 MV errors in P frame
[h264 @ 0x7f9f4b026000] slice type too large (32) at 38 21
[h264 @ 0x7f9f4b026000] decode_slice_header error
[h264 @ 0x7f9f4b026000] no frame!
[h264 @ 0x7f9f4b038e00] P sub_mb_type 9 out of range at 39 4
[h264 @ 0x7f9f4b038e00] error while decoding MB 39 4
[h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b038e00] concealing 730 DC, 730 AC, 730 MV errors in P frame
[h264 @ 0x7f9f4b023400] P sub_mb_type 4 out of range at 6 0
[h264 @ 0x7f9f4b023400] error while decoding MB 6 0
[h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b023400] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b023a00] left block unavailable for requested intra4x4 mode
-1 at 0 0
[h264 @ 0x7f9f4b023a00] error while decoding MB 0 0
[h264 @ 0x7f9f4b023a00] concealing 880 DC, 880 AC, 880 MV errors in I frame
Error while decoding stream #0:0: Operation not permitted
[h264 @ 0x7f9f4b025a00] cbp too large (110) at 4 0
[h264 @ 0x7f9f4b025a00] error while decoding MB 4 0
[h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b025a00] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b026000] top block unavailable for requested intra mode at
12 0
[h264 @ 0x7f9f4b026000] error while decoding MB 12 0
[h264 @ 0x7f9f4b026000] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b026000] concealing 880 DC, 880 AC, 880 MV errors in P frame
*** 1 dup!
[h264 @ 0x7f9f4b038e00] P sub_mb_type 5 out of range at 19 5
[h264 @ 0x7f9f4b038e00] error while decoding MB 19 5
[h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b038e00] concealing 710 DC, 710 AC, 710 MV errors in P frame
[h264 @ 0x7f9f4b023400] top block unavailable for requested intra mode at
13 0
[h264 @ 0x7f9f4b023400] error while decoding MB 13 0
[h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b023400] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b023a00] top block unavailable for requested intra mode at
32 0
[h264 @ 0x7f9f4b023a00] error while decoding MB 32 0
[h264 @ 0x7f9f4b023a00] Unknown NAL code: 25 (94 bits)
[h264 @ 0x7f9f4b023a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b023a00] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b025a00] mb_type 27 in P slice too large at 34 4
[h264 @ 0x7f9f4b025a00] error while decoding MB 34 4
[h264 @ 0x7f9f4b025a00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b025a00] concealing 735 DC, 735 AC, 735 MV errors in P frame
[h264 @ 0x7f9f4b026000] P sub_mb_type 4 out of range at 12 3
[h264 @ 0x7f9f4b026000] error while decoding MB 12 3
[h264 @ 0x7f9f4b026000] Unknown NAL code: 31 (94 bits)
[h264 @ 0x7f9f4b026000] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b026000] concealing 797 DC, 797 AC, 797 MV errors in P frame
[h264 @ 0x7f9f4b038e00] mb_type 28 in P slice too large at 13 0
[h264 @ 0x7f9f4b038e00] error while decoding MB 13 0
[h264 @ 0x7f9f4b038e00] Cannot use next picture in error concealment
[h264 @ 0x7f9f4b038e00] concealing 880 DC, 880 AC, 880 MV errors in P frame
[h264 @ 0x7f9f4b023400] sps_id out of range
[h264 @ 0x7f9f4b023400] P sub_mb_type 5 out of range at 16 3
[h264 @ 0x7f9f4b023400] error while decoding MB 16 3
[h264 @ 0x7f9f4b023400] Cannot use next picture in error concealment
Carl Eugen Hoyos
2013-06-06 11:35:52 UTC
Permalink
Post by Alexander Wischnewski
ffmpeg -v 9 -loglevel 99 -report -i
"http://192.168.1.166:86/livestream/12?action=play&media=video"
output.mp4
I you succeed in saving the incoming stream to a file
(and if the problem is also reproducible with that
file), please upload a sample.

Carl Eugen
Alexander Wischnewski
2013-06-06 12:16:43 UTC
Permalink
Hello Carl,

thanks for the fast reply. It is reproducible, i dumped the stream to a
.avi file and uploaded it to upload.ffmpeg.org as described in the bug
report online documentation.

h264_ip_cam_decoding_issue.txt
h264_ip_cam_input.avi


Greetings,
Alex
Post by Carl Eugen Hoyos
Post by Alexander Wischnewski
ffmpeg -v 9 -loglevel 99 -report -i
"http://192.168.1.166:86/livestream/12?action=play&media=video"
output.mp4
I you succeed in saving the incoming stream to a file
(and if the problem is also reproducible with that
file), please upload a sample.
Carl Eugen
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Carl Eugen Hoyos
2013-06-06 12:47:09 UTC
Permalink
thanks for the fast reply. It is reproducible, i
dumped the stream to a .avi file
How did you produce the avi file?

Carl Eugen
Alexander Wischnewski
2013-06-06 12:50:10 UTC
Permalink
I used this command:

ffmpeg -i "http://192.168.1.166:86/livestream/12?action=play&media=video"
-vcodec copy h264_ip_cam_input.avi

Was this the wrong way ?

Greetings,
Alex
Post by Carl Eugen Hoyos
Post by Alexander Wischnewski
thanks for the fast reply. It is reproducible, i
dumped the stream to a .avi file
How did you produce the avi file?
Carl Eugen
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Carl Eugen Hoyos
2013-06-06 13:28:22 UTC
Permalink
Post by Alexander Wischnewski
ffmpeg -i "http://192.168.1.166:86/livestream/12?action=play&media=video"
-vcodec copy h264_ip_cam_input.avi
Was this the wrong way ?
Not necessarily, but it will likely not help showing
if there is a bug in FFmpeg or not.
Does wget work? Or is there maybe another program to
simply dump the network packets?

Carl Eugen
Alexander Wischnewski
2013-06-06 15:47:32 UTC
Permalink
wget didnt worked, but i have a small test program to save the stream
output.
The saved file gets decoded well with ffmpeg, so it seems it is not a
decoding issue.

The test program is removing any RTSP / RTP header information, the camera
with the working h264 http stream is sending the same RTSP / RTP headers, i
dont think this is the cause. Now i am more confused ....

When i recording the raw stream of both cameras on hard disk the only big
difference is the file size, the stream not working is producing much more
data. Is there a way to change the http buffer size for incoming packets in
ffmpeg ?

Greetings,
Alex
Post by Carl Eugen Hoyos
Post by Alexander Wischnewski
ffmpeg -i "http://192.168.1.166:86/livestream/12?action=play&media=video
"
Post by Alexander Wischnewski
-vcodec copy h264_ip_cam_input.avi
Was this the wrong way ?
Not necessarily, but it will likely not help showing
if there is a bug in FFmpeg or not.
Does wget work? Or is there maybe another program to
simply dump the network packets?
Carl Eugen
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Andrey Utkin
2013-06-06 15:54:17 UTC
Permalink
Post by Alexander Wischnewski
wget didnt worked, but i have a small test program to save the stream
output.
The saved file gets decoded well with ffmpeg, so it seems it is not a
decoding issue.
The test program is removing any RTSP / RTP header information, the camera
with the working h264 http stream is sending the same RTSP / RTP headers, i
dont think this is the cause. Now i am more confused ....
When i recording the raw stream of both cameras on hard disk the only big
difference is the file size, the stream not working is producing much more
data. Is there a way to change the http buffer size for incoming packets in
ffmpeg ?
What i don't understand is why you talk about RTSP and RTP while your
URL is HTTP?

--
Andrey Utkin
Alexander Wischnewski
2013-06-06 16:00:02 UTC
Permalink
As i said before, the camera itself is streaming rtsp via http tunnel but i
had no problems with this so far.
Post by Alexander Wischnewski
Post by Alexander Wischnewski
wget didnt worked, but i have a small test program to save the stream
output.
The saved file gets decoded well with ffmpeg, so it seems it is not a
decoding issue.
The test program is removing any RTSP / RTP header information, the
camera
Post by Alexander Wischnewski
with the working h264 http stream is sending the same RTSP / RTP
headers, i
Post by Alexander Wischnewski
dont think this is the cause. Now i am more confused ....
When i recording the raw stream of both cameras on hard disk the only big
difference is the file size, the stream not working is producing much
more
Post by Alexander Wischnewski
data. Is there a way to change the http buffer size for incoming packets
in
Post by Alexander Wischnewski
ffmpeg ?
What i don't understand is why you talk about RTSP and RTP while your
URL is HTTP?
--
Andrey Utkin
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Andrey Utkin
2013-06-07 14:03:59 UTC
Permalink
Post by Alexander Wischnewski
As i said before, the camera itself is streaming rtsp via http tunnel but i
had no problems with this so far.
Obviously tunneling application looses stream data, and that is actual problem.

--
Andrey Utkin
Alexander Wischnewski
2013-06-07 15:17:22 UTC
Permalink
Post by Andrey Utkin
Post by Alexander Wischnewski
As i said before, the camera itself is streaming rtsp via http tunnel
but i
Post by Alexander Wischnewski
had no problems with this so far.
Obviously tunneling application looses stream data, and that is actual problem.
--
Andrey Utkin
Thats what i would assume too when tunneled streams generally would not
work with ffmpeg, but they do actually.

Greetings,
Alex
Alexander Wischnewski
2013-06-06 15:55:20 UTC
Permalink
Actually thats not nonsense, i set the wrong framerate, file size is the
same.
Post by Alexander Wischnewski
wget didnt worked, but i have a small test program to save the stream
output.
The saved file gets decoded well with ffmpeg, so it seems it is not a
decoding issue.
The test program is removing any RTSP / RTP header information, the camera
with the working h264 http stream is sending the same RTSP / RTP headers, i
dont think this is the cause. Now i am more confused ....
When i recording the raw stream of both cameras on hard disk the only big
difference is the file size, the stream not working is producing much more
data. Is there a way to change the http buffer size for incoming packets in
ffmpeg ?
Greetings,
Alex
Post by Alexander Wischnewski
Post by Alexander Wischnewski
ffmpeg -i "
http://192.168.1.166:86/livestream/12?action=play&media=video"
Post by Alexander Wischnewski
-vcodec copy h264_ip_cam_input.avi
Was this the wrong way ?
Not necessarily, but it will likely not help showing
if there is a bug in FFmpeg or not.
Does wget work? Or is there maybe another program to
simply dump the network packets?
Carl Eugen
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Alexander Wischnewski
2013-06-07 13:08:35 UTC
Permalink
I uploaded 2 new files, the stream input with header informations of two
cameras with the same stream protocol for testing.

The file h264_ip_cam_input.working of the first camera gets decoded well
with the command:

ffmpeg -f h264 -i h264_ip_cam_input.working output.mp4

The file h264_ip_cam_input.nworking produces the errors as posted before.

Greetings,
Alex
Post by Carl Eugen Hoyos
Post by Alexander Wischnewski
ffmpeg -i "http://192.168.1.166:86/livestream/12?action=play&media=video
"
Post by Alexander Wischnewski
-vcodec copy h264_ip_cam_input.avi
Was this the wrong way ?
Not necessarily, but it will likely not help showing
if there is a bug in FFmpeg or not.
Does wget work? Or is there maybe another program to
simply dump the network packets?
Carl Eugen
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Carl Eugen Hoyos
2013-06-07 13:25:49 UTC
Permalink
The file h264_ip_cam_input.working of the first
Do I understand correctly that one camera produces
a stream that FFmpeg can decode but another one
produces a stream that cannot be decoded?
Or do I misunderstand?

Mostly out of curiosity:
How did you produce this file?
ffmpeg -f h264 -i h264_ip_cam_input.working output.mp4
Is "-f h264" needed, ie does auto-detection not work?

Please do not top-post here, Carl Eugen
Alexander Wischnewski
2013-06-07 13:33:21 UTC
Permalink
Its not needed but i am always using it for testing.

Yes, the chipsets of the cameras are different, the protocol for the stream
is the same. Thats at least what the documentation of the manufactor
says.The camera with the working stream is an older model, i never had this
kind of trouble before. I am using a small C program for fetching the
stream and writing the received bytes to a file.

Greeting,
Alex
Post by Carl Eugen Hoyos
Post by Alexander Wischnewski
The file h264_ip_cam_input.working of the first
Do I understand correctly that one camera produces
a stream that FFmpeg can decode but another one
produces a stream that cannot be decoded?
Or do I misunderstand?
How did you produce this file?
Post by Alexander Wischnewski
ffmpeg -f h264 -i h264_ip_cam_input.working output.mp4
Is "-f h264" needed, ie does auto-detection not work?
Please do not top-post here, Carl Eugen
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Carl Eugen Hoyos
2013-06-07 17:58:01 UTC
Permalink
The file h264_ip_cam_input.nworking produces the
errors as posted before.
This does not look like a valid h264 file (afaict),
at least the reference decoder refuses to decode it.

Carl Eugen
tapas
2015-06-01 03:55:49 UTC
Permalink
Hi ,

I am also running into same issue . I can record but I cannot broadcast my
h264 rtsp stream from my ip camera.

here is the command which I am trying :

*/home/broadcaster/bin/ffmpeg -use_wallclock_as_timestamps 1 -r 25
-thread_queue_size 51200 -threads 4 -i
rtsp://admin:***@192.168.0.200:8557/PSIA/Streaming/channels/2?videoCodecType=H.264
-use_wallclock_as_timestamps 1 -r 25 -b:v 2048k -bufsize 20480 -c:v copy -f
avi cam.avi*

*Output during recording:*
ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.1 (Ubuntu 4.9.1-16ubuntu6)
configuration: --prefix=/home/broadcaster/ffmpeg_2.6_building/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/broadcaster/ffmpeg_2.6_building/ffmpeg_build/include
--extra-ldflags=-L/home/broadcaster/ffmpeg_2.6_building/ffmpeg_build/lib
--bindir=/home/broadcaster/bin --enable-gpl --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx
--enable-libx264 --enable-libx265 --enable-nonfree --disable-inline-asm
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[h264 @ 0x2ba4cc0] RTP: missed 5 packets
[h264 @ 0x2ba4cc0] RTP: missed 1 packets
[h264 @ 0x2ba4cc0] RTP: missed 17 packets
[h264 @ 0x2ba4cc0] RTP: missed 14 packets
Input #0, rtsp, from
'rtsp://admin:***@192.168.0.200:8557/PSIA/Streaming/channels/2?videoCodecType=H.264':
Metadata:
title : RTSP/RTP stream from Network Video Server
comment : 2?videoCodecType=H.264
Duration: N/A, start: 1433129457.153767, bitrate: N/A
Stream #0:0: Video: h264 (High), yuvj420p(pc), 1920x1080, 25 fps, 25
tbr, 90k tbn, 50 tbc
Output #0, avi, to 'cam.avi':
Metadata:
INAM : RTSP/RTP stream from Network Video Server
ICMT : 2?videoCodecType=H.264
ISFT : Lavf56.25.101
Stream #0:0: Video: h264 (H264 / 0x34363248), yuvj420p, 1920x1080,
q=2-31, 2048 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
===========================================


If I play this file in vlc then vlc can also play. If I use libx264 to
re-encode then I can put it in flv container but if I try to copy stream and
put it in flv container then it does not work at all. . Even vlc cannot play
such video file.

Here is the command which I am using for broadcasting with ffmpeg:

*/home/broadcaster/bin/ffmpeg -use_wallclock_as_timestamps 1 -r 25
-thread_queue_size 51200 -threads 4 -i
"rtsp://admin:admin@$1:8557/PSIA/Streaming/channels/2?videoCodecType=H.264"
-use_wallclock_as_timestamps 1 -r 25 -b:v 2048k -bufsize 20480 -c:v copy -f
flv rtmp://vaughn.tv.url*


Please also note that I collected stream info from vlc player as it can play
this rtsp stream directly from camera. here is the video codec info
generated by vlc :


Codec: H264 - MPEG-4 AVC (part 10) (h264)
Resolution: 1920x1090
Display resolution: 1920x1080
Frame rate: 25
Decoded format: Planar 4:2:0 YUV full scale

So in summary:
1) ffmpeg is detecting incoming rtsp pixel format as yuvj420p .
2) ffmpeg can record it to avi container without re-encoding it again using
above command
3) but ffmpeg cannot re-stream/save it to any flv container file without
re-encoding again with libx264.

my question is why we are hitting this issue for yuvj420p pixel format in
ffmpeg ? Is this a bug in ffmpeg ?

I build latest ffmpeg 2.6.2 from source code and It works fine perfectly for
my other ip camera which has yuv420p pixel format for h264 rtsp stream.

Please suggest



--
View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Problems-decoding-h264-Baseline-yuvj420p-ip-camera-stream-tp4657799p4661188.html
Sent from the libav-users mailing list archive at Nabble.com.
Carl Eugen Hoyos
2015-06-01 21:03:31 UTC
Permalink
Post by tapas
3) but ffmpeg cannot re-stream/save it to any flv container
file without re-encoding again with libx264.
Command line and complete, uncut console output missing.
Post by tapas
my question is why we are hitting this issue for yuvj420p
pixel format in ffmpeg ? Is this a bug in ffmpeg ?
This is not a bug and not related.
(Afaict).
Post by tapas
I build latest ffmpeg 2.6.2 from source code
But when posting here you are required to build
from git head first.
(Apart from 2.6.2 being not "latest".)

Please do not revive ancient mailing list threads.

Carl Eugen

Camera Man
2013-06-06 12:19:50 UTC
Permalink
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="direction: ltr;">
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body style="direction: ltr;"
bidimailui-detected-decoding-type="latin-charset" bgcolor="#ffffff"
text="#000000">
On 06/06/2013 07:25 AM, Alexander Wischnewski wrote:
<blockquote
cite="mid:CAJg_av-gC-***@mail.gmail.com"
type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div style="">i am having troubles to decode a h264 live stream
provided by an HD ip camera. I tried first with the recent git
version of ffmpeg on android and then later on my mac, the
results always looks the same as below.</div>
<div style=""><br>
</div>
<div style="">Maybe someone can give me a hint what i am doing
wrong.</div>
</div>
</blockquote>
<br>
Wild guess: You're using udp transport.<br>
<br>
Try to add "-rtsp_transport tcp" before the "-i" on your command
line. If that helps, than thet's your problem. The default UDP
buffer is 64K, which is not sufficient for a single HD I-frame,
which means every single I-frame is truncated.<br>
<br>
Unfortunately, there's no way to give a "big udp buffer" argument to
rtsp in ffmpeg yet; there is one, but it only works directly on rtp.<br>
<br>
</body>
</html>
Andrey Utkin
2013-06-06 12:34:18 UTC
Permalink
Post by Alexander Wischnewski
Input #0, h264, from
Duration: N/A, bitrate: N/A
Stream #0:0, 152, 1/1200000: Video: h264 (Baseline), yuvj420p, 640x352,
1/60, 30 fps, 30 tbr, 1200k tbn, 60 tbc
Camera Man, this is HTTP, so no UDP-related problems.
Topicstarter, is there possibility of fetching the stream slower than
it is produced? If this is the case, camera may drop some content
which it cannot transmit in time.

--
Andrey Utkin
Loading...