Avidemux Forum

Participate => Documentation & Tips => Topic started by: MoonKid on July 31, 2024, 04:09:42 PM

Title: H.265->H.264 : Audio track unmatched
Post by: MoonKid on July 31, 2024, 04:09:42 PM
I try to recode a video and in the result the audio track is highly unmatched to the video track. Correct timing is very important because it is a dance video.

I tried several settings but couldn't succeed. As a player I used Kodi on a Raspberry Pi 4. That Pi4 is also one of the reasons why I need to transform the video from H.265 into H.264 because the Pi4 is not able to play H.265.

VLC Media Player shows me this infos about the original video:

My firs try was H264 with 50% resolution (1920x1080) and as audio mp3 (MPEG Audio laye 1/2 (mpga) 44100 Hz, 32 bits per sample, Bitrate: 128 kB/s).

With the second try I used the same settings for the video stream but just copied the audio stream without modifying it.

What can I do to keep the video and audio track matched?

Does the container format (mkv, avi, ...) is relevant? I was using mkv just out of habit.
Title: Re: H.265->H.264 : Audio track unmatched
Post by: eumagga0x2a on July 31, 2024, 09:33:49 PM
Do you judge A/V sync by playing the video in Avidemux?

To play non-HDR HEVC 4K at 60 fps in Avidemux in real time, you need working hw decoder and by all means a hw accelerated video display (don't even try with unaccelerated "Qt" fallback). If the source is HDR, then a top-notch CPU will be absolutely required as Avidemux performs HDR --> SDR conversion purely on the CPU.

Recent Avidemux 2.8.2 nightlies show in the status bar how much video falls behind.

If you observe loss of A/V sync with video falling behind or becoming jerky in Kodi or VLC on RP4, the question would be, does it happen on a normal, powerful computer as well?

Container is irrelevant, audio codec is irrelevant too.

If there is a constant offset between video and audio, you should be able to correct it using audio shifr in Avidemux.
Title: Re: H.265->H.264 : Audio track unmatched
Post by: MoonKid on August 01, 2024, 06:06:00 PM
Thanks a lot for your response. I don't use Avidemux to judge A/V sync. I use an old PC and the RaspberryPi4. So it might be the performance.

In this case I am assuming that it also would help if I lower the resolution. I'll do some experiments and reporting back.
Title: Re: H.265->H.264 : Audio track unmatched
Post by: eumagga0x2a on August 02, 2024, 11:00:09 PM
Both resolution and high frame rate may pose a problem when hardware accelerated decoding and display don't work properly or are disabled in the video player.