1 (edited by nhypio 31-03-2025 07:55:32)

Topic: Transcoding video loses audio.

I transcoded the video using hevc_nvenc, and when it reached 100%, the video lost its audio.

However, when transcoding the video with libx265, both the audio and video were intact.

I want to use hevc_nvenc because libx265 consumes too many resources. Is there a way to fix this?

coder.log:

14:43:13.460: ===== Starting mpv ======
14:43:13.460: Command line: C:\Program Files (x86)\SVP 4\mpv64\mpv.exe C:/Users/Admin/Desktop/video.mp4 --o=C:/Users/Admin/Desktop/video.SVP.temporary.mkv --no-audio --no-sub --no-sub-auto --input-ipc-server=mpvencodepipe --input-media-keys=no --no-msg-color --video-crop=0x0+0+0 --vf=vapoursynth:[C:\Users\Admin\AppData\Roaming\SVP4\scripts\ffff.py]:4:20 --of=matroska --ovc=hevc_nvenc --ovcopts=cq=24,preset=slow,time_base=1000/45000,threads=20
14:43:13.493: ● Video --vid=1 (hevc 3840x1632 25 fps) [default]
14:43:13.493: ○ Audio --aid=1 (aac 2ch 48000 Hz 126 kbps) [default]
14:43:14.766: VO: [lavc] 3840x1632 yuv420p
14:43:14.766: [vo/lavc] Opening encoder: NVIDIA NVENC hevc encoder [hevc_nvenc]
14:43:14.991: [encode] Opening output file: C:/Users/Admin/Desktop/video.SVP.temporary.mkv
14:43:14.991: [encode] Opening muxer: Matroska [matroska]
14:43:15.195: V: 00:00:00 / 00:00:10 (0%) {0.0min 0.0MB}
14:43:43.849: [ffmpeg] matroska: pts (10622) < dts (10711) in stream 0
14:43:43.849: [encode] Writing packet failed.
14:43:43.897: Exiting... (Some errors happened)
14:43:44.081: (!!!) Intermediate file may be broken: C:\Users\Admin\Desktop\video.SVP.temporary.mkv
14:43:44.081: ===== mpv exited with code 3 =====

Post's attachments

coder.log 1.25 kb, 17 downloads since 2025-03-31 

Screenshot 2025-03-31 144902.png, 57.28 kb, 553 x 591
Screenshot 2025-03-31 144902.png 57.28 kb, 20 downloads since 2025-03-31 

Re: Transcoding video loses audio.

ffmpeg complains about timestamps in the video file, incompatible with mkv format (ffmpeg is extremely strict about this stuff)
since SVP's intermediate file is always in mkv format, not sure what we could do

Re: Transcoding video loses audio.

Audio loss, audio asynchrony, and similar issues persist after SVP4 transcoding
I don't know if there is a flexible solution