kekeblom / StrayVisualizer

Visualize Data From Stray Scanner https://keke.dev/blog/2021/03/10/Stray-Scanner.html
MIT License
67 stars 11 forks source link

.mp4 encoding losing frames #3

Closed JonathonLuiten closed 3 years ago

JonathonLuiten commented 3 years ago

I have a recording which has 631 frames (depth, confidence, odometry, etc), however the .mp4 of coloured images only has 627 frames encoded. It is relatively common for FFPMEG to drop frames when encoding to .mp4 when using the -r flag and not the -vf flag. I think that's what's happening here, and it's encoding with a variable frame-rate and dropping frames (this is in fact what is happening here). This makes the mp4 not very useful for aligning the rgb and depth.

One solution is to change the ffmpeg command used for encoding to RGB

A better solution is to output the frames as images rather than video already.

Finally last point, it would be MUCH more convenient if files from the app could be exported (as zipped) to the 'files' app on ios and then we could simply click the zip and airdrop it over to the computer and not have to deal with itunes.

Hope this feedback is helpful.

Cheers, Jono

kekeblom commented 3 years ago

Thanks a lot for the feedback. I really appreciate it.

Sharing through the files app is a great idea and has come up with other users as well. I'm working to get it shipped in the next release. :+1:

Was not aware of the fact that the frame encoder might skip frames. That would indeed be a problem. Didn't observe this on my setup. I'll see if I can somehow guarantee it from not doing it, but if I can't do that, I might have to switch to encoding each frame as individual images instead of as a video.

kekeblom commented 3 years ago

Version 1.2 now guarantees encoding the video with a constant frame rate and since then, I haven't observed any dropped frames. Hope it works for you and thanks for reporting the problem!