09.10.2026, 22:14
I have some old wmv/asf videos from 2005 that I am converting.
They have a problem with dropping frames when converting. The resulting files have lesser frame counts than the sources, causing the audio to go out of sync.
This is most likely caused by these stupid old Windows WMV encoders skipping frames that they drop as static or duplicate (still openings, short low-change sections, etc.).
Windows Media encoders commonly did this to save bits on an Internet where many people still used dial up and it could make a significant difference in loading times.
The problem is that AviSynth drops these frames (there's usually only 1-3 seconds worth) and stacks the remaining ones in order, but, there's slightly less frames, and the audio will go out of sync. (To be fair, FFprobe also drops these frames when scanning the file with "-count_frames" and reports the exact same lower total for the frame count.)
The fix for a .mp4 re-encode would be to go to Misc -> Overwrite Input -> Frame rate, and enter 29.970030 (30,000/1001, the video's input frame rate).
The expected result would then be to see in the AviSynth script preview:
That should fix it, however, currently, Hybrid does not insert ",fpsnum=30000,fpsden=1001" into the line, leaving it like this:
So, Hybrid's AviSynth scripting code needs to be fixed so that when Misc -> Overwrite Input -> Frame rate has something entered, it should be inserting the correct corresponding ",fpsnum=x,fpsden=x" frame rate info the "LWLibavVideoSource" line in the AviSynth script. (I do believe that Hybrid is currently doing this correctly in Vapoursynth.) If the user has something specified in Misc -> Overwrite Output -> Frame rate to for some reason, then that frame rate should be entered into the AviSynth script in the "AssumeFPS(x,x)" line towards the end.
Just for quick reference in case it might be helpful, common rational values for standard video frame rates:
For now, a quick fix would be to enter the "LWLibavVideoSource("F:\cj\fix\Test.wmv",fpsnum=30000,fpsden=1001,cache=false,dr=true,format="YUV420P8", prefer_hw=0,repeat=true)" line into a filter on the Custom tab, inserting it at the very top by putting it in Insert before -> ColorMatrix. There will then be two "LWLibavVideoSource" lines in the script, but since the Custom one comes after the first one generated by Hybrid, the Custom one will override it.
They have a problem with dropping frames when converting. The resulting files have lesser frame counts than the sources, causing the audio to go out of sync.
This is most likely caused by these stupid old Windows WMV encoders skipping frames that they drop as static or duplicate (still openings, short low-change sections, etc.).
Windows Media encoders commonly did this to save bits on an Internet where many people still used dial up and it could make a significant difference in loading times.
The problem is that AviSynth drops these frames (there's usually only 1-3 seconds worth) and stacks the remaining ones in order, but, there's slightly less frames, and the audio will go out of sync. (To be fair, FFprobe also drops these frames when scanning the file with "-count_frames" and reports the exact same lower total for the frame count.)
The fix for a .mp4 re-encode would be to go to Misc -> Overwrite Input -> Frame rate, and enter 29.970030 (30,000/1001, the video's input frame rate).
The expected result would then be to see in the AviSynth script preview:
Code:
LWLibavVideoSource("F:\cj\fix\Test.wmv",fpsnum=30000,fpsden=1001,cache=false,dr=true,format="YUV420P8", prefer_hw=0,repeat=true)That should fix it, however, currently, Hybrid does not insert ",fpsnum=30000,fpsden=1001" into the line, leaving it like this:
Code:
LWLibavVideoSource("F:\cj\fix\Test.wmv",cache=false,dr=true,format="YUV420P8", prefer_hw=0,repeat=true)So, Hybrid's AviSynth scripting code needs to be fixed so that when Misc -> Overwrite Input -> Frame rate has something entered, it should be inserting the correct corresponding ",fpsnum=x,fpsden=x" frame rate info the "LWLibavVideoSource" line in the AviSynth script. (I do believe that Hybrid is currently doing this correctly in Vapoursynth.) If the user has something specified in Misc -> Overwrite Output -> Frame rate to for some reason, then that frame rate should be entered into the AviSynth script in the "AssumeFPS(x,x)" line towards the end.
Just for quick reference in case it might be helpful, common rational values for standard video frame rates:
- 23.976 fps (NTSC Film): fpsnum=24000, fpsden=1001
- 24.0 fps (True Film): fpsnum=24, fpsden=1
- 29.97 fps (NTSC Video): fpsnum=30000, fpsden=1001
- 30.0 fps: fpsnum=30, fpsden=1
- 59.94 fps (NTSC High Frame Rate): fpsnum=60000, fpsden=1001
- 60.0 fps: fpsnum=60, fpsden=1
- 25.0 fps (PAL): fpsnum=25, fpsden=1
- 50.0 fps (PAL High Frame Rate): fpsnum=50, fpsden=1
For now, a quick fix would be to enter the "LWLibavVideoSource("F:\cj\fix\Test.wmv",fpsnum=30000,fpsden=1001,cache=false,dr=true,format="YUV420P8", prefer_hw=0,repeat=true)" line into a filter on the Custom tab, inserting it at the very top by putting it in Insert before -> ColorMatrix. There will then be two "LWLibavVideoSource" lines in the script, but since the Custom one comes after the first one generated by Hybrid, the Custom one will override it.