Opened 3 years ago

Closed 2 years ago

#9409 closed defect (fixed)

Embedding some mp4 subtitles causes ffmpeg to hang

Reported by: Frank Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: subtitles regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by Frank)

I've run into a bug when trying to embed some subtitles into an MP4 file, ffmpeg hangs indefinitely with 100% cpu usage on one thread. When this happens the output file stops growing and what is usually a few seconds job simply does not finish even if left for hours.

This only started happening recently with some videos downloaded from youtube-dl, including some that worked before with no changes in my ffmpeg version, so I think youtube must've change the way they write their subs. Additionally I've tested this and it seems to be an issue with the latest version of every 4.x branch - 4.0.6, 4.1.6, 4.2.4, 4.3.2, and the latest git build. ffmpeg does complete without errors if I try this with the latest 3.4.8 branch, but the subtitles are broken and do not appear when selected during playback.

Since I'm not sure where the problem is in the subtitle I can't cut out the problem part of the video and attach it for an example since it's too big. I will attach one of the subtitle files that causes the issue and include the youtube-dl command that will download the smallest version of the video.

youtube-dl command:

youtube-dl.exe -v -f 160+249 --merge-output-format mp4 --sub-lang bn --write-auto-sub --embed-subs 0UlUbeaBCTg

ffmpeg command being run by youtube-dl:

ffmpeg -y -loglevel "repeat+info" -i "file:Making Flavored Rum _ Easy and Cheap! - Part 1-0UlUbeaBCTg.mp4" -i "file:Making Flavored Rum _ Easy and Cheap! - Part 1-0UlUbeaBCTg.bn.vtt" -map 0 -c copy -map "-0:s" -map "-0:d" "-c:s" mov_text -map "1:0" "-metadata:s:s:0" "language=ben" "file:Making Flavored Rum _ Easy and Cheap! - Part 1-0UlUbeaBCTg.temp.mp4"

Attachments (1)

Making Flavored Rum _ Easy and Cheap! - Part 1-0UlUbeaBCTg.bn.vtt (317.8 KB ) - added by Frank 3 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Frank, 3 years ago

Description: modified (diff)

comment:2 by mkver, 3 years ago

Component: undeterminedavcodec
Priority: normalimportant
Reproduced by developer: set
Status: newopen

Regression since af043b839c38e850af1184fd6be691f8475c048e, will look into it.

comment:3 by mkver, 3 years ago

Keywords: regression added

comment:4 by mkver, 2 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.