Description
Hello all
I am trying to digitalize some VHS tapes with an USB-Grabber.
My workflow is as follows:
- Record the video with ffmpeg in mkv with a low compression (almost lossless)
- Load the mkv with avisynth+ and perform some filters for fixes
- Recode the avs with ffmpeg to the final format
Now my issue is that the audio is way off. Upon further investigation I see two problems:
- The FPS shown in ffmpeg/ffplay is off. It shows like 29.5 instead of 30.
- When playing the video in any player (like vlc), the first frame appears at around 21 second. But when playing the mkv with ffplay with a simple avisynth file which just loads the file (
FFmpegSource2("video.mkv", vtrack = -1, atrack = -1)
), the first frame appears already at second 15.
I tried to shorten the mkv with ffmpeg to the first 30 seconds which then shows an even worse framerate of 25 but the first frame appears at second 18? Still wrong but not that much as when using the full videofile.
I now also converted the video to uncompressed avi/pcm (ffmpeg -i "video.mkv" -acodec copy -vcodec rawvideo -y E:\Recordings\output.avi
) and this video seems to be totally correct in avisynth when using AviSource
to load it.
Can anyone help me here figuring out if this is a bug? I can also provide the video file if needed, just not here in github as the 30 second sample is still wrong but different as the full one.
Thank you
Edit1: I also noticed that the video duration is off by about 3 seconds (this are the 3 seconds which are missing and it starts at 18 instad of 21). The length when opening the MVK with avisynth is 00:27:14.01
and when using the raw avi (made from the same mkv) or when played with vlc it is 00:27:17.57
.
Edit2: When re-encoding, I found out that the exact same encoding with mp4 or with mkv leads to the issue with the mkv encode but not with the mp4 encode.
ffmpeg -i "orig.mkv" -c:v libx264 -crf 18 -aspect 4:3 -pix_fmt yuv420p -c:a libmp3lame -b:a 320k output.mp4
-> This one is fine, shows 30 fps , has the correct duration and starts the first frame at second 21 and the audio is sync.
ffmpeg -i "orig.mkv" -c:v libx264 -crf 18 -aspect 4:3 -pix_fmt yuv420p -c:a libmp3lame -b:a 320k output.mkv
-> This one is bad, shows the wrong fps, wrong duration and the first frame starts at second 15 and the audio is async.
Activity