-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading an MKV in AviSynth+ has wrong framerate and strange out of sync problems #370
Comments
You've most likely created a huge mess without realizing. I suspect that your USB-grabber actually drops frames which leads to the mkv output being full variable framerate. Using avi as the container and manually specifying the framerate should yield something more managable for intermediate processing. |
Hmm when I recorded with ffmpeg, it showed 3 dropped frames or is this something else? What would be a good format to record from the usb grabber in order to work with it afterwards? Currently I use: I use the mp4 for processing afterwards as that one seems to work and the mkv is just used that I can duplicate it while encoding and open it, which does not work with the mp4 until it is finished. |
Using the mp4 as input instead of the mkv solves the video issue but now with veeeery long videos (3 hours), the audio is getting more and more async as the video progresses. |
Unfortunately the answer above did not help. I now ended up setting the framerate as above but then manually play around with the Edit: To check the framerate, I am using Edit2: Not sure if this is related to #350, but I have the issue also with mp4 files and also with version 2.23.1. |
Use -vsync cfr -r 30 -x264opts force-cfr -c:v libx264 -async 1 out.mkv options in ffmpeg. |
"It is still strange because playing the mp4 in vlc or even in ffplay does not show any async problems, only when using it as input for FFmpegSource2" |
@artenaki Thank you a lot for your tips, I tried it and it seems better but the audio is still a bit async when played with avisynth compared to vlc. Edit: Now it just seems slightly during the whole video, so it is at least not getting worse the longer the video. |
Hello all
I am trying to digitalize some VHS tapes with an USB-Grabber.
My workflow is as follows:
Now my issue is that the audio is way off. Upon further investigation I see two problems:
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 usingAviSource
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 is00: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.The text was updated successfully, but these errors were encountered: