H.265->H.264 : Audio track unmatched

Started by MoonKid, July 31, 2024, 04:09:42 PM

Previous topic - Next topic

MoonKid

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:
  • H265 - MPEG-4 AVC (part 10) {avc1}
  • 3840x2160 resolution at 60.007236 framerate
  • Audio is MPEG AAC Audio (mp4a)
  • 44100 Hz with 32 Bits per sample

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.

eumagga0x2a

#1
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.

MoonKid

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.

eumagga0x2a

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.