Opened 13 months ago

Last modified 13 months ago

#8889 new defect

mpegts with dvb_subtitle on udp output broken?

Reported by: barhom Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: mpegts dvb_subtitle
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Input video has dvb_subtitles;
Use mpegts muxer and copy subtitles to output using udp;
The output is bad.

Does not happen when outputting to file instead of udp. And it does not happen if you choose to omit the subtitles.

How to reproduce:
Unfortunately I could not make the test file small and still present the issue. The input.ts file you need to download is 53M.
https://drive.google.com/file/d/1J90X1zlzQf-LiMwBTnMs-HcCwiFjtHG7/view?usp=sharing.

The following reproduces the bug.

ffmpeg -re -i "input.ts" -c copy -map 0:v -map 0:a:0 -map 0:s:0 -f mpegts "udp://239.200.0.1:1231?pkt_size=1316"

In order to "watch" the issue I recommend watching the output using either VLC or MPV using the link "udp://@239.200.0.1:1231".


Should you choice to remove the subtitles like this,

ffmpeg -re -i "input.ts" -c copy -map 0:v -map 0:a:0 -f mpegts "udp://239.200.0.1:1231?pkt_size=1316"

The issue will not present itself.


You might want to remove the "-re" and record the multicast using the "multicat" tool back to file if you need to investigate further.

Change History (3)

comment:1 by barhom, 13 months ago

I think I found out why I see a "glitch". It seems like when outputting to UDP there is some "waiting" time when there are no packets.

Here is an example from tcpdump. Notice how there is a 3 second delay between packets.

09:57:38.262954 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 1316
09:57:38.262964 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 1316
09:57:38.262974 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 1316
09:57:38.262982 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 752
09:57:38.262992 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 1316
09:57:38.263002 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 376
09:57:38.263035 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 188
09:57:41.544091 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 1316
09:57:41.544109 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 1316
09:57:41.544119 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 1316
09:57:41.544129 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 1316
09:57:41.544138 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 1316
09:57:41.544148 IP 192.168.125.30.39625 > 239.200.0.1.1231: UDP, length 1316

There is no such "delay" of 3 seconds when omitting the dvb_subtitles.

comment:2 by barhom, 13 months ago

Patch provided by rcombs seems to solve this issue,

https://gist.github.com/rcombs/632c1767a3e5036f0480f380e04c062b

comment:3 by barhom, 13 months ago

I've added the patch in this fork,

https://github.com/barhom/FFmpeg/commit/6f0d90df886310fd7f7ae6e63e167269508ded6d

Not sure when the patch will be released to ffmpeg.

Note: See TracTickets for help on using tickets.