#9636: Unable to remux HEVC stream from MKV to MKV
-------------------------------------+-------------------------------------
Reporter: mysterious | Type: defect
Status: new | Priority: normal
Component: | Version: git-
undetermined | master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
With some MKV source files, copying the HEVC video stream to an MKV output
may produce the error:
Could not write header for output file #0 (incorrect codec parameters ?):
Invalid data found when processing input
Error initializing output stream 0:0 --
How to reproduce:
Run the following command with the attached sample.mkv:
ffmpeg -i sample.mkv -vcodec copy output.mkv
Tried on v4.4.1, but reproduced on Git Windows build ''2022-02-07-git-
04cc7a5548-essentials_build-www.gyan.dev''
Full output:
{{{
ffmpeg version 2022-02-07-git-04cc7a5548-essentials_build-www.gyan.dev
Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (Rev7, 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-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-
avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx
--enable-mediafoundation --enable-libass --enable-libfreetype --enable-
libfribidi --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-
libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame
--enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-
libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis
--enable-librubberband
libavutil 57. 21.100 / 57. 21.100
libavcodec 59. 20.100 / 59. 20.100
libavformat 59. 17.101 / 59. 17.101
libavdevice 59. 5.100 / 59. 5.100
libavfilter 8. 26.101 / 8. 26.101
libswscale 6. 5.100 / 6. 5.100
libswresample 4. 4.100 / 4. 4.100
libpostproc 56. 4.100 / 56. 4.100
Input #0, matroska,webm, from 'b.mkv':
Metadata:
encoder : libebml v1.3.7 + libmatroska v1.5.0
creation_time : 2022-02-10T10:46:36.000000Z
Duration: 00:00:04.51, start: 0.000000, bitrate: 723 kb/s
Stream #0:0: Video: hevc (Main), yuv420p(tv, bt709), 1920x1080, SAR 1:1
DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn (default)
Metadata:
title : Presented By EMBER
BPS-eng : 707780
DURATION-eng : 00:00:04.505000000
NUMBER_OF_FRAMES-eng: 108
NUMBER_OF_BYTES-eng: 398569
_STATISTICS_WRITING_APP-eng: mkvmerge v34.0.0 ('Sight and Seen')
64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2022-02-10 10:46:36
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
File 'c.mkv' already exists. Overwrite? [y/N] y
Could not write header for output file #0 (incorrect codec parameters ?):
Invalid data found when processing input
Error initializing output stream 0:0 --
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Last message repeated 1 times
}}}
Output from ''ffprobe -show_format -show_streams -print_format json
sample.mkv''
{{{
{
"streams": [
{
"index": 0,
"codec_name": "hevc",
"codec_long_name": "H.265 / HEVC (High Efficiency Video
Coding)",
"profile": "Main",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1920,
"height": 1080,
"coded_width": 1920,
"coded_height": 1080,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": 123,
"color_range": "tv",
"color_space": "bt709",
"color_transfer": "bt709",
"color_primaries": "bt709",
"chroma_location": "left",
"refs": 1,
"r_frame_rate": "27021/1127",
"avg_frame_rate": "27021/1127",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"extradata_size": 1975,
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
},
"tags": {
"title": "Presented By EMBER",
"BPS-eng": "707780",
"DURATION-eng": "00:00:04.505000000",
"NUMBER_OF_FRAMES-eng": "108",
"NUMBER_OF_BYTES-eng": "398569",
"_STATISTICS_WRITING_APP-eng": "mkvmerge v34.0.0 ('Sight
and Seen') 64-bit",
"_STATISTICS_WRITING_DATE_UTC-eng": "2022-02-10 10:46:36",
"_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES
NUMBER_OF_BYTES"
}
}
],
"format": {
"filename": "sample.mkv",
"nb_streams": 1,
"nb_programs": 0,
"format_name": "matroska,webm",
"format_long_name": "Matroska / WebM",
"start_time": "0.000000",
"duration": "4.505000",
"size": "407168",
"bit_rate": "723050",
"probe_score": 100,
"tags": {
"encoder": "libebml v1.3.7 + libmatroska v1.5.0",
"creation_time": "2022-02-10T10:46:36.000000Z"
}
}
}
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9636>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker_______________________________________________
FFmpeg-trac mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".