Opened 9 months ago
Closed 9 months ago
#10454 closed defect (invalid)
Unable to remux AV1 stream from MKV to MKV
| Reported by: | mysterious | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | undetermined |
| Version: | 6.0 | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
Summary of the bug:
With some MKV source files, copying the AV1 video stream to an MKV output results in effectively no video data in the output file.
How to reproduce:
Run the following command with the attached sample.mkv:
ffmpeg -i sample.mkv -vcodec copy output.mkv
Tested on ffmpeg 6.0.
Output:
ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
[libdav1d @ 000001ba258d8600] libdav1d 1.1.0-3-g98b0c96
Input #0, matroska,webm, from 'sample.mkv':
Metadata:
encoder : libebml v1.4.4 + libmatroska v1.7.1
creation_time : 2023-07-08T07:38:01.000000Z
Duration: 00:00:06.59, start: 0.000000, bitrate: 349 kb/s
Stream #0:0: Video: av1 (Main), yuv420p10le(tv), 1920x1080, Film Grain, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn (default)
Metadata:
BPS : 340844
DURATION : 00:00:06.590000000
NUMBER_OF_FRAMES: 158
NUMBER_OF_BYTES : 280771
_STATISTICS_WRITING_APP: mkvmerge v77.0 ('Elemental') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2023-07-08 07:38:01
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Output #0, matroska, to 'out.mkv':
Metadata:
encoder : Lavf60.3.100
Stream #0:0: Video: av1 (Main) (AV01 / 0x31305641), yuv420p10le(tv), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn (default)
Metadata:
BPS : 340844
DURATION : 00:00:06.590000000
NUMBER_OF_FRAMES: 158
NUMBER_OF_BYTES : 280771
_STATISTICS_WRITING_APP: mkvmerge v77.0 ('Elemental') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2023-07-08 07:38:01
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=-1.0 Lsize= 1kB time=-577014:32:22.77 bitrate=N/A speed=N/A d=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Note the "video:0kB" output.
Adding -v debug causes a bunch of "cur_dts is invalid" errors to be spat out, if that matters.
Attachments (1)
Change History (3)
by , 9 months ago
| Attachment: | sample.mkv added |
|---|
comment:1 by , 9 months ago
comment:2 by , 9 months ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
Thanks so much for the info and suggestions!
Note:
See TracTickets
for help on using tickets.



The parser does not see any keyframes in your input (although the first packet is marked as keyframe in your input sample on the container level); because all input before the first keyframe is discarded by default, all input is discarded.
The sample in question contains a frame header indicating a key frame followed by a Tile Group containing a frame header indicating an inter frame. Because of the latter, the parser flags the packet as non-keyframe.
You can use -copyinkf (output option) or -fflags +noparse (input option) as a workaround.