[FFmpeg-trac] #3405(undetermined:reopened): Bizare behaviour with RTP mpegts sources
FFmpeg
trac at avcodec.org
Wed Feb 26 11:13:17 CET 2014
#3405: Bizare behaviour with RTP mpegts sources
-------------------------------------+-------------------------------------
Reporter: sharbatgula | Owner:
Type: defect | Status: reopened
Priority: normal | Component:
Version: unspecified | undetermined
Keywords: RTP mpegts | Resolution:
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
Changes (by sharbatgula):
* status: closed => reopened
* resolution: needs_more_info =>
Comment:
Hi again,
It took me a while to re-examine everything and in the meantime the ticket
was closed. I'm reopening it. Although at the moment I cannot reproduce
the mixing-up problem and I can't restart the server as it is in
production, I nailed the problem to the handling of mpegts over RTP, which
I can always reproduce now, with no involvement of external libraries and
no transcoding at all, so it is purely source problem.
If I do the following:
ffplay rtp://@224.11.2.12:5530 or
ffmpeg -i rtp://@224.11.2.12:5530 -vcodec copy -acodec copy -f mpegts
some_file.ts
the output is garbage and the output console is the following:
ffmpeg version 2.1.git Copyright (c) 2000-2014 the FFmpeg developers
built on Jan 30 2014 12:22:30 with gcc 4.6 (Ubuntu/Linaro
4.6.3-1ubuntu5)
configuration: --prefix=/home/vas/ffmpeg_build --extra-
cflags=-I/home/vas/ffmpeg_build/include --extra-
ldflags=-L/home/vas/ffmpeg_build/lib --bindir=/home/vas/bin --extra-
libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-
libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
--enable-libfreetype --enable-filter=drawtext
libavutil 52. 63.100 / 52. 63.100
libavcodec 55. 49.100 / 55. 49.100
libavformat 55. 26.100 / 55. 26.100
libavdevice 55. 5.102 / 55. 5.102
libavfilter 4. 1.101 / 4. 1.101
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
RTP: dropping old packet received too late
Last message repeated 1 times
RTP: missed 941 packets
RTP: missed 2788 packets
RTP: dropping old packet received too late
Last message repeated 1 times
RTP: missed 3383 packets
RTP: missed 3139 packets
RTP: dropping old packet received too late
Last message repeated 1 times
RTP: missed 983 packets
RTP: dropping old packet received too late
Last message repeated 1 times
RTP: missed 3891 packets
RTP: missed 3451 packets
RTP: missed 2800 packets
RTP: dropping old packet received too late
Last message repeated 3 times
RTP: missed 1844 packets
RTP: dropping old packet received too late
Last message repeated 2 times
RTP: missed 4736 packets
RTP: PT=21: bad cseq f1d7 expected=df57
RTP: dropping old packet received too late
RTP: missed 4737 packets
RTP: dropping old packet received too late
Last message repeated 1 times
RTP: missed 1543 packets
RTP: dropping old packet received too late
Last message repeated 5 times
RTP: missed 436 packets
RTP: dropping old packet received too late
Last message repeated 3 times
RTP: missed -62145 packets
RTP: PT=21: bad cseq 06d9 expected=f99a
RTP: dropping old packet received too late
Last message repeated 8 times
RTP: missed -62145 packets
RTP: dropping old packet received too late
Last message repeated 2 times
RTP: missed 14067 packets
...
RTP: PT=21: bad cseq 0d00 expected=ffc1
RTP: dropping old packet received too late
Last message repeated 7 times
RTP: missed -62145 packets
[rtp @ 0x3aff900] decoding for stream 0 failed
[rtp @ 0x3aff900] decoding for stream 3 failed
[rtp @ 0x3aff900] decoding for stream 4 failed
[rtp @ 0x3aff900] decoding for stream 6 failed
[rtp @ 0x3aff900] decoding for stream 7 failed
[rtp @ 0x3aff900] decoding for stream 9 failed
[rtp @ 0x3aff900] decoding for stream 10 failed
[rtp @ 0x3aff900] decoding for stream 11 failed
[rtp @ 0x3aff900] decoding for stream 12 failed
[rtp @ 0x3aff900] decoding for stream 14 failed
[rtp @ 0x3aff900] decoding for stream 16 failed
[rtp @ 0x3aff900] decoding for stream 17 failed
[rtp @ 0x3aff900] decoding for stream 23 failed
[rtp @ 0x3aff900] decoding for stream 25 failed
[rtp @ 0x3aff900] decoding for stream 31 failed
[rtp @ 0x3aff900] Could not find codec parameters for stream 3 (Audio:
mp1, 0 channels, s16p
): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
[rtp @ 0x3aff900] Could not find codec parameters for stream 7 (Video:
h264 ([27][0][0][0] /
0x001B)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
[rtp @ 0x3aff900] Could not find codec parameters for stream 9 (Audio:
mp3, 0 channels, s16p
): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
[rtp @ 0x3aff900] Could not find codec parameters for stream 11 (Audio:
aac, 54 channels (FL
+FR+FC+BL+BR), fltp, 345 kb/s): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
[rtp @ 0x3aff900] Could not find codec parameters for stream 16 (Audio:
mp1, 0 channels, s16
p): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
[rtp @ 0x3aff900] Could not find codec parameters for stream 17 (Video:
h264 ([27][0][0][0]
/ 0x001B)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
Input #0, rtp, from 'rtp://@239.2.2.12:5530':
Duration: N/A, start: 77443.201033, bitrate: 2649 kb/s
Program 1
Program 912
Program 1011
Program 1013
Program 612
Program 1313
Program 1314
Program 913
No Program
Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv,
bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50.08 tbr, 90k tbn, 50
tbc
Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv,
bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:2: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv,
bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:3: Audio: mp1, 0 channels, s16p
Stream #0:4: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv,
bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:5(mac): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
stereo, s16p, 128 kb/s
Stream #0:6: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv,
bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:7: Video: h264 ([27][0][0][0] / 0x001B), 50 tbr, 90k tbn
Stream #0:8(mac): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
stereo, s16p, 128 kb/s
Stream #0:9: Audio: mp3, 0 channels, s16p
Stream #0:10: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv,
bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:11: Audio: aac, 54 channels (FL+FR+FC+BL+BR), fltp, 345 kb/s
Stream #0:12: Video: h264 (Main), yuv420p(tv, bt470bg), 720x576 [SAR
12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:13: Audio: mp2, 48000 Hz, stereo, s16p, 128 kb/s
Stream #0:14: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv,
bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:15: Audio: mp2, 48000 Hz, stereo, s16p, 128 kb/s
Stream #0:16: Audio: mp1, 0 channels, s16p
Stream #0:17: Video: h264 ([27][0][0][0] / 0x001B), 50 tbr, 90k tbn
Stream #0:18(mac): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, mono,
s16p, 128 kb/s
Stream #0:19: Unknown: none
Stream #0:20(mac): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
stereo, s16p, 128 kb/s
Stream #0:21(mac): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono,
s16p, 128 kb/s
Stream #0:22(mac): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
stereo, s16p, 128 kb/s
Stream #0:23: Audio: mp2, 0 channels, s16p
Stream #0:24: Audio: mp2, 48000 Hz, stereo, s16p, 128 kb/s
Stream #0:25: Audio: mp1, 0 channels, s16p
Stream #0:26(alb): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
stereo, s16p, 128 kb/s
Stream #0:27: Audio: mp2, 48000 Hz, stereo, s16p, 128 kb/s
Stream #0:28(mac): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono,
s16p, 128 kb/s
Stream #0:29(mac): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
stereo, s16p, 128 kb/s
Stream #0:30(mac): Audio: mp2, 48000 Hz, stereo, s16p, 128 kb/s
Stream #0:31: Video: h264 ([27][0][0][0] / 0x001B), 50 tbr, 90k tbn
Stream #0:32: Audio: mp2, 48000 Hz, stereo, s16p, 128 kb/s
Stream #0:33(mac): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono,
s16p, 128 kb/s
Stream #0:34(mac): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
stereo, s16p, 128 kb/s
Stream #0:35(mac): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono,
s16p, 128 kb/s
[mpegts @ 0x3c65d40] sample rate not set
Output #0, mpegts, to 'udp://224.10.2.254:1234':
Stream #0:0: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 720x576
[SAR 12:11 DAR 15:11], q=2-31, 25 fps, 90k tbn, 25 tbc
Stream #0:1: Audio: aac, 54 channels (FL+FR+FC+BL+BR), 345 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:11 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?):
Invalid argument
(END)
My guess ffmpeg is detecting the source as RTP AV profile straming, not
mpegts over RTP.
By specifying the input type more precisely, i.e.
ffmpeg -f mpegts -i rtp://@239.2.2.12:5530 -vcodec copy -acodec copy -f
mpegts some_out.ts or
ffplay -f mpegts rtp://@239.2.2.12:5530
the picture and output file is stabilized but very often I have sporadical
green patches with the following frequent console errors:
[h264 @ 0x1fc50e0] non-existing PPS referenced
[h264 @ 0x1fc50e0] non-existing PPS 0 referenced
[h264 @ 0x1fc50e0] decode_slice_header error
[h264 @ 0x1fc50e0] no frame!
[h264 @ 0x1fc50e0] mmco: unref short failure
Last message repeated 1 times
[h264 @ 0x1fc50e0] number of reference frames (0+4) exceeds max (3;
probably corrupt input), discarding one
Input #0, mpegts, from 'rtp://@239.2.2.12:5530':
Duration: N/A, start: 26528.348167, bitrate: 128 kb/s
Program 1011
Stream #0:0[0x15eb]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(tv, bt470bg), 720x576 [SAR 12:11 DAR 15:11], 50 tbr, 90k tbn, 50
tbc
Stream #0:1[0x15ec](mac): Audio: mp2 ([3][0][0][0] / 0x0003), 48000
Hz, mono, s16p, 128 kb/s
File 'test.ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to 'test.ts':
Metadata:
encoder : Lavf55.26.100
Stream #0:0: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 720x576
[SAR 12:11 DAR 15:11], q=2-31, 90k tbn, 25 tbc
Stream #0:1(mac): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, mono,
128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x1fa0900] '''PES packet size mismatch'''
[mpegts @ 0x1fa0900] '''PES packet size mismatchme'''=00:00:13.39
bitrate=1444.1kbits/s
[mpegts @ 0x1fa0900] '''PES packet size mismatchm'''e=00:00:14.33
bitrate=1612.9kbits/s
[mpegts @ 0x1fa0900] '''PES packet size mismatchme'''=00:00:16.95
bitrate=1891.6kbits/s
[mpegts @ 0x1fa0900] '''PES packet size mismatchme'''=00:00:20.41
bitrate=2063.1kbits/s
frame= 752 fps= 50 q=-1.0 size= 5448kB time=00:00:21.25
bitrate=2100.1kbits/s
Now, to nail the problem further, I decided to remove the RTP headers from
the source by using eithr multicat or remuxing with VLC
multicat -U @239.2.2.12:5530 224.11.2.12:1234
When I finally invoke ffmpeg with the following:
ffmpeg -i udp://@224.11.2.12:1234 -vcodec copy -acodec copy -f mpegts
test.ts
everything is fine.
I believe the problem is with the mpegts over RTP source.
You could reproduce the problem if you use mpegts over RTP as a source.
BR,
Sharbat
--
Ticket URL: <https://trac.ffmpeg.org/ticket/3405#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list