#11677(undetermined:new): ffplay does not properly sync LRC subtitles with 3-digit milliseconds
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Type: defect Status: new | Priority: normal Component: | Version: undetermined | unspecified Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- LRC subtitles that use 3-digit millisecond in time tags, cause syncing issues with ffplay. How to reproduce: Save the following as **subs.lrc**: {{{ [00:00.660] We knew the world would not be the same. [00:05.580] A few people laughed, a few people cried, most people were silent. [00:17.030] I remembered the line from the Hindu scripture, the Bhagavad- Gita. [00:25.660] Vishnu is trying to persuade the prince that he should do his duty, and to impress him [00:38.310] takes on his multi-armed form and says, “now I am become Death, the destroyer of worlds.” [00:50.380] I suppose we all thought that, one way or another. }}} Now use **ffplay** to reproduce the test video using the above **subs.lrc**: {{{ ffplay -vf subtitles=subs.lrc https://www.atomicarchive.com/media/videos/media/oppenheimer-quote.mp4 }}} You will notice that the subtitles do not sync properly with the video. However, if you remove the trailing zeros in the fractional timestamps (i.e. **[00:00.660]** -> **[00:00.66]**), then the subtitles will sync properly with the video. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by kasper93): Why you think this should be supported? Where did you get those subtitles? LRC timestamp is `[MINUTES:SECONDS:CENTISECONDS]`. It's possible to support milliseconds. Currently the only format supported is the above one. Is there reference of LRC format where milliseconds are mentioned? -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by Cigaes): Although logical, it does not seem to be a known variant of the format. Can you quote any software that plays it correctly? Also, how did you acquire this file? -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by kasper93): Seems there are files in the wild with milliseconds and some other software do support this https://getmusicbee.com/forum/index.php?topic=31886.msg176124#msg176124 so we might add support for it too. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by gbr):
Is there reference of LRC format where milliseconds are mentioned?
Not that I could find...
Can you quote any software that plays it correctly?
Jellyfin (https://github.com/jellyfin/jellyfin), a popular media player, uses a third-party library called LrcParser (https://github.com/karaoke- dev/LrcParser) for manipulating LRC files, where that format is supported.
Also, how did you acquire this file?
The file was actually generated by a program called Chronograph (https://github.com/Dzheremi2/Chronograph), which generates them with milliseconds by default. It's not popular like Jellyfin though, plus they probably use their own LRC parser: https://github.com/Dzheremi2/Chronograph/blob/1c4afa88b15e29a7dadec93770407b... Lastly, LRClib (https://lrclib.net/), which is likely the largest open source database of LRC files we currently have, probably has some subtitles with milliseconds, because their software to write and download LRC files from that database, called LRCGET (https://github.com/tranxuanthang/lrcget) supports submitting subtitles in that format as well. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by kasper93): Should be fixed by https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20025 Do you also need muxer for those? -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by gbr):
Should be fixed by https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20025
Thank you very much for the quick fix!
Do you also need muxer for those?
Sorry, I'm not sure what that means, but if that helps software like mpv (which relies on FFmpeg to render LRC subtitles, based on what I read), then yes, please. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by Cigaes): Please fix it in a way that will not require fixing again when somebody comes up with a file with four digits. Also, you might as well take the occasion to factor this code: IIRC, `%1[-]` or something close to it can be used to scan the optional minus sign. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:7> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by kasper93): @Cigaes: Sure, actually I have it done already locally. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:8> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by kasper93): Fixed by: bc3cc0a6af44adc63caf4e5097fcfebd7a7475b4 (https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20025) -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:9> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------ Reporter: gbr | Owner: (none) Type: defect | Status: closed Priority: normal | Component: avformat Version: unspecified | Resolution: Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Changes (by kasper93): * component: undetermined => avformat * status: new => closed -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:10> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11677: ffplay does not properly sync LRC subtitles with 3-digit milliseconds -------------------------------------+------------------------------------- Reporter: gbr | Owner: Kacper | Michajłow <kasper93@…> Type: defect | Status: closed Priority: normal | Component: avformat Version: unspecified | Resolution: fixed Keywords: lrc | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by Kacper Michajłow <kasper93@…>): * owner: (none) => Kacper Michajłow <kasper93@…> * resolution: => fixed Comment: In [changeset:"bc3cc0a6af44adc63caf4e5097fcfebd7a7475b4/ffmpeg" bc3cc0a6/ffmpeg]: {{{#!CommitTicketReference repository="ffmpeg" revision="bc3cc0a6af44adc63caf4e5097fcfebd7a7475b4" avformat/lrcdec: support arbitrary precision timestamp Apparently files with milliseconds exist in the wild. And since it cost nothing to support arbitrary number of digits, extend format to support that. Depending on number of digits, the time base of fractional part is changing. Most LRCs use 2 digits and centiseconds base, but subs with 3 digits and miliseconds exist too. Set internal time base to AV_TIME_BASE, which in parcitice allows to hold microseconds with 6 digits. Totally artificial, but who knows maybe someone wants that. Fixes: #11677 Signed-off-by: Kacper Michajłow <kasper93@gmail.com> }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/11677#comment:11> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg