brunoherbelin / vimix

Live Video Mixer
GNU General Public License v3.0
260 stars 25 forks source link

Recorded video shorter than real time #38

Closed orningi89 closed 2 years ago

orningi89 commented 3 years ago

Hi, I've noticed that when I record my vimix session the video recording is shorter than it was in actuality. This was also an issue in GLMixer, which I came across when doing live visuals to a concert. Problem occurs when trying to fit the video from the performance to the recorded music, the video is considerably shorter. I suspect that it has something to do with the FPS, do you have any advice or if there's a way to fix this?

Thank you!

brunoherbelin commented 3 years ago

Thanks for the comment. Real-time encoding is tricky as it is quite hungry in CPU resources and competes with the other processes for decoding and mixing; it can happen that some frames are skipped on the way (if encoder gets too far behind the real time).

By default, continuous play speed was prioritized when encoding (30fps stable, therefore a recording with less frames is shorter in time), but indeed it should be possible to impose the actual timing of the frames at encoding (but then, leading to a non-constant fps video). I'll check if that can be done.

Also, you can try to improve the encoding speed by selecting a more appropriate encoder and a lower resolution. What is your computer configuration and which options did u use?

prez commented 2 years ago

It's really frustrating that there's no indication that the recording has in reality already stopped. For example, I have recorded 20 minutes of footage, but the actual file was only 51 seconds long. At least a pop-up or error message would be nice to have.

In my experience, capturing the output window (for example with OBS on Xorg) is currently the only way to record vimix output reliably. The v4l2 code apparently has some issues, because the output freezes after a short time, and the recording to file feature is broken.

brunoherbelin commented 2 years ago

Thanks for the feedback! For sure unexpected interruptions of recording should show a warning signal; I'll make sure to add more monitoring about the recording.

Please add details on the OS and version of vimix to make sure I target the right code.

prez commented 2 years ago

Thank you! I am on master, using Void Linux. Here's the build template I made for the latest tag (not yet merged into the repositories as a package, PR submitted): https://github.com/void-linux/void-packages/blob/4fd924de540b8d8830641f8f9b5a5a92008a1613/srcpkgs/vimix/template I hope I got all the dependencies right, as that could be a cause of some errors.

Please let me know if I can provide any other information, I'd love to help.

Offtopic: vimix currently doesn't seem to build on musl libc. It would be great if that was supported too.

brunoherbelin commented 2 years ago

Please check with version 0.6.1.

The recorder now has two modes for dealing with delays when encoding: in 'Clock' priority (in settings panel), the exact duration of the recording is always respected (in this case, the frames that the computer does not have time to encode are ignored, and the framerate is not guaranteed).

Regaring other packaging, I am looking at https://appimage.org/ : that could be an alternative.