lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
550 stars 25 forks source link

missing --copy-audio all #5

Closed whppr closed 4 years ago

whppr commented 4 years ago

Hi Don. Great work on this new tool. I'm missing the --copy-audio all functionality (and also --add-subtitle all). Are these features planned or are you thinning out the parameters to keep the tool as close to your optimal workflow? The reason these parameters are important to me is that I already rip the movies from Blu-ray only containing the audio tracks & subtitles I want to keep (in original format). Otherwise I have to switch my ripping strategy. :-)

lisamelton commented 4 years ago

@whppr Thank you and thanks for using my tools!

I'm a bit unsure exactly you mean by this feature request. And because you didn't ask for --add-audio all, I'm assuming that you want to always copy tracks in their original format. If that's the case, then I have no such plans and don't wish to add a feature like that. That's not transcoding, that's remuxing.

Copying original, large lossless audio tracks really misses the whole point of compression, i.e. making things smaller.

Not only that, lossless audio formats are generally not very portable. Even new, advanced TV streaming devices from Apple, Amazon, Google and Roku have difficulties with DTS-HD and TrueHD audio, sometimes not even allowing pass through to more capable audio receivers. It's a mess.

My goal has always been transcoding "into a smaller, more portable format." I believe it was a mistake to add a --copy-audio feature to my transcode-video tool years ago and I don't want to repeat that mistake with other-transcode.

But if you really meant --add-audio all, then I don't want to add that feature either. Here's what I wrote earlier in issue https://github.com/donmelton/other_video_transcoding/issues/3:

Currently there is no way to add either all audio tracks or all subtitle tracks from an input source with a single option and argument. My older transcode-video tool has this feature but I intentionally left it out of other-transcode in the hope that users would add tracks by by language or title instead because this would 1) make those users more thoughtful and 2) yield smaller output.

Again, adding everything from an original Blu-ray Disc or DVD rip misses the whole point of compression. And I want to discourage people from thinking other-transcode is a backup tool.

Seriously, if you need all those tracks or need them all in their original format, then you shouldn't be transcoding. You should be figuring out a way to play your original rips. And if that's the case, then I recommend using Plex to serve up your media.

I'll leave this open for now so that others can also comment.

whppr commented 4 years ago

@donmelton Thanks for your extensive answer. Let me explain my use case: I've ripped all my (350+) Blu-rays with original video and only kept the core AC3 or DTS track (so no lossless tracks), which are stored on external offline storage. Most of the times it's only one track, but for some movies (especially animation) I have kept the English and Dutch tracks. I use your tools to make them NAS/streaming friendly.

I prefer to keep these core tracks as they are mostly 640kbit or 1500kbit, which is still small enough for more portable versions and already encoded properly with better quality encoders than the (good enough) ffmpeg included open source ac3/eac3 encoder.

I hope I clarified my use case a bit more, but can fully understand if you want to keep this tool more in line with your original intend. I'm continuing to be a happy user anyway. Thanks!

rhapsodians commented 4 years ago

@whppr As Don mentioned above, copying all audio out may ultimately lead to playback problems even via Plex and should be avoided when transcoding.

In order for audio to get to the speakers via a receiver, all parts of the end-to-chain have to support that audio or enable pass through. For example, a Mac or PC directly connected to a modern receiver will probably play something like lossless Dolby TrueHD or DTS-HD MA audio but not much else other than the Shield will support it. If you go via an Apple TV 4K, FireTV 4K, Roku Stick+/Ultras and most TV-supplied apps, then that hardware too has to support these formats before any apps like Plex can use them. Otherwise you may get silence. AppleTV doesn't support pass through at all but converts its inbound audio to lossless LPCM but only for FLAC, Dolby Digital, EAC3/DD+ and Atmos tracks. Send it a raw TrueHD and it won't know what to do with it.

All of this is a long way of saying @donmelton has taken great care to provide options which CAN be used with the vast majority of players and so removing the old copy all is the right thing to do for a transcoded file.

I suspect many people using the tools just want the resultant transcode to play with good audio and video (and subtitles) on their TVs/portable devices. We did an unbelievable amount of beta testing prior to release and many of us have large libraries. Doing a copy-all just introduces more hassle than it's worth and you should try and look at the optional EAC3 flag as a replacement - at 640kb/sec, it sounds superb. It's now my default as I genuinely cannot hear the difference between it and lossless played via physical BRs. And I've tried with a lot of testing. And the benefits is that file size is small relative to the original lossless files. Which is what transcoding is all about in the end.

whppr commented 4 years ago

Thanks for explaining the reasoning behind the options of the new tool. Perfectly make sense. I should have followed Don's guide / rules to ripping Blu-ray discs (concerting lossless audio to FLAC) instead of focussing on preserving the core AC3/DTS tracks.

I've just been too spoiled with video_transcoding. It left a lot of room to play with all the settings and I also experimented a lot with the ratecontrol system and some extra x264 parameters the beginning of 2019. I even ported them back to a Handbrake profile so I could easily do test encodes for specific parts of a movie.

lisamelton commented 4 years ago

@whppr Sorry I took so long to respond. I was playing World of Warcraft Classic. :)

Also, many thanks to @rhapsodians for that explanation!

OK, I understand your situation much better now. Thanks for the explanation! And, you might think this is amusing, about 20% of my Blu-ray rips are in the same predicament because I haven't got around to re-ripping them yet with lossless audio in FLAC format.

Since I already pass through audio in AC-3 format, what you really need is something like a --copy-dts option, which would pass lossy DTS (not DTS-HD) through without transcoding it to AC-3 or DD+, right?

rhapsodians commented 4 years ago

Hi @whppr ... thanks for the additional info. I think we were all typing at the same time so things may have been a little confusing. Having read you're approach, I now understand what you're doing and why you asked the question.

But may I suggest a change of approach? If you move all future rips/transcodes to a FLAC rip for the main audio, that will allow you to retain lossless and 5.1/6.1/7.1 audio for archiving purposes. Then taking this as the default audio stream (or streams for the bi-lingual rips), then use the new --eac3 option so long as your playback devices support it. That way you're transcoding from lossless -> lossy but with a really excellent output. Just a thought.

And like Don, you could go back and either re-rip the Blu-rays to get FLAC or the slightly more complex approach, just rip the main audio tracks (English and Dutch) as FLAC and then mux them back into your current rips via mkvmerge. Might be faster than reripping all 350 BRs.

rhapsodians commented 4 years ago

@whppr One final tip: if you run other-transcode --help full, you'll see position and duration arguments (--position TIME and --duration TIME). These should make it a lot easier to do test transcodes of specific sections of movies especially now as other-transcode uses FFmpeg instead of HandBrakeCLI. It's one of the tricks we use to test tough scenes (for the encoders) to ensure that they look the best they can.

For example: --position 00:25:30 --duration 600 will start 25m 30s into a movie/tv show and run for 600s/10min.

whppr commented 4 years ago

@donmelton You're responding pretty fast for a WoW player! 😄 A --copy-dts option would be exactly what I need for my current rips (for indeed the lossy DTS core track). I already noticed that FFmpeg was using pass through for AC3.

@rhapsodians Yeah, I should start re-ripping (at least my favourite movies) my BRs to lossless FLAC. The --eac3 option (supported by my players) sounds like the way forward. Also thanks for pointing out the position and duration arguments. That will help a lot testing what settings are optimal for my subjective eyes (limited to Intel QSV with h264 or h265 or else the good old x264 encoder).

Thanks so much for your time guys! It's really appreciated.

tinusn commented 4 years ago

I have the use cased described by "--add-audio all", which basically means that I have movies in all kinds of languages, and when I rip them, then I preserve the languages (and hopefully the lossless audio if available) I want to keep. But when transcoding I do it in batches and this requires me to do something like the following:

other-transcode --eac3 --add-audio dan --add-audio eng --add-audio fra --add-audio ara Movie.mkv

etc.. for all of the languages I can possibly think of - because then I can reuse the same commandline for all movies, regardless of what language they are in.

lisamelton commented 4 years ago

@whppr I've checked in an implementation of your feature request here: https://github.com/donmelton/other_video_transcoding/commit/ae43ff9deabefbde665879ec276b4e336eb8b8b3

However, it does not use a new option. Instead it adds original as a width attribute to the --main-audio and --add-audio options.

I'll let you know when it's released.

whppr commented 4 years ago

@donmelton Thanks for adding support for the original tracks. I like the way you implemented it!

lisamelton commented 4 years ago

@whppr OK, I released this yesterday. Just gem update to get the new version. Closing this now. Thanks again for filing this issue!

lisamelton commented 4 years ago

@whppr Just so you know, I just released version 0.3.0 with a pass-dts option that might be easier for you to use.