-
Notifications
You must be signed in to change notification settings - Fork 10
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
New methods request for Chapters
and SubFile
#12
Comments
Currently my workaround (which is probably bad in many ways) for the optional feature request is: video_id = utils.find_tracks(
video_file_path,
type=utils.types.TrackType.VIDEO,
)[0].track_id
audio_tracks = utils.find_tracks(
sub_properties["video"], type=utils.types.TrackType.AUDIO
)
for track in audio_tracks:
if track.language == "ja":
japanese_audio_id = track.track_id
elif track.language == "en":
english_audio_id = track.track_id
if "english_audio_id" not in locals():
english_audio_id = None
if not english_audio_id:
mkvmerge_args = f'--no-global-tags --track-name {japanese_audio_id}:"Japanese" --default-track-flag {japanese_audio_id}:yes --track-order 0:{video_id},0:{japanese_audio_id}'
else:
mkvmerge_args = f'--no-global-tags --track-name {japanese_audio_id}:"Japanese" --default-track-flag {japanese_audio_id}:yes --track-name {english_audio_id}:"English" --default-track-flag {english_audio_id}:no --track-order 0:{video_id},0:{japanese_audio_id},0:{english_audio_id}'
video = Premux(
video_file_path,
subtitles=None,
keep_attachments=False,
mkvmerge_args=mkvmerge_args,
) |
Yeah I wouldn't mind adding the sub and chapter stuff. I'm also not really against the premux stuff but I wouldn't expect that in a timely manner. I don't really need it and I've been kinda busy lately so the priority is low. |
Awesome! And it's understandable about the premux feature. The workaround seems to be working in the limited testing I've done so I'll use that for the time being. |
Added the sub and chapter stuff. Feel free to test. |
I tested it briefly and all four of the features seems to work properly. Thanks! |
I have a couple of feature requests. If they already exist and I missed them in the docs, let me know.
use_actor_field
which makes this method search for chapter marker in actor instead of effect field.marker
so that we can use any chapter marker we want and not justchapter
orchptr
.clean_extradata
which removes extradata form the subtitle file.remove_comments
which removes all commented lines from the subtitle file.Premux
ormux
, I'm quite not sure.Essentially, I want a way to edit the metadata of tracks in the mkv.
Let's say I have a video, japanese audio and german audio. No matter what their order are, let's say I want a way to set video to track order 1, name it to "[choom/MTBB Encode]" + set japanese audio to track order 2, name it to "Japanese", set it's default to yes + set german audio to track order 3, name it to "German", set it's default to no.
I don't know what it'd look like. Maybe
If the audio does not exist, ignore it of course.
The text was updated successfully, but these errors were encountered: