Skip to content
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

flipnote export as mkv doesn't always create correct length video #6

Closed
wyntrr-end opened this issue Nov 3, 2020 · 5 comments
Closed

Comments

@wyntrr-end
Copy link
Contributor

wyntrr-end commented Nov 3, 2020

In my testing (PPM.py), I found that because of the way ffmpeg is used with the -shortest flag when combining the BGM, if the BGM is shorter than the flipnote, then the video is cut off when the BGM ends, rather than when the flipnote ends. If the BGM is longer or the same length, then this works fine.

Simply removing the -shortest flag creates the opposite problem, where it works fine if the BGM is shorter or the same length as the flipnote, but if the BGM track is longer than the flipnote, then the video doesn't get appropriately trimmed and the end becomes somewhat glitched.

I think the ffmpeg encode duration for this step needs to be locked to the duration of the flipnote, rather than dependent on the length of the BGM.

@pbsds
Copy link
Owner

pbsds commented Nov 3, 2020

perhaps padding the bgm with zeros could be a solution

@wyntrr-end
Copy link
Contributor Author

perhaps padding the bgm with zeros could be a solution

not sure how that would work, as i'm not super familiar with dealing with audio.

it seems however that ffmpeg allows for specifying how long the output file should be, so if we pass it the -t argument followed by the duration of the flipnote in seconds (not sure if this is already calculated in the script, but is pretty simple to calculate using the number of frames and the calculated framerate), that should work

@pbsds
Copy link
Owner

pbsds commented Nov 6, 2020

Try this change.

@wyntrr-end
Copy link
Contributor Author

wyntrr-end commented Nov 18, 2020

@pbsds Sorry it took so long to respond. That change seems to work, but perhaps something like this might be more elegant? ffmpeg has an option to specify how long the output file should be, and you've already got the necessary information to calculate the appropriate duration.

@pbsds
Copy link
Owner

pbsds commented Nov 18, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants