A/V desynchronization using hardware encoder

Today I made a project with several clips, music, and masks (simple form).
The filters included in the project were:
Several audio and video input and output fades
Independent size and position filter for each clip
I applied the two-pass normalization filter and the bass and treble filter to the audio track.

I did two exports in the default Youtube preset (one with the hardware encoder on and the other off).
I found that the mp4 file resulting from the export via libx264 was smaller than the file resulting from the export with the h264 nvenc hardware encoder.
I thought the hardware encoding was faster. On my PC it was not so with this project.
Also, as a side effect, the hardware export desynchronized the audio (it sounds earlier). Is this within expectations?
I’m using version 20.06.14 Beta so I’m indicating this in case it influences something. I made my project with proxy 360p
My project did not include any keyframes.
I also had some incidence where suddenly the top clip was not visible in the preview window. Also in some clips, the applied effects did not appear in the preview window. After saving the project. I closed Shotcut and opened the project again and somehow everything worked again.
I also report that when I trimmed individual clips from the track (proxy) the individual clips did not show the proxy suffix. After a restart, they all showed the proxy suffix, so I guess somehow the connection between the clip and the proxy is broken (my guess only).
Anyway, I completed the project successfully and it’s great to handle several filters with a substantial improvement of the preview smoothness.

Although it’s not a big deal (I didn’t spend much time on it) here I share that video.

Hello again:
New questions arise about the export (specifically with the Youtube preset that I use most of the time).
Yesterday, (as I explained in my previous message) I did the whole project and the export with the Beta version.
Today I installed the newly released version 20.06.28 for 64-bit Windows.
I opened the project and made the same test exporting with Youtube preset with hardware acceleration and also without hardware acceleration.
The video resulting from the rendering with h264_nvenc still produces an audio/video desynchronization.
The video resulting from the rendering with libx264 does not have this desynchronization.
The results of all exports also make me think that something has changed for the rendering, because the files I got today with the last stable version, have different size and bitrate than the ones I rendered yesterday with the Beta version.
So, although I don’t really understand what the parameters mean, I found that there were some differences in the coding options.
For the same project (2:47) -export preset Youtube:

Beta: with h264_nvenc - 140 Mb
Stable: with h264_nvenc - 193 Mb
Beta: with libx264 - 112 Mb
Stable: with libx264 - 81.5 Mb

So I understand that this is an update and improvement over previous settings.
However, until yesterday, I never noticed that the export with hardware encoder gave me problems with synchronization.
is it possible that using the proxy function and preview scaling influences the performance-reliability of h264_nvenc encoder export?
Anyway, the solution that works for me is to disable hardware encoder, so I just want to share this behavior.

Only if you choose the export option “Use preview scaling.” Otherwise, the export process is not aware of the existence of proxy and preview scaling.

So, I really don’t know what’s causing the desynchronization.
What’s the “Use preview scaling” function? Where can I find information about this?
Thanks in advance for the answers.

I updated the docs about it:

1 Like

Thank you very much. :grinning: