Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow converting subtitle codec #418

Closed
soloturn opened this issue Jul 12, 2020 · 6 comments
Closed

Allow converting subtitle codec #418

soloturn opened this issue Jul 12, 2020 · 6 comments

Comments

@soloturn
Copy link

soloturn commented Jul 12, 2020

when cutting an mp4 with mov_text subtitles it does it, the result has the stream, but neither vlc or mpv are able to display it. more reliable is matroska. trying to convert to matroska produced an error though:

/usr/share/losslesscut/resources/node_modules/ffmpeg-static/ffmpeg -hide_banner -ss 316.05468 -i m.mp4 -t 4953.48456 -avoid_negative_ts make_zero -c copy -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -map_metadata 0 -movflags use_metadata_tags -ignore_unknown -f matroska -y m-00.05.16.054-01.27.49.539.mkv
    Stream #0:4(deu): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
    Metadata:
      handler_name    : SubtitleHandler
[matroska @ 0x6a95440] Subtitle codec 94213 is not supported.

https://newspaint.wordpress.com/2018/06/24/subtitle-codec-94213-is-not-supported/, says: Or, to retain the subtitle information in the Matroska container, it can be converted to the subrip format using the -c:s srt option.

and this actually makes it work:

/usr/share/losslesscut/resources/node_modules/ffmpeg-static/ffmpeg -hide_banner -ss 316.05468 -i m.mp4 -t 4953.48456 -avoid_negative_ts make_zero -c copy -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -map_metadata 0 -movflags use_metadata_tags -ignore_unknown -f matroska -y -c:s srt m-00.05.16.054-01.27.49.539.mkv
@mifi
Copy link
Owner

mifi commented Jul 13, 2020

Ohh. Yea I guess subtitle conversion is not necessary a lossy operation, and is probably very fast even though it is a re-encoding, so we might look into that.

@mifi mifi changed the title Subtitle codec 94213 is not supported. add -c:s srt when converting from mp4 to mkv Allow converting subtitle codec Jul 13, 2020
@soloturn
Copy link
Author

soloturn commented Jul 18, 2020

@mifi where in the code is this best done? i was wondering how one could get the command line executed so that their duration is set to 0. this is an ffmpeg bug?

@mifi
Copy link
Owner

mifi commented Oct 20, 2020

@soloturn I'm not sure I understand what you mean by duration set to 0

@mifi mifi mentioned this issue Oct 20, 2020
21 tasks
@soloturn
Copy link
Author

the subtitle is displayed for 0 seconds. so it is there but not displayed.

@mifi
Copy link
Owner

mifi commented Oct 29, 2020

I trhink you can do something like this https://superuser.com/questions/1090989/changing-subtitle-format-with-ffmpeg
to convert subtitle format

@soloturn
Copy link
Author

soloturn commented Dec 30, 2020

cool thank you! it works like this. first convert:

ffmpeg -i in.mp4 -c copy -map 0 -c:s srt out.mkv

then cut with losslesscut. all audio tracks are preserved, and subtitles have correct duration and thus show up.

mifi added a commit that referenced this issue Feb 24, 2022
- manually copy disposition when concat (ffmpeg doesnt automatically)
- auto-convert any subtitle to mov_text when output is mp4 #418
@mifi mifi closed this as completed in d4cf3aa Feb 24, 2022
mifi added a commit that referenced this issue Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants