rigaya / NVEnc

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

Subtitles not working NVEnc ?? #311

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello Rigaya, and everyone.

Can anyone confirm if there is a problem with subtitles ? NVEnc 5.29 (also tested with 5.26, same error) Tested with h264 because I don't have h265 encoding capability, but another user mentioned an error with h265.

NVEnc 5.29

"C:\Program Files\StaxRip\Apps\Encoders\NVEnc\NVEncC64.exe" --avhw  --cqp 18 --colormatrix bt709 --colorprim bt709 --transfer bt709 --sub-source "D:\Downloads\_IDM Downloads\testsubs.srt" -i "D:\Downloads\_IDM Downloads\Timecode sample at 25fps.mp4" -o "C:\Temp\_StaxRip\Timecode sample at 25fps_temp\Timecode sample at 25fps_out.h264"

-------------------------------------------------------------------------------------
C:\Temp\_StaxRip\Timecode sample at 25fps_temp\Timecode sample at 25fps_out.h264
-------------------------------------------------------------------------------------
NVEncC (x64) 5.29 (r1810) by rigaya, Feb 14 2021 06:13:25 (VC 1928/Win/avx2)
OS Version     Windows 10 x64 (19042) [UTF-8]
CPU            Intel Core i7-6700HQ @ 2.60GHz (4C/8T)
GPU            #0: GeForce GTX 960M (640 cores, 1176 MHz)[PCIe3x16][461.40]
NVENC / CUDA   NVENC API 11.0, CUDA 11.2, schedule mode: auto
Input Buffers  CUDA, 20 frames
Input Info     avcuvid: H.264/AVC, 1280x720, 25/1 fps
               avcodec audio: subrip
AVSync         vfr
Vpp Filters    copyDtoD
Output Info    H.264/AVC high @ Level auto
               1280x720p 1:1 25.000fps (25/1fps)
               avwriter: h264, subtitle#1 => h264
Encoder Preset default
Rate Control   CQP  I:18  P:18  B:18
Lookahead      off
GOP length     250 frames
B frames       3 frames [ref mode: disabled]
Ref frames     3 frames
AQ             off
VUI            matrix:bt709,colorprim:bt709,transfer:bt709
Others         mv:auto cabac deblock adapt-transform:auto bdirect:auto 
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
avout: failed to write header for output file: Invalid argument
Error occurred in ProcessOutput: 20
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error occurred in ProcessOutput: 20
Error FlushEncoder: 20.
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
avout: failed to write header for output file: Invalid argument
encoded 0 frames, 0.00 fps, 0.00 kbps, 0.00 MB
encode time 0:00:00, CPULoad: 7.0
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream
[h264 @ 0000019fae5fa480] h264 files have exactly one stream

Same error happens also when using avisynth input instead of avhw

When I remove subtitles, the encode works perfectly. The subtitles file is OK, I have checked it, and have tested both srt and ass format. Both did fail!

rigaya commented 3 years ago

Please try writing output file in mkv format using ".mkv", which is able to mux subtitles. ".h264" output is raw Elementary stream which does not support muxing subtitles.

Or, if you are using Staxrip, you might need to mux subtitle in another way from the app (I'm not sure how to do that).

ghost commented 3 years ago

Thanks !! I'm sorry @rigaya I thought this command can hard-code subtitles to video. So it only muxes them...

rigaya commented 3 years ago

For hard coding subtitles, there is another option, --vpp-subburn. May be this is the one you need?

ghost commented 3 years ago

Yes indeed, thanks again @rigaya I have documented it in the Staxrip Wiki !