Skip to content

[Bug]: HEVC_VAAPI encodes corrupted files #316

Done

Description

@wirehiker

Frame version

0.36.0_beta2

Operating system

Linux

Operating system version

Ubuntu 26.04

Source media details

hevc 3840x2160 29.552fps mp4

Steps to reproduce

h264_vaapi encoder works flowlessly, uses GPU (radeon RX 6600) to high load it's very fast. On the other hand hevc_vaapi produces corrupted green files

Expected behavior

a working mp4 video file

Actual behavior

a green mp4 file

FFmpeg logs

[INFO] Video preflight: Decode: cpu. Filters: cpu. Encoder: hevc_vaapi (nv12 on /dev/dri/renderD128).
[INFO] Running /tmp/.mount_Frame-ADHOfI/usr/bin/frame-media -progress /tmp/frame-completion-468067-1795908132221076917-1/progress -frame_decoder cpu -frame_device /dev/dri/renderD128 -frame_filters cpu -frame_format nv12 -i /home/wirehiker/Pictures/Hack Makita/20260911_001826.mp4 -c:v hevc_vaapi -tag:v hvc1 -b:v 10000k -vf transpose=2 -r 30 -map 0:v:0 -map 0:1 -c:a copy -dn -n /home/wirehiker/Pictures/Hack Makita/.frame-alac-468067-1795908132221116377-1/20260911_001826_hevc_vaapi.mp4
Duration: 00:00:04.015
Video route: decoder=cpu filters=cpu samples=nv12 upload=yes encoder=hevc_vaapi device=/dev/dri/renderD128
frame=2 time=00:00:00.033 media_us=33333 duration_us=4015044 work_us=33333 size_bytes=44 pass=0 video_frames=2
frame=22 time=00:00:00.703 media_us=703979 duration_us=4015044 work_us=703979 size_bytes=1290468 pass=0 video_frames=22
frame=42 time=00:00:01.366 media_us=1366667 duration_us=4015044 work_us=1366667 size_bytes=2320315 pass=0 video_frames=42
frame=63 time=00:00:02.069 media_us=2069292 duration_us=4015044 work_us=2069292 size_bytes=3329967 pass=0 video_frames=63
frame=82 time=00:00:02.709 media_us=2709292 duration_us=4015044 work_us=2709292 size_bytes=4317085 pass=0 video_frames=82
frame=102 time=00:00:03.370 media_us=3370604 duration_us=4015044 work_us=3370604 size_bytes=5331932 pass=0 video_frames=102
frame=120 time=00:00:04.000 media_us=4000000 duration_us=4015044 work_us=4000000 size_bytes=6215677 pass=0 video_frames=120
[INFO] Export verified; preparing publication

Additional context

No response

Checklist

  • I searched the existing issues and did not find a duplicate.
  • I agree to follow this project's Code of Conduct.

Activity

  1. wirehiker commented on Nov 29, 2026

    @wirehiker
    Author

    The problem only occurs with .mp4 container; if .mkv is selected, the generated video file works flowlessly.

    [INFO] Video preflight: Decode: vaapi. Filters: vaapi. Encoder: hevc_vaapi (p010le on /dev/dri/renderD128).
    [INFO] Running /tmp/.mount_Frame-mCnpHg/usr/bin/frame-media -progress /tmp/frame-completion-785640-1795958145305077343-4/progress -frame_decoder vaapi -frame_device /dev/dri/renderD128 -frame_filters vaapi -frame_format p010le -hwaccel vaapi -i /home/wirehiker/Downloads/Silicone Industrial Adhesive 45g K-703 704 705 706 RTV Silicone.mp4 -c:v hevc_vaapi -b:v 1500k -r 30 -map 0:v:0 -map 0:1 -c:a aac -b:a 128k -dn -n /home/wirehiker/Videos/Frame_output/.frame-alac-785640-1795958145305145214-4/Silicone Industrial Adhesive 45g K-703 704 705 706 RTV Silicone_converted_2_2.mkv
    Duration: 00:00:20.316
    Video route: decoder=vaapi filters=vaapi samples=p010le upload=no encoder=hevc_vaapi device=/dev/dri/renderD128
    frame=0 time=00:00:00.000 media_us=0 duration_us=20316440 work_us=0 size_bytes=939 pass=0 video_frames=0
    frame=122 time=00:00:04.040 media_us=4040272 duration_us=20316440 work_us=4040272 size_bytes=869263 pass=0 video_frames=122
    frame=245 time=00:00:08.133 media_us=8133333 duration_us=20316440 work_us=8133333 size_bytes=1667731 pass=0 video_frames=245
    frame=367 time=00:00:12.200 media_us=12200000 duration_us=20316440 work_us=12200000 size_bytes=2536074 pass=0 video_frames=367
    frame=488 time=00:00:16.233 media_us=16233333 duration_us=20316440 work_us=16233333 size_bytes=3362519 pass=0 video_frames=488
    [aac @ 0x5af96d74ab40] Qavg: 65536.000
    frame=609 time=00:00:20.300 media_us=20300000 duration_us=20316440 work_us=20300000 size_bytes=4333444 pass=0 video_frames=609
    [INFO] Export verified; preparing publication
    
  2. 66HEX commented on Nov 29, 2026

    @66HEX
    Owner

    Thanks for testing this, @wirehiker! Could you upload the four-second MP4 that came out green and let me know which player you used? If you can share the original clip too, that would help me compare the frames and reproduce the issue.

  3. wirehiker commented on Nov 29, 2026

    @wirehiker
    Author

    The conversion log:

    [INFO] Video preflight: Decode: cpu. Filters: cpu. Encoder: hevc_vaapi (nv12 on /dev/dri/renderD128).
    [INFO] Running /tmp/.mount_Frame-GKmjob/usr/bin/frame-media -progress /tmp/frame-completion-1021484-1795990813886857834-0/progress -frame_decoder cpu -frame_device /dev/dri/renderD128 -frame_filters cpu -frame_format nv12 -i /home/wirehiker/Downloads/20261129_231706.mp4 -c:v hevc_vaapi -tag:v hvc1 -b:v 5000k -r 30 -map 0:v:0 -map 0:1 -c:a copy -dn -n /home/wirehiker/Videos/Frame_output/.frame-alac-1021484-1795990813886901864-0/20261129_231706_converted.mp4
    Duration: 00:00:04.808
    Video route: decoder=cpu filters=cpu samples=nv12 upload=yes encoder=hevc_vaapi device=/dev/dri/renderD128
    frame=2 time=00:00:00.033 media_us=33333 duration_us=4808711 work_us=33333 size_bytes=44 pass=0 video_frames=2
    frame=83 time=00:00:02.733 media_us=2733333 duration_us=4808711 work_us=2733333 size_bytes=1929935 pass=0 video_frames=83
    frame=144 time=00:00:04.800 media_us=4800000 duration_us=4808711 work_us=4800000 size_bytes=3388837 pass=0 video_frames=144
    [INFO] Export verified; preparing publication
    

    the converted, corrupted file:
    https://github.com/user-attachments/assets/e60a5a39-08e1-47c3-bd0a-8e6ade23d924
    the original file good as any other I tested:
    https://github.com/user-attachments/assets/25cd511b-81a7-4178-9ded-611895ca1dcf
    as a player I use

    celluloid flatpak:
    Celluloid io.github.celluloid_player.Celluloid 0.30 stable system

    mpv:

    $ mpv --version
    mpv v0.41.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
    libplacebo version: v7.360.0
    FFmpeg version: 8.0.1-3ubuntu2 (runtime 8.0.1-3ubuntu2+esm5)
    FFmpeg library versions:
       libavcodec      62.11.100
       libavdevice     62.1.100
       libavfilter     11.4.100
       libavformat     62.3.100
       libavutil       60.8.100
       libswresample   6.1.100
       libswscale      9.1.100
    

    or VLC media player 3.0.23

    the problem is always the same mp4 container + hevc_vaapi encoder results in a corrupted file:

    Screenshot From 2026-11-29 23-20-11
  4. 66HEX commented on Nov 30, 2026

    @66HEX
    Owner

    Thanks for sending both clips, @wirehiker! The MP4 headers didn’t match the video your Radeon encoded, which is why it played back green. Beta 3 uses the headers from the encoded video. Could you try the same HEVC MP4 export with the new AppImage and let me know if it plays correctly on your RX 6600?

  5. wirehiker commented on Dec 1, 2026

    @wirehiker
    Author

    Nice work. The problem is solved. With Beta 3 I have been able to encode and decode HEVC MP4 with the RX 6600 effortlessly:
    [INFO] Video preflight: Decode: vaapi. Filters: vaapi. Encoder: hevc_vaapi (nv12 on /dev/dri/renderD128). [INFO] Running /tmp/.mount_Frame-iIHbmd/usr/bin/frame-media -progress /tmp/frame-completion-208256-1796087320409118982-2/progress -frame_decoder vaapi -frame_device /dev/dri/renderD128 -frame_filters vaapi -frame_format nv12 -hwaccel vaapi -i /home/wirehiker/Downloads/20261129_231706.mp4 -c:v hevc_vaapi -tag:v hvc1 -b:v 5000k -r 30 -map 0:v:0 -map 0:1 -c:a copy -dn -n /home/wirehiker/Videos/Frame_output/.frame-alac-208256-1796087320409167112-2/20261129_231706_converted.mp4 Duration: 00:00:04.808 Video route: decoder=vaapi filters=vaapi samples=nv12 upload=no encoder=hevc_vaapi device=/dev/dri/renderD128 frame=2 time=00:00:00.033 media_us=33333 duration_us=4808711 work_us=33333 size_bytes=44 pass=0 video_frames=2 frame=63 time=00:00:02.069 media_us=2069292 duration_us=4808711 work_us=2069292 size_bytes=1466779 pass=0 video_frames=63 frame=125 time=00:00:04.138 media_us=4138604 duration_us=4808711 work_us=4138604 size_bytes=2923888 pass=0 video_frames=125 frame=144 time=00:00:04.800 media_us=4800000 duration_us=4808711 work_us=4800000 size_bytes=3388822 pass=0 video_frames=144 [INFO] Export verified; preparing publication

    20261129_231706_converted.mp4

    The new sorting of the logging into separate tabs is very nice.
    Thanks for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions