lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
543 stars 24 forks source link

Audio Track Conundrum #124

Closed weaverm closed 2 years ago

weaverm commented 2 years ago

I'm finally getting around to transcoding the Cowboy Bebop blu-rays I have sitting on a shelf. I don't have a lot of anime so I've rarely run into an audio situation as complicated as this.

I have 3 logical audio tracks (English dub, original Japanese, commentary) and 6 actual tracks in my .mkv rip; the lossless Dolby TrueHD track with the lossy AC-3 core. The commentary track is named as such, which means there are two tracks in the .mkv rip named Commentary.

In the resulting transcode, I'm trying to get 3 audio tracks, essentially the lossy core of each logical track. This has led me to a command line that looks like this:

other-transcode --x265 --main-audio 2 --add-audio 4=surround --add-audio 6=original --add-subtitle 1 --add-subtitle 2=forced --add-subtitle Commentary /path/to/movie.mkv

or

other-transcode --x265 --main-audio 2 --add-audio 4=surround --add-audio Commentary --add-subtitle 1 --add-subtitle 2=forced --add-subtitle Commentary /path/to/movie.mkv

or similar variations. They all get close, but none of them are doing exactly what I'd like. I like to add things like commentary tracks by name so the name I've carefully put in the source file is preserved in the resulting output. In this case, since the commentary track is both a lossless and a lossy track, both logically named Commentary, that results in the commentary track being added twice to the output. When I add the track by number, I get the single track output I'm looking for but other-transcode does not copy the name of the track into the output.

I can add the commentary track name via mkvpropedit after the fact or figure out how to remove the unnecessary extra copy of the commentary track if I add it by name… but am I missing something in other-transcode that would let me do all this in a single step?

Format                                   : Matroska
Format version                           : Version 2
File size                                : 4.01 GiB
Duration                                 : 24 min 42 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 23.3 Mb/s
Movie name                               : Cowboy Bebop s01e01 Asteroid Blues
Encoded date                             : UTC 2021-10-26 16:33:10
Writing application                      : MakeMKV v1.16.4 darwin(x64-release)
Writing library                          : libmakemkv v1.16.4 (1.3.10/1.5.2) darwin(x64-release)

Video
ID                                       : 1
ID in the original source medium         : 4113 (0x1011)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 24 min 42 s
Bit rate mode                            : Variable
Bit rate                                 : 18.4 Mb/s
Maximum bit rate                         : 39.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.370
Stream size                              : 3.17 GiB (79%)
Language                                 : English
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Audio #1
ID                                       : 2
ID in the original source medium         : 4352 (0x1100)
Format                                   : MLP FBA
Format/Info                              : Meridian Lossless Packing FBA
Commercial name                          : Dolby TrueHD
Codec ID                                 : A_TRUEHD
Duration                                 : 24 min 42 s
Bit rate mode                            : Variable
Bit rate                                 : 1 454 kb/s
Maximum bit rate                         : 2 661 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 1 200.000 FPS (40 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless
Stream size                              : 257 MiB (6%)
Title                                    : Surround 5.1
Language                                 : English
Default                                  : Yes
Forced                                   : No
Original source medium                   : Blu-ray

Audio #2
ID                                       : 3
ID in the original source medium         : 4352 (0x1100)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 24 min 42 s
Bit rate mode                            : Constant
Bit rate                                 : 448 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 79.2 MiB (2%)
Title                                    : Surround 5.1
Language                                 : English
Service kind                             : Complete Main
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Audio #3
ID                                       : 4
ID in the original source medium         : 4353 (0x1101)
Format                                   : MLP FBA
Format/Info                              : Meridian Lossless Packing FBA
Commercial name                          : Dolby TrueHD
Codec ID                                 : A_TRUEHD
Duration                                 : 24 min 42 s
Bit rate mode                            : Variable
Bit rate                                 : 1 495 kb/s
Maximum bit rate                         : 2 868 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 1 200.000 FPS (40 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless
Stream size                              : 264 MiB (6%)
Title                                    : Surround 5.1
Language                                 : Japanese
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Audio #4
ID                                       : 5
ID in the original source medium         : 4353 (0x1101)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 24 min 42 s
Bit rate mode                            : Constant
Bit rate                                 : 448 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 79.2 MiB (2%)
Title                                    : Surround 5.1
Language                                 : Japanese
Service kind                             : Complete Main
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Audio #5
ID                                       : 6
ID in the original source medium         : 4354 (0x1102)
Format                                   : MLP FBA
Format/Info                              : Meridian Lossless Packing FBA
Commercial name                          : Dolby TrueHD
Codec ID                                 : A_TRUEHD
Duration                                 : 24 min 42 s
Bit rate mode                            : Variable
Bit rate                                 : 699 kb/s
Maximum bit rate                         : 1 050 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 1 200.000 FPS (40 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless
Stream size                              : 123 MiB (3%)
Title                                    : Commentary
Language                                 : Japanese
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Audio #6
ID                                       : 7
ID in the original source medium         : 4354 (0x1102)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 24 min 42 s
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 33.9 MiB (1%)
Title                                    : Commentary
Language                                 : Japanese
Service kind                             : Complete Main
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Text #1
ID                                       : 8
ID in the original source medium         : 4608 (0x1200)
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 21 min 32 s
Bit rate                                 : 28.8 kb/s
Count of elements                        : 450
Stream size                              : 4.44 MiB (0%)
Language                                 : English
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Text #2
ID                                       : 10
ID in the original source medium         : 4609 (0x1201)
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 1 min 52 s
Bit rate                                 : 15.7 kb/s
Count of elements                        : 22
Stream size                              : 216 KiB (0%)
Title                                    : Forced Subtitles
Language                                 : English
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Text #3
ID                                       : 12
ID in the original source medium         : 4610 (0x1202)
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 21 min 51 s
Bit rate                                 : 76.7 kb/s
Count of elements                        : 883
Stream size                              : 12.0 MiB (0%)
Title                                    : Commentary Subtitles
Language                                 : Japanese
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Menu
00:00:00.000                             : en:Chapter 01
00:00:47.756                             : en:Chapter 02
00:02:17.762                             : en:Chapter 03
00:12:22.241                             : en:Chapter 04
00:22:35.395                             : en:Chapter 05
00:24:11.032                             : en:Chapter 06
lisamelton commented 2 years ago

@weaverm I'm sorry you're having this problem but you have run up against a by-design limitation of the command line API in other-transcode. I say "by-design" because I like to keep things simple.

Oddly enough, I've had this same problem with commentary tracks myself. But only for one movie in my entire collection. And for thatI simply used mkvpropedit to remove the name of the lossy commentary track in my rip.

Your only other solution is to add the track name in your output transcoding, also using mkvpropedit. Sorry about that.

weaverm commented 2 years ago

I thought that might be the case. Thanks for confirming.

martinpickett commented 2 years ago

There is an other-transcode option called --copy-track-names which might allow you to select the commentary track by track number but retain the track name. I do not know if it will do exactly what you want, but I suspect it will.

lisamelton commented 2 years ago

@martinpickett Ah yes! I forgot about that option. Thanks! Yes, that might work. But be warned that it will also copy track names that you might not want. It's sort of an all-or-nothing behavior.

weaverm commented 2 years ago

That's interesting… though it means I'd end up with a bunch of tracks named 'Surround 5.1' or whatever the default MakeMKV puts in there. But still, it is good to know. Thanks.