-
Notifications
You must be signed in to change notification settings - Fork 27
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
Recommendations for audio settings? #201
Comments
@KirkMunro Thank you for using my tools! And being so enthusiastic about them. 😊 The only way you're going to get audio as good as the original is simply to copy the original audio tracks. But then you're not transcoding and not saving any space. If your input audio tracks are in a lossless format then using the As to why your French audio tracks aren't being added, I really need to see a media scan of one of your problematic movies to get a clue as to what is going on. I'll take a look if you attach a dump of that information here. Regarding forced subtitles, yes you can only burn in one. It doesn't really make sense to burn in more than one. And while you could technically modify the FFmpeg command generated by I hope that helps. 💖 |
You're welcome. I'll always prefer CLI tools over a GUI (easier for building automated solutions and repeating steps), and your tools just make it so easy to do the transcoding, it's really a pleasure.
It does help. I ran a few more tests, and it's working now for me. I'm not sure why the French audio wasn't being added...chalk it up to human error, I guess, since I was running a script late at night and may have missed something. At any rate, here are the arguments I think I'm going to move forward with: other-transcode --nvenc --hevc --crop auto --add-audio eng --add-audio fre --eac3 --copy-track-names --add-subtitle auto --burn-subtitle auto filename That seems to do the job nicely for the most part. The burn-in of forced subtitles using a single language vs being able to show them automatically without the burn-in is a small annoyance, so I'm still reading about it and experimenting. I'm using the Infuse app with my movies stored on my NAS at the moment, and from what I read here it seems like it's possible to have the forced subtitles show properly, as long as the subtitle tracks that are forced are marked accordingly in the mkv file. I'm not sure how to do that yet...hopefully there's an easy way so that I can just pass in the appropriate parameters and it'll just work. That, or make a few additional calls using CLI tools to identify the forced tracks and then use that information in the call to other-transcode if it won't do it automatically. |
Hello again Lisa. 😊 I've been experimenting some more, and this is exactly what I decided to try. At first I experimented with Get-ChildItem Raw -Filter *.mkv | ForEach-Object {
$mediaInfo = mediainfo $_.FullName --output=JSON | ConvertFrom-Json
$forcedSubtitleTrackCount = $mediaInfo.media.track.where{$_.'@type' -eq 'Text'}.Count
$otherTranscodeArgumentString = '--nvenc --hevc --crop auto --add-audio eng --add-audio fre --eac3 --copy-track-names'
for ($i = 1; $i -le $forcedSubtitleTrackCount; $i++) {
$otherTranscodeArgumentString += " --add-subtitle ${i}=forced"
}
$otherTranscodeArguments = $otherTranscodeArgumentString -split ' '
Write-Host "Executing: other-transcode ${otherTranscodeArgumentString} '$($_.FullName)'" -ForegroundColor Cyan
other-transcode @otherTranscodeArguments $_.FullName
} My thinking was that I could simply add multiple
That didn't work though, because the
This produced the desired results, with both the English and French subtitle tracks being properly identified as forced subtitles (which is what they are, even if they aren't properly flagged that way on the source DVD). With this file, when I play the video in VLC player or using the Infuse App on my phone, in both cases I get the English audio track playing by default with the English forced subtitle track. The only hiccup is if I switch to the French audio track the player doesn't automatically switch to the French forced subtitle track, but I can switch that manually and then I get the audio and forced subtitles like I would hear/see them if I were watching the movie using the DVD in my blu-ray player. I'm going to reach out to the Infuse team about the forced subtitle track not automatically switching to match the audio track (that's how it should work, to mirror how it works in DVD/Blu-ray players), but I also thought I should ask you @lisamelton, is there an easier way for me to get the |
One more thought on this. I'm curious why you think multiple forced subtitle tracks would be confusing for most players. Could you expand on that? As long there is only one forced subtitle track for a given language, that shouldn't confuse players at all. I'm surprised players show forced subtitle tracks as selectable, when instead they could simply auto-select them based on the selected audio track language whenever a user isn't specifically selecting another subtitle track...that seems to be how DVD and Blu-ray players work (you never see a subtitle track that only contains forced subtitles as one you can select). |
I just looked at some other DVDs, seems the process I'm hoping to use is pretty straightforward:
For that last one though, I can't quite get what I'm after because of how Your |
@KirkMunro, I'll leave the detailed answer for Lisa, but the source is a single file within the |
Thank you. It didn't occur to me to look in a |
@KirkMunro You can have multiple subtitle tracks in your input or your output that are considered "forced." However, only one subtitle should ever have its "forced" flag set. If you actually set that flag on multiple tracks, this will confuse the shit out of playback software about which track to select. The selected track might be the first in order or it might be random. Or it might even be none. That's what I meant. TL;DR: Do not set the "forced" flag on multiple tracks. |
Hi @KirkMunro, I've not tried to do what you are doing, but I think you want to use the Default flag rather than the Forced flag. As @lisamelton has correctly said, you should not use the Forced flag on more than one subtitle track, however you can set a Default track for every language. The only drawback is that the Default flag is only a hint for a player, but in my experience it is widely respected. (Caveat on that point: I use the Default flag for audio tracks normally, although I have used it for some foreign films with both an English audio track and a foreign audio track with English subtitles.) For more details on the various flags you can use in an MKV, see: https://www.matroska.org/technical/notes.html For modifying track flags, I use mkvpropedit (https://mkvtoolnix.download/doc/mkvpropedit.html) which is part of the MKVToolNix package (https://mkvtoolnix.download). The command I use is the following where X is the track number. This does not re-encode the video, it just modifies the metadata, so you can quickly and easily experiment. I hope this is helpful. P.S. Hello everyone, I am still lurking around, but life's been a bit busy. |
That shouldn't be the case as long as you only have one forced track per language, right? A forced track should only be auto-selected by playback software if it matches the language of the audio track that is currently playing. That's the design, so that people watching a movie in French see forced subtitles in French when there is foreign/alien dialogue, or when words are displayed on the screen that the movie creator takes the time to translate into the language of the audio track. So as long as there is only one forced track per language, there should be no confusion whatsoever by the playback software. In fact, it seems from the (limited) testing that I have done that playback software doesn't handle forced subtitle tracks property at all, even if there is only one. For example, I have the 2011 movie The Smurfs on DVD, converted into an mkv file. There are no forced subtitles in English, because when you watch the movie in English, all dialogue and text on screen is in English, so there is nothing to do. If you watch it with the French audio track though, forced subtitles are required for scenes where the cat Azrael talks (they didn't translate the cat's "language" into French), and they are also required when translatable words are displayed on the screen (a sign, a gift card). If I play that mkv file (that has no subtitle default track) in either the MPV player or the VLC player, both of those auto-select the first audio track (English) and both of those select the only forced subtitle track (French). That makes no sense, because nobody would realistically want those options. By default, they should play the English audio track with no subtitles, because a forced subtitle track should only be selected if the language for that track matches the audio track. If you look at Star Wars (1977) as another example, that mkv file has multiple subtitle tracks that are designed to be forced: one per translated language (English, French, Spanish for my DVD). Without each of those subtitle tracks marked as forced, there is no way that any playback software can be programmed to be smart enough to (a) select the correct forced subtitle track when you change the audio track language, but only if you don't have a subtitle track chosen that you selected manually, and (b) be configured with an option to hide all forced subtitle tracks from the subtitle track selector, because they are not meant to be manually selected.
Without multiple forced subtitle tracks, how can any playback software possibly make the right decision when it comes to forced subtitles and the language of the currently selected audio track? Having only one means only that language matters, and everyone else is left to manual selection of their forced subtitle tracks, which they may have a hard time identifying if the only forced subtitle track is not in their language and if there are additional subtitle tracks matching their language. Having multiple, with a one-per-language restriction, at least allows playback software to make a smart decision and auto-select the right track when it is appropriate to do so. I think the TL;DR should be as follows: TL;DR: Do not set the "forced" flag on multiple (subtitle) tracks of the same language. |
@KirkMunro No, that is not how it works in practice. Do not set the "forced" flag on multiple tracks, even if those tracks are in different languages. If playback software ever decides to choose a different subtitle track based on audio track language, then it will ignore all flags anyway. |
@lisamelton I took a step back from this a bit after your last comment before deciding how to proceed. Having given it more thought, I still respectfully disagree with you on this one. There are two reasons why I disagree:
Add those two things together, and I don't see any other way to allow for correct forced subtitle selection when more than one subtitle track consists solely of forced subtitles, but each in a different language. Anyway, I've forked the other_video_transcoding project and modified it to have it working the way I need, setting up one or more forced subtitle tracks depending on the movie, which allows anyone watching these on any platform (PC, Apple TV, iPhone, etc.) to select the audio track and forced subtitle track that is needed to give them the same experience they get from watching a movie on DVD or Blu-ray. |
Just as a point of interest, the MKV "spec" has some notes on this: https://www.matroska.org/technical/notes.html (Search for the "Track Flags" header) A very brief summary of my understanding of these notes: default flag: 1 per language. There's also some information on the mkvtoolnix wiki: https://gitlab.com/mbunkus/mkvtoolnix/-/wikis/Default-and-forced-flags-and-default-yes-no-in-the-GUI That says that playback software must select forced tracks, regardless of any other preferences, which I understand to mean that only one track can have the forced flag. (how do you play/display 2 forced tracks at once?) I also think the reasons you've stated for multiple forced tracks make a lot of sense, and if that lines up with how playback software actually behaves then that's ultimately all that matters. The real world takes priority over specifications every time :-) |
Hi Lisa (and everyone else).
After recently replacing my old laptop, I'm finally transcoding my video collection (yay!), and I'm using Lisa's wonderful other-transcode utility to do it.
I'm very happy (thrilled, really) with the quality of the video that Im getting from my transcoded movies and shows. Before I go too far along though I wanted to ask for recommendations for audio. Essentially I want the following:
My compression space concerns were more about the video than the audio, so I'm looking for recommendations on the arguments I should use.
The arguments I was using in my first pass at encoding movies and shows I had ripped are as follows:
--nvenc --hevc --add-audio eng --add-audio fra --crop auto --add-subtitle auto --eac3
Based on documentation I thought using
--add-audio
twice with both eng and fra would have grabbed both tracks, but that turns out not to be the case, so I'm missing something. Also I'm unsure about using--eac3
...I don't think that's really what I want, if I want audio to be brought across using the best results possible to continue to enjoy stereo sounds in our integrated surround sound speakers if we're watching movies in our living room.Oh, one more thing...is there a way for the output file to show forced subtitles in the language associated with the audio track that is playing? When I began experimenting with this years ago I believe I could only burn-in forced subtitles in a single language. Just wondering if that has changed any, such that forced subtitles show up in the selected language automatically in transcoded movies/shows.
Thank you in advance for your time, and thank you Lisa for this wonderful utility.
The text was updated successfully, but these errors were encountered: