rigaya / NVEnc

NVENCによる高速エンコードの性能実験
https://rigaya34589.blog.fc2.com/blog-category-17.html
Other
1.1k stars 114 forks source link

how to set codec tag for subtitles when piping output with nut ? NVEncC (x64) 7.53 (r2863) NVENC API 12.2, CUDA 12.4 #588

Closed SweetPorkDumplings closed 6 months ago

SweetPorkDumplings commented 6 months ago

cls && ffmpeg.exe -hide_banner -hwaccel cuda -extra_hw_frames 8 -r "25000/1001" -i "INPUTvideo.mkv" -map 0:v -map 0:a -map 0:s -c:s copy -tag:2 UTF8 -c:a copy -c:v hevc_nvenc -gpu 1 -colorspace bt709 -color_primaries bt709 -color_trc bt709 -color_range 1 -pix_fmt p010le -preset p2 -movflags +faststart -f nut - | "NVEncC64.exe" --avhw --qvbr 4 --preset P2 --output-depth 10 --profile main10 --tier high --multipass 2pass-full --qp-init 1 --max-bitrate 40000 --bref-mode each --bframes 4 --ref 4 --lookahead 32 --lookahead-level 3 --multiref-l0 1 --multiref-l1 1 --nonrefp --split-enc auto_forced --thread-affinity all --cuda-schedule auto --output-buf 128 --codec hevc --mv-precision q-pel --chapter-copy --audio-copy --sub-copy -i - -o "TestOUTPUTvideo.mkv"

outputs

[nut @ ] Tag UTF8 incompatible with output codec id '94225' ([0][0][0][0])

removing -tag:2 UTF8 outputs

No codec tag defined for stream 2

the files encode with video and copied audio but no subtitles are processed.

also checked another file with ass substitles and command works fine without using the -tag switch

i know i can use the below command with --sub-source switch, but how do i get nut to pass subtitles other than ass/ssa?

cls && ffmpeg.exe -hide_banner -hwaccel cuda -extra_hw_frames 8 -r "25000/1001" -i "INPUTvideo.mkv" -map 0:v -map 0:a -c:a copy -c:v hevc_nvenc -gpu 1 -colorspace bt709 -color_primaries bt709 -color_trc bt709 -color_range 1 -pix_fmt p010le -preset p2 -movflags +faststart -f nut - | "NVEncC64.exe" --avhw --qvbr 4 --preset P2 --output-depth 10 --profile main10 --tier high --multipass 2pass-full --qp-init 1 --max-bitrate 40000 --bref-mode each --bframes 4 --ref 4 --lookahead 32 --lookahead-level 3 --multiref-l0 1 --multiref-l1 1 --nonrefp --split-enc auto_forced --thread-affinity all --cuda-schedule auto --output-buf 128 --codec hevc --mv-precision q-pel --chapter-copy --audio-copy --sub-source "INPUTvideo.mkv" -i - -o "TestOUTPUTvideo.mkv"

quamt commented 6 months ago

What subtitle format does the other file have? As far as I can recall, "nut" doesn't support many subtitle formats.

Jigsawbg commented 6 months ago

Try with -f matroska instead of -f nut and check that this will do the job. I personally use -f matroska because nut does not support Dolby TrueHD or Dolby TrueHD with Atmos.

SweetPorkDumplings commented 6 months ago

Try with -f matroska instead of -f nut and check that this will do the job. I personally use -f matroska because nut does not support Dolby TrueHD or Dolby TrueHD with Atmos.

solved