brunoherbelin / vimix

Live Video Mixer
GNU General Public License v3.0
277 stars 26 forks source link

pinpong loop bug in Ubuntu #117

Open MoorPoor opened 9 months ago

MoorPoor commented 9 months ago

Pingpong loop is not working anymore for me at ubuntu 23.10 with nvidia card and flatpak beta (same in stable) it sticks to the end and is not playing backwards. grafik

While I'm at it, would it be possible to add another curve (just another colour?) for the playback speed so that it could be changed as the opacity? the playhead would then slow down or speed up. I can imagine that's a problem, but it would be fantastic!

MoorPoor commented 9 months ago

That doesn't belong here, but since it just occurred to me, alpha lumakey has a problem with the opacity fading in and out Peek 2023-12-19 14-01

brunoherbelin commented 9 months ago

That doesn't belong here, but since it just occurred to me, alpha lumakey has a problem with the opacity fading in and out

Indeed, that was the expected behavior considering the fading operates a fade to black, and the lumakey is making the transparency by color...

So, and because this was under the hood but never requested, I added a mode for fading the alpha instead of the color in the media player :

image

Then, the lumakey code was fixed to take this change into account and you should now have the effect you expected. You can check it in Beta e8daeb5f30fa949871f85ce63ace149649e973fc

brunoherbelin commented 9 months ago

Pingpong loop is not working anymore

yes indeed, same here... probably something changed in gstreamer :disappointed:

But should be fixed now ! You can check if it works in Beta a529b34f99ba1174620aab77bd51425022abdd48

MoorPoor commented 8 months ago

Hei! in the latest install in 0.8.2b-3 the pingpong bug is still there, just changed a bit. sorry for asking: the snap edge version is the beta version? or I need to compile if you ask for beta testing? Thanks!

brunoherbelin commented 8 months ago

Arg :disappointed: ...

I tested with snap and with flatpak releases (0.8.2b) and the bouncing works fine here on Ubuntu 23.10.

One thing which might prevent gstreamer from playing a video backward is the hardware decoder on your machine: did you try forcing software decoder for that video?

image

Thanks for indicating the codec of the video that causes problem, and trying a video with another codec.

MoorPoor commented 8 months ago

I just noticed that apple pro-res is pingponging well. it is anyway in software rendering. mp4 files still not play backwards even in software rendering - at my machine ubuntu 23.10 snap version

brunoherbelin commented 8 months ago

Thanks for your tenacity on this ! I could replicate the problem with some specific videos: I think (almost sure) that the problem is caused by the absence of a keyframe next to the end of the video where it shall bounce: it jumps back and forth between keyframes at timestamps that are invalid.

First, two potential solutions for you;

A. Reencode your video:

ffmpeg -i input.mp4  -g 1 output.mp4

Running this on your input video will re-encode the video with every frame as a key frame, and this should make the backward playing and bouncing work without problem. NB: this would be adapted to short duration videos, which I suspect is what you have.

B. Cut the video segment before the end;

image

Using the timeline cissors, remove the end few frames (right dark area in timeline above)

Second, now that I have a lead to the understanding of the problem, I might find a workaround and will let you know !

brunoherbelin commented 8 months ago

quick follow-up : bug should be fixed in Beta f8b5b1db9c782837d22386446488d133696e468a

If you can try the Beta version, thanks for indicating if this solves your problem.

lupin3rd commented 8 months ago

Hi Bruno and MoorPoor, i notice the same problem with bounce. I confirm that with reencoded video (keyframe in every frame) all works fine also with nvidia and hardware decode. Then solution is only to reencode videos? or Vimix can do somethink when load videos?

Important: this problem care also seek and play speed. If we use OSC to control those values with have a lot of problem and jumps... with keyframe in all frame all works very fine and it's fluid.... I think that if we want to works fine with videos we need all key frames :-)

brunoherbelin commented 8 months ago

Well, the problem should be fixed, and bouncing should work on any videos (at least on videos I tested using latest with Beta). But indeed, no video decoder can do miracles, so a good video file with lots of key-frames is best for smooth playback!

I checked with gstreamer (instead of ffmpeg) to do a re-encoding and to add a 're-encode video' option in vimix. Should be doable: would that be useful?

lupin3rd commented 8 months ago

I tested last beta, my H264 videos have a lot of problem with bounce :-( The only solution is to re-encode. The option to add a re-encoded video is useful because people don't read issue's discussions or documentation :-) Not for us.