ffmpeg -vaapi_device /dev/dri/renderD128 -loglevel debug -hwaccel vaapi -hwaccel_output_format vaapi -i sample.mkv -c:v hevc_vaapi -crf 28 -qp 25 -profile:v main -tier high -level 51 -c:a copy -map 0 output.mkv ffmpeg version N-98443-gf9277cd Copyright (c) 2000-2020 the FFmpeg developers built with gcc 7 (SUSE Linux) configuration: --prefix=/home/build/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/build/ffmpeg_build/include --extra-ldflags=-L/home/build/ffmpeg_build/lib --extra-ldflags=-L/home/build/ffmpeg_build/lib64 --extra-libs=-lpthread --extra-libs=-lm --bindir=/home/build/bin --enable-gpl --enable-vaapi --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-static libavutil 56. 55.100 / 56. 55.100 libavcodec 58. 94.100 / 58. 94.100 libavformat 58. 48.100 / 58. 48.100 libavdevice 58. 11.101 / 58. 11.101 libavfilter 7. 87.100 / 7. 87.100 libswscale 5. 8.100 / 5. 8.100 libswresample 3. 8.100 / 3. 8.100 libpostproc 55. 8.100 / 55. 8.100 Splitting the commandline. Reading option '-vaapi_device' ... matched as option 'vaapi_device' (set VAAPI hardware device (DRM path or X11 display name)) with argument '/dev/dri/renderD128'. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Reading option '-hwaccel' ... matched as option 'hwaccel' (use HW accelerated decoding) with argument 'vaapi'. Reading option '-hwaccel_output_format' ... matched as option 'hwaccel_output_format' (select output format used with HW accelerated decoding) with argument 'vaapi'. Reading option '-i' ... matched as input url with argument 'sample.mkv'. Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'hevc_vaapi'. Reading option '-crf' ... matched as AVOption 'crf' with argument '28'. Reading option '-qp' ... matched as AVOption 'qp' with argument '25'. Reading option '-profile:v' ... matched as option 'profile' (set profile) with argument 'main'. Reading option '-tier' ... matched as AVOption 'tier' with argument 'high'. Reading option '-level' ... matched as AVOption 'level' with argument '51'. Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'. Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0'. Reading option 'output.mkv' ... matched as output url. Finished splitting the commandline. Parsing a group of options: global . Applying option vaapi_device (set VAAPI hardware device (DRM path or X11 display name)) with argument /dev/dri/renderD128. [AVHWDeviceContext @ 0x4ce9500] libva: VA-API version 1.5.0 [AVHWDeviceContext @ 0x4ce9500] libva: va_getDriverName() returns 0 [AVHWDeviceContext @ 0x4ce9500] libva: Trying to open /usr/lib64/dri/radeonsi_drv_video.so [AVHWDeviceContext @ 0x4ce9500] libva: Found init function __vaDriverInit_1_5 [AVHWDeviceContext @ 0x4ce9500] libva: va_openDriver() returns 0 [AVHWDeviceContext @ 0x4ce9500] Initialised VAAPI connection: version 1.5 [AVHWDeviceContext @ 0x4ce9500] Format 0x3231564e -> nv12. [AVHWDeviceContext @ 0x4ce9500] Format 0x30313050 -> p010le. [AVHWDeviceContext @ 0x4ce9500] Format 0x36313050 -> unknown. [AVHWDeviceContext @ 0x4ce9500] Format 0x30323449 -> yuv420p. [AVHWDeviceContext @ 0x4ce9500] Format 0x32315659 -> yuv420p. [AVHWDeviceContext @ 0x4ce9500] Format 0x56595559 -> unknown. [AVHWDeviceContext @ 0x4ce9500] Format 0x32595559 -> yuyv422. [AVHWDeviceContext @ 0x4ce9500] Format 0x59565955 -> uyvy422. [AVHWDeviceContext @ 0x4ce9500] Format 0x41524742 -> bgra. [AVHWDeviceContext @ 0x4ce9500] Format 0x41424752 -> rgba. [AVHWDeviceContext @ 0x4ce9500] Format 0x58524742 -> bgr0. [AVHWDeviceContext @ 0x4ce9500] Format 0x58424752 -> rgb0. [AVHWDeviceContext @ 0x4ce9500] VAAPI driver: Mesa Gallium driver 20.2.0-devel for AMD RAVEN (DRM 3.33.0, 5.3.18-lp152.20.7-default, LLVM 10.0.0). [AVHWDeviceContext @ 0x4ce9500] Driver not found in known nonstandard list, using standard behaviour. Applying option loglevel (set logging level) with argument debug. Successfully parsed a group of options. Parsing a group of options: input url sample.mkv. Applying option hwaccel (use HW accelerated decoding) with argument vaapi. Applying option hwaccel_output_format (select output format used with HW accelerated decoding) with argument vaapi. Successfully parsed a group of options. Opening an input file: sample.mkv. [NULL @ 0x4e7a180] Opening 'sample.mkv' for reading [file @ 0x4e8f640] Setting default whitelist 'file,crypto,data' [matroska,webm @ 0x4e7a180] Format matroska,webm probed with size=2048 and score=100 st:0 removing common factor 1000000 from timebase st:1 removing common factor 1000000 from timebase [matroska,webm @ 0x4e7a180] Before avformat_find_stream_info() pos: 5527 bytes read:33553 seeks:2 nb_streams:2 [h264 @ 0x4ee3bc0] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0x4ee3bc0] nal_unit_type: 8(PPS), nal_ref_idc: 3 [h264 @ 0x4ee3bc0] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0x4ee3bc0] nal_unit_type: 8(PPS), nal_ref_idc: 3 [h264 @ 0x4ee3bc0] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0x4ee3bc0] nal_unit_type: 8(PPS), nal_ref_idc: 3 [h264 @ 0x4ee3bc0] nal_unit_type: 6(SEI), nal_ref_idc: 0 [h264 @ 0x4ee3bc0] nal_unit_type: 5(IDR), nal_ref_idc: 3 [h264 @ 0x4ee3bc0] Format yuv420p chosen by get_format(). [h264 @ 0x4ee3bc0] Reinit context to 1280x720, pix_fmt: yuv420p [h264 @ 0x4ee3bc0] no picture [matroska,webm @ 0x4e7a180] All info found [matroska,webm @ 0x4e7a180] After avformat_find_stream_info() pos: 78142 bytes read:131857 seeks:2 frames:11 Input #0, matroska,webm, from 'sample.mkv': Metadata: encoder : libebml v1.3.9 + libmatroska v1.5.2 creation_time : 2020-06-26T20:51:30.000000Z Duration: 00:40:36.26, start: 0.000000, bitrate: 2292 kb/s Stream #0:0, 4, 1/1000: Video: h264 (High), 1 reference frame, yuv420p(progressive, left), 1280x720 [SAR 1:1 DAR 16:9], 0/1, 25 fps, 25 tbr, 1k tbn, 2k tbc (default) Metadata: BPS-eng : 1907214 DURATION-eng : 00:40:36.120000000 NUMBER_OF_FRAMES-eng: 60903 NUMBER_OF_BYTES-eng: 580775405 _STATISTICS_WRITING_APP-eng: mkvmerge v38.0.0 ('The Silent Type') 64-bit _STATISTICS_WRITING_DATE_UTC-eng: 2020-06-26 20:51:30 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:1, 7, 1/1000: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default) Metadata: BPS-eng : 384000 DURATION-eng : 00:40:36.256000000 NUMBER_OF_FRAMES-eng: 76133 NUMBER_OF_BYTES-eng: 116940288 _STATISTICS_WRITING_APP-eng: mkvmerge v38.0.0 ('The Silent Type') 64-bit _STATISTICS_WRITING_DATE_UTC-eng: 2020-06-26 20:51:30 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Successfully opened the file. Parsing a group of options: output url output.mkv. Applying option c:v (codec name) with argument hevc_vaapi. Applying option profile:v (set profile) with argument main. Applying option c:a (codec name) with argument copy. Applying option map (set input stream mapping) with argument 0. Successfully parsed a group of options. Opening an output file: output.mkv. [file @ 0x5056d40] Setting default whitelist 'file,crypto,data' Successfully opened the file. detected 8 logical cores [h264 @ 0x4e48180] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0x4e48180] nal_unit_type: 8(PPS), nal_ref_idc: 3 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_vaapi)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 2 times [h264 @ 0x4e48180] nal_unit_type: 7(SPS), nal_ref_idc: 3 cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 1 times [h264 @ 0x4e48180] nal_unit_type: 8(PPS), nal_ref_idc: 3 cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 3 times [h264 @ 0x4e48180] nal_unit_type: 6(SEI), nal_ref_idc: 0 [h264 @ 0x4e48180] nal_unit_type: 5(IDR), nal_ref_idc: 3 [h264 @ 0x4e48180] Format vaapi_vld chosen by get_format(). [h264 @ 0x4e48180] Format vaapi_vld requires hwaccel initialisation. [h264 @ 0x4e48180] Considering format 0x3231564e -> nv12. [h264 @ 0x4e48180] Picked nv12 (0x3231564e) as best match for yuv420p. [AVHWFramesContext @ 0x4f71000] Created surface 0x1. [AVHWFramesContext @ 0x4f71000] Direct mapping disabled: deriving image does not work: 1 (operation failed). [AVHWFramesContext @ 0x4f71000] Created surface 0x2. [AVHWFramesContext @ 0x4f71000] Created surface 0x3. [AVHWFramesContext @ 0x4f71000] Created surface 0x4. [AVHWFramesContext @ 0x4f71000] Created surface 0x5. [AVHWFramesContext @ 0x4f71000] Created surface 0x6. [AVHWFramesContext @ 0x4f71000] Created surface 0x7. [AVHWFramesContext @ 0x4f71000] Created surface 0x8. [AVHWFramesContext @ 0x4f71000] Created surface 0x9. [AVHWFramesContext @ 0x4f71000] Created surface 0xa. [AVHWFramesContext @ 0x4f71000] Created surface 0xb. [AVHWFramesContext @ 0x4f71000] Created surface 0xc. [AVHWFramesContext @ 0x4f71000] Created surface 0xd. [AVHWFramesContext @ 0x4f71000] Created surface 0xe. [AVHWFramesContext @ 0x4f71000] Created surface 0xf. [AVHWFramesContext @ 0x4f71000] Created surface 0x10. [AVHWFramesContext @ 0x4f71000] Created surface 0x11. [AVHWFramesContext @ 0x4f71000] Created surface 0x12. [AVHWFramesContext @ 0x4f71000] Created surface 0x13. [AVHWFramesContext @ 0x4f71000] Created surface 0x14. [AVHWFramesContext @ 0x4f71000] Created surface 0x15. [AVHWFramesContext @ 0x4f71000] Created surface 0x16. [AVHWFramesContext @ 0x4f71000] Created surface 0x17. [AVHWFramesContext @ 0x4f71000] Created surface 0x18. [AVHWFramesContext @ 0x4f71000] Created surface 0x19. [AVHWFramesContext @ 0x4f71000] Created surface 0x1a. [AVHWFramesContext @ 0x4f71000] Created surface 0x1b. [AVHWFramesContext @ 0x4f71000] Created surface 0x1c. [AVHWFramesContext @ 0x4f71000] Created surface 0x1d. [h264 @ 0x4e48180] Considering format 0x3231564e -> nv12. [h264 @ 0x4e48180] Picked nv12 (0x3231564e) as best match for yuv420p. [h264 @ 0x4e48180] Decode context initialised: 0x1e/0x1f. [h264 @ 0x4e48180] Reinit context to 1280x720, pix_fmt: vaapi_vld [h264 @ 0x4e48180] no picture [h264 @ 0x4e48180] Param buffer (type 0, 672 bytes) is 0x20. [h264 @ 0x4e48180] Param buffer (type 1, 240 bytes) is 0x21. [h264 @ 0x4e48180] Slice 0 param buffer (3128 bytes) is 0x22. [h264 @ 0x4e48180] Slice 0 data buffer (35272 bytes) is 0x23. [h264 @ 0x4e48180] Decode to surface 0x1d. cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264 @ 0x4f687c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x4f687c0] no picture [h264 @ 0x4f687c0] Param buffer (type 0, 672 bytes) is 0x20. [h264 @ 0x4f687c0] Param buffer (type 1, 240 bytes) is 0x21. [h264 @ 0x4f687c0] Slice 0 param buffer (3128 bytes) is 0x22. [h264 @ 0x4f687c0] Slice 0 data buffer (15477 bytes) is 0x23. [h264 @ 0x4f687c0] Decode to surface 0x1c. cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264 @ 0x4f5e9c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x4f5e9c0] Param buffer (type 0, 672 bytes) is 0x20. [h264 @ 0x4f5e9c0] Param buffer (type 1, 240 bytes) is 0x21. [h264 @ 0x4f5e9c0] Slice 0 param buffer (3128 bytes) is 0x22. [h264 @ 0x4f5e9c0] Slice 0 data buffer (5526 bytes) is 0x23. [h264 @ 0x4f5e9c0] Decode to surface 0x1b. cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264 @ 0x4df2b00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0 [h264 @ 0x4df2b00] Param buffer (type 0, 672 bytes) is 0x20. [h264 @ 0x4df2b00] Param buffer (type 1, 240 bytes) is 0x21. [h264 @ 0x4df2b00] Slice 0 param buffer (3128 bytes) is 0x22. [h264 @ 0x4df2b00] Slice 0 data buffer (3261 bytes) is 0x23. [h264 @ 0x4df2b00] Decode to surface 0x1a. cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times [h264 @ 0x4df0a00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0 [h264 @ 0x4df0a00] Param buffer (type 0, 672 bytes) is 0x20. [h264 @ 0x4df0a00] Param buffer (type 1, 240 bytes) is 0x21. [h264 @ 0x4df0a00] Slice 0 param buffer (3128 bytes) is 0x22. [h264 @ 0x4df0a00] Slice 0 data buffer (4040 bytes) is 0x23. [h264 @ 0x4df0a00] Decode to surface 0x19. cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264 @ 0x4fba7c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x4fba7c0] Param buffer (type 0, 672 bytes) is 0x20. [h264 @ 0x4fba7c0] Param buffer (type 1, 240 bytes) is 0x21. [h264 @ 0x4fba7c0] Slice 0 param buffer (3128 bytes) is 0x22. [h264 @ 0x4fba7c0] Slice 0 data buffer (16647 bytes) is 0x23. [h264 @ 0x4fba7c0] Decode to surface 0x18. cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264 @ 0x4f9f200] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x4f9f200] Param buffer (type 0, 672 bytes) is 0x20. [h264 @ 0x4f9f200] Param buffer (type 1, 240 bytes) is 0x21. [h264 @ 0x4f9f200] Slice 0 param buffer (3128 bytes) is 0x22. [h264 @ 0x4f9f200] Slice 0 data buffer (6088 bytes) is 0x23. [h264 @ 0x4f9f200] Decode to surface 0x17. cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264 @ 0x4fa7b40] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0 [h264 @ 0x4fa7b40] Param buffer (type 0, 672 bytes) is 0x20. [h264 @ 0x4fa7b40] Param buffer (type 1, 240 bytes) is 0x21. [h264 @ 0x4fa7b40] Slice 0 param buffer (3128 bytes) is 0x22. [h264 @ 0x4fa7b40] Slice 0 data buffer (3612 bytes) is 0x23. [h264 @ 0x4fa7b40] Decode to surface 0x16. cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264 @ 0x4f739c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0 [h264 @ 0x4f739c0] Param buffer (type 0, 672 bytes) is 0x20. [h264 @ 0x4f739c0] Param buffer (type 1, 240 bytes) is 0x21. [h264 @ 0x4f739c0] Slice 0 param buffer (3128 bytes) is 0x22. [h264 @ 0x4f739c0] Slice 0 data buffer (3548 bytes) is 0x23. [h264 @ 0x4f739c0] Decode to surface 0x15. cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264 @ 0x4e48180] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x4e48180] Param buffer (type 0, 672 bytes) is 0x20. [h264 @ 0x4e48180] Param buffer (type 1, 240 bytes) is 0x21. [h264 @ 0x4e48180] Slice 0 param buffer (3128 bytes) is 0x22. [h264 @ 0x4e48180] Slice 0 data buffer (17003 bytes) is 0x23. [h264 @ 0x4e48180] Decode to surface 0x14. [graph 0 input from stream 0:0 @ 0x506f380] Setting 'video_size' to value '1280x720' [graph 0 input from stream 0:0 @ 0x506f380] Setting 'pix_fmt' to value '46' [graph 0 input from stream 0:0 @ 0x506f380] Setting 'time_base' to value '1/1000' [graph 0 input from stream 0:0 @ 0x506f380] Setting 'pixel_aspect' to value '1/1' [graph 0 input from stream 0:0 @ 0x506f380] Setting 'frame_rate' to value '25/1' [graph 0 input from stream 0:0 @ 0x506f380] w:1280 h:720 pixfmt:vaapi_vld tb:1/1000 fr:25/1 sar:1/1 [format @ 0x506f680] Setting 'pix_fmts' to value 'vaapi_vld' [AVFilterGraph @ 0x506e3c0] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed [hevc_vaapi @ 0x4e1fac0] Using input frames context (format vaapi_vld) with hevc_vaapi encoder. [hevc_vaapi @ 0x4e1fac0] Input surface format is nv12. [hevc_vaapi @ 0x4e1fac0] Using VAAPI profile VAProfileHEVCMain (17). [hevc_vaapi @ 0x4e1fac0] Using VAAPI entrypoint VAEntrypointEncSlice (6). [hevc_vaapi @ 0x4e1fac0] Using VAAPI render target format YUV420 (0x1). [hevc_vaapi @ 0x4e1fac0] Driver supports RC modes CQP, CBR, VBR. [hevc_vaapi @ 0x4e1fac0] RC mode: CQP. [hevc_vaapi @ 0x4e1fac0] RC quality: 25. [hevc_vaapi @ 0x4e1fac0] RC framerate: 25/1 (25.00 fps). [hevc_vaapi @ 0x4e1fac0] Using intra and P-frames (supported references: 1 / 0). [hevc_vaapi @ 0x4e1fac0] Driver does not support some wanted packed headers (wanted 0xd, found 0). [hevc_vaapi @ 0x4e1fac0] Driver does not support packed sequence headers, but a global header is requested. [hevc_vaapi @ 0x4e1fac0] No global header will be written: this may result in a stream which is not usable for some purposes (e.g. not muxable to some containers). [hevc_vaapi @ 0x4e1fac0] Using nv12 as format of reconstructed frames. [h264 @ 0x4f687c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [AVHWFramesContext @ 0x53888c0] Created surface 0x21. [h264 @ 0x4f687c0] Param buffer (type 0, 672 bytes) is 0x22. [h264 @ 0x4f687c0] Param buffer (type 1, 240 bytes) is 0x23. [AVHWFramesContext @ 0x53888c0] Direct mapping disabled: deriving image does not work: 1 (operation failed). [h264 @ 0x4f687c0] Slice 0 param buffer (3128 bytes) is 0x24. [hevc_vaapi @ 0x4e1fac0] Using fixed QP = 25 / 25 / 30 for IDR- / P- / B-frames. [h264 @ 0x4f687c0] Slice 0 data buffer (5674 bytes) is 0x26. [h264 @ 0x4f687c0] Decode to surface 0x13. [matroska @ 0x4e63400] get_metadata_duration returned: 0 Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input Error initializing output stream 0:0 -- [AVIOContext @ 0x4e47480] Statistics: 0 seeks, 1 writeouts [AVIOContext @ 0x4ea0740] Statistics: 197393 bytes read, 2 seeks Conversion failed!