ABurns
7th December 2020, 00:50
I've Googled this problem, but every solution I've found doesn't seem to work for me. I'm encoding x265 with FFMPEG and then muxing, but on mux I get the error:
[matroska @ 000001c974ade080] Timestamps are unset in a packet for stream 2. This is deprecated and will stop working in the future.
Fix your code to set the timestamps properly
[matroska @ 000001c974ade080] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
For clarity, I'm starting with an MKV ripped from a DVD, encoding it x265 (please don't start about x265 at SD - I know what I want), and then remuxing with the HEVC stream in place of the MPEG-2 stream. This is done via .bat files, which I will combine once I get everything working.
The encode script.
for %%F in (*.avs) do ffmpeg.exe -i "%%F" -c:v libx265 -framerate 24000/1001 -preset medium -crf 23 -profile:v main10
-x265-params "no-sao=1:selective-sao=0" -vf "scale=720:480,setdar=4/3" "%%~F.hevc"
The mux script.
for %%i in ("*.mkv") do ffmpeg -i "%%i" -i "%%~ni.avs.hevc" -c: copy -map 0 -map -0:v:0 -map 1 "../%%i"
I've tried -use_wallclock_as_timestamps 1, -vsync 0 -enc_time_base -1, and -fflags +genpts as suggested in various places, but none solve my problem. Any idea how to get these streams to mux properly?
[matroska @ 000001c974ade080] Timestamps are unset in a packet for stream 2. This is deprecated and will stop working in the future.
Fix your code to set the timestamps properly
[matroska @ 000001c974ade080] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
For clarity, I'm starting with an MKV ripped from a DVD, encoding it x265 (please don't start about x265 at SD - I know what I want), and then remuxing with the HEVC stream in place of the MPEG-2 stream. This is done via .bat files, which I will combine once I get everything working.
The encode script.
for %%F in (*.avs) do ffmpeg.exe -i "%%F" -c:v libx265 -framerate 24000/1001 -preset medium -crf 23 -profile:v main10
-x265-params "no-sao=1:selective-sao=0" -vf "scale=720:480,setdar=4/3" "%%~F.hevc"
The mux script.
for %%i in ("*.mkv") do ffmpeg -i "%%i" -i "%%~ni.avs.hevc" -c: copy -map 0 -map -0:v:0 -map 1 "../%%i"
I've tried -use_wallclock_as_timestamps 1, -vsync 0 -enc_time_base -1, and -fflags +genpts as suggested in various places, but none solve my problem. Any idea how to get these streams to mux properly?