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

Copy subtitle description (title) when --add-subtitle is used #271

Open
klogg416 opened this issue Mar 10, 2019 · 9 comments
Open

Copy subtitle description (title) when --add-subtitle is used #271

klogg416 opened this issue Mar 10, 2019 · 9 comments
Assignees

Comments

@klogg416
Copy link

Hi @donmelton
I have an official question! When adding (not burning) subtitles, is there a way to have the "title" field copied as well? I don't see it in the help or readme. With anime in particular you often have multiple English subtitles: studio, improved Disney re-release, and "signs" with subs only for relevant in-movie signs. Using --add-subtitle all works as expected but the detailed names aren't copied over so it isn't clear which English sub is which.

Is there a way to do this today, or can I submit a feature request to copy existing subtitle descriptions when the --add-subtitle switch is called?

Thanks!

Here are mediainfo examples.

Source:

Text #1
ID                                       : 4
Format                                   : PGS
Muxing mode                              : zlib
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 2 h 2 min
Bit rate                                 : 22.7 kb/s
Count of elements                        : 2012
Stream size                              : 19.9 MiB (0%)
Title                                    : Ghibli
Language                                 : English
Default                                  : No
Forced                                   : No

Text #2
ID                                       : 5
Format                                   : PGS
Muxing mode                              : zlib
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 1 h 59 min
Bit rate                                 : 25.8 kb/s
Count of elements                        : 1778
Stream size                              : 22.1 MiB (0%)
Title                                    : Disney
Language                                 : English
Default                                  : Yes
Forced                                   : Yes

Text #3
ID                                       : 6
Format                                   : PGS
Muxing mode                              : zlib
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 2 h 1 min
Bit rate                                 : 28.2 kb/s
Count of elements                        : 2178
Stream size                              : 24.4 MiB (0%)
Title                                    : SDH
Language                                 : English
Default                                  : No
Forced                                   : No

and transcoded:

Text #1
ID                                       : 4
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 2 h 4 min
Language                                 : English
Default                                  : No
Forced                                   : No

Text #2
ID                                       : 5
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 2 h 1 min
Language                                 : English
Default                                  : No
Forced                                   : No

Text #3
ID                                       : 6
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 2 h 1 min
Language                                 : English
Default                                  : No
Forced                                   : No
@lisamelton lisamelton self-assigned this Mar 10, 2019
@lisamelton
Copy link
Owner

@klogg416 Good question, Kyle! Unfortunately, HandBrakeCLI doesn't have an API to set the title/name of a subtitle. And while I might be able to make this work with mkvpropedit for MKV output by post-processing, I'm not sure if that's even possible for MP4 output because the mp4track tool I which I use for media queries may not allow that.

Let me look into it and I'll see what I can do. But don't get your hopes up.

In the meantime, you should open an issue on the HandBrake project and request an API for this.

@klogg416
Copy link
Author

@donmelton As far as reasons go, that is a convincing one. Thanks for the considered reply, I will get on it with team HandBrake.

In the interim a quick check the mkvpropedit documentation shows me that it can edit without re-writing the entire file, so that gives me an easy way to update the handful of impacted files today. Thanks for pointing me in that direction Don!

@lisamelton
Copy link
Owner

@klogg416 No problem and thanks for filing that issue!

@khaosx
Copy link

khaosx commented Mar 11, 2019

@klogg416

This is part of my wrapper script (Yo dawg, I heard you liked wrappers, so I built a script to wrap the wrapper gem that wraps the wrapper app for FFmpeg). It changes the title of whatever movie I'm encoding, if the existing title doesn't match the file name. You can easily do the same with other properties. Hope this helps!

if [ "$strFilename" != "$strMIName" ]; then
    mkvpropedit "$strTheFile" --edit info --set "title=$strFilename"
fi

@klogg416
Copy link
Author

klogg416 commented Mar 11, 2019

Two fun updates, request #197 exists for the GUI version and touches on the need. I created #1965 referencing #197 but calling specifically for an API in HandBrakeCLI.

edit: github helpfully smart linked for me, but to this project instead of HandBrake.

@klogg416
Copy link
Author

klogg416 commented Mar 11, 2019

if [ "$strFilename" != "$strMIName" ]; then
  mkvpropedit "$strTheFile" --edit info --set "title=$strFilename"
fi

@khaosx that is super helpful to start from as I dig into mkvpropedit, thank you!!
And I appreciate the deep, deep meta recursion, and look forward to the troubleshoot efforts required when you hand off layers of wrappers to a slightly less technical friend. :-)

@lisamelton
Copy link
Owner

@khaosx @klogg416 You guys are amazing. What a bunch of geeks! :)

@khaosx
Copy link

khaosx commented Mar 11, 2019

I have added this to my starter, to keep track of what version of the gem managed the encoding:

mkvpropedit "$strTheFile" --edit info --set "muxing-application=vtp_0.25"

(vtp = video transcoding project)

This shows up in media info as:

Writing library : vtp_0.25 / Lavf58.20.100

while leaving this correct:

Writing application : HandBrake 1.2.0 2018122300

At some point, I'll start tracking what changes I made to the script and tie those to Don's versions.

EDIT:

And then my new love affair with DevOps kicked in, and I realized that I can set up a continuous delivery pipeline by setting the server to find 15 movies a night that don't meet the minimum version, re-encoding the masters, and auto-replacing them in the library.

Shortly after that thought, I hit myself really hard in the face with a hammer to shut that thought down before things got out of hand...

@lisamelton
Copy link
Owner

@khaosx I never noticed that attribute changed by just using mkvpropedit. Nice catch! You're obviously paying attention to the details.

Oooh, automatic selection for re-transcoding, eh? Clever! You are living in the Star Trek future now. And that's gotta be simpler than my excruciatingly manual method (which I will describe one day when I'm not in a hurry).

But stay away from those hammers! :)

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

3 participants