lisamelton / video_transcoding

Tools to transcode, inspect and convert videos.
MIT License
2.39k stars 160 forks source link

Options "--add-subtitle" and "--main-audio" does not seem to work. #350

Open muhrizali opened 4 days ago

muhrizali commented 4 days ago

Hello, @lisamelton I have been using your tools for long time now (really love them by the way!). I have encoded thousands of mainly Japanese anime video ".mkv" files and have never encountered this issue. Yesterday, I got a new TV show and decided to use these tools on them to add to my collection.

I was using the following command: transcode-video --no-auto-burn --add-subtitle all --main-audio jpn ./input/* -o output/

All the video files in the input folder are consistent, meaning they all have similar subtitle and audio tracks.

But the output transcoded files does not seem to follow the instructions. There are no subtitles added in the output but JPN audio track was added.

But later, when I tested the audio track, changing it to --main-audio eng, that does not seem to work too, as there was no ENG track in the output file, JPN audio track added again.

I have even scanned the first file from input folder:

+ title 1:
  + stream: input/Frieren Beyond Journey's End - S01E01 (WEB 1080p x265 10-bit AAC Opus) [0F7F64F6].mkv
  + duration: 00:26:00
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + chapters:
    + 1: duration 00:01:30
    + 2: duration 00:17:27
    + 3: duration 00:05:23
    + 4: duration 00:01:30
    + 5: duration 00:00:11
  + audio tracks:
    + 1,  (Opus, 2.0 ch) (iso639-2: jpn)
    + 2, English (AAC LC, 2.0 ch) (iso639-2: eng)
  + subtitle tracks:
    + 1, English (SSA)
    + 2, English (SSA)

I am sure I am missing something here, but I am not sure what. I really appreciate if you could guide me a little. I know that the tool is not meant to be used for multiple files, but I have used the batch-transcode-video script at https://github.com/nwronski/batch-transcode-video from @nwronski and it is giving me the same results.

lisamelton commented 4 days ago

@muhrizali Do the --no-auto-burn --add-subtitle all --main-audio jpn options work when you apply them to a single input?

muhrizali commented 4 days ago

@lisamelton No, the options does not seem to have any effect even in the case of single inputs.

In case it would be helpful, I have found the section in the log file that I think represents the "job configuration" for the encoding task: There are no subtitle tracks added.

[18:48:28] Starting Task: Encoding Pass
[18:48:28] work: skipping crop/scale filter
[18:48:28] job configuration:
[18:48:28]  * source
[18:48:28]    + ./input/Frieren Beyond Journey's End - S01E01 (WEB 1080p x265 10-bit AAC Opus) [0F7F64F6].mkv
[18:48:28]    + title 1, chapter(s) 1 to 5
[18:48:28]    + container: matroska,webm
[18:48:28]    + data rate: 17972 kbps
[18:48:28]  * destination
[18:48:28]    + /mnt/storage/Downloads/Frieren Beyond Journey's End - Season 1 (WEB 1080p x265 10-bit AAC Opus) [Dual Audio]/output/Frieren Beyond Journey's End - S01E01 (WEB 1080p x265 10-bit AAC Opus) [0F7F64F6].mkv
[18:48:28]    + container: Matroska (libavformat)
[18:48:28]      + chapter markers
[18:48:28]  * video track
[18:48:28]    + decoder: hevc 10-bit (yuv420p10le)
[18:48:28]    + filters
[18:48:28]      + Framerate Shaper (mode=0)
[18:48:28]        + frame rate: same as source (around 23.976 fps)
[18:48:28]      + Format (format=yuv420p)
[18:48:28]    + Output geometry
[18:48:28]      + storage dimensions: 1920 x 1080
[18:48:28]      + pixel aspect ratio: 1 : 1
[18:48:28]      + display dimensions: 1920 x 1080
[18:48:28]    + encoder: H.264 (libx264)
[18:48:28]      + preset:  medium
[18:48:28]      + options: vbv-maxrate=6000:vbv-bufsize=12000:crf-max=25:qpmax=34
[18:48:28]      + profile: high
[18:48:28]      + level:   4.0
[18:48:28]      + quality: 1.00 (RF)
[18:48:28]      + color profile: 1-1-1
[18:48:28]      + chroma location: left
[18:48:28]  * audio track 1
[18:48:28]    + name: Japanese 2.0 Opus
[18:48:28]    + decoder: 日本語 (Opus, 2.0 ch) (track 1, id 0x1)
[18:48:28]      + samplerate: 48000 Hz
[18:48:28]    + mixdown: Stereo
[18:48:28]    + encoder: AAC (libavcodec)
[18:48:28]      + bitrate: 128 kbps, samplerate: 48000 Hz
Encoding: task 1 of 1, 0.00 %[18:48:28] sync: expecting 37424 video frames
Encoding: task 1 of 1, 0.00 %[18:48:28] encx264: min-keyint: 24, keyint: 240
muhrizali commented 4 days ago

Just now, I have tried the same command with a different video file wondering if the issue was present in the original ".mkv" file but the outputs in the log file were identical. The commands have no effect there too.