Sorry, but you have a very naive idea on how frames are rendered in VLC.

...yes, I'm not a VLC dev, so I have no idea how frames are rendered. BUT I can imagine: you "somehow" decode the "frame" from all the file formats VLC supports, this part I don't care about...then you "draw" that frame to the screen, this part I do care about. As soon as you "draw" it to the screen, it might as well be a "screenshot"/"bitmap" (or other more compressed format, like png). That is what I'm saying: AFTER VLC's already decoded the frame, then save a copy to a buffer. Yes, I do know about "key frames", I do know that "not all frames are complete". But that's still simple: every keyframe, you start a new reference buffer frame: draw to screen, draw to a buffer (or draw only to the buffer & "copy" that to the screen {if copying is faster than "drawing" twice}). On the next frame, a non-keyframe, draw to screen (which properly covers the image already on screen), copy the last buffered frame to a new buffer & draw the partial frame on the copy of the buffer, so then the buffer would have a full "keyframe", for each frame. You can run the buffer (copy it to the screen) forwards or backwards (without seeking the original source), since they are essentially just images/screenshots now.
Patches are welcome though...
...I have nowhere to start. & I can't compile VLC. You said you had a patch that was "very very very very ugly", if you posted that online somewhere, people would have a "place to start". I'd like to see the method you chose that, even you, thought was very ugly.
Instead of telling me "you have a very naive idea on how frames are rendered in VLC"...I'd like you to tell me exactly why taking a "snapshot" of each rendered frame would NOT work. I think my idea is fine. Prove me wrong. No, I have no idea how VLC renders frames, but I'm talking about after it's on screen...or at least, after it's decoded & ready to be drawn. Once it's decoded & ready to be "drawn"...simply draw to the screen & also to a "frame buffer".
Other than not knowing how I should write it: I think my overall idea is sound. Think of it this way: if I played a video in VLC & stepped thru each frame, manually taking a snapshot of each frame...I'd have a directory full of full-frame snapshots (they would all be keyframes at this point). Then if I tell VLC to play that directory, it would appear to be a copy of the video (without sound, of course), in this case VLC could "frame backward", since each frame is a separate playlist item. So, in my "naive" way, that's all I'm suggesting: make VLC "do that" faster than a person could do manually. Make VLC either buffer each frame, as it's about to be drawn -- or simply draw to the screen & run the "snapshot" function, after each frame. Drawing the frames to the screen is already in VLC (duh). Taking a snapshot of the current frame is already in VLC. So, marry those 2.
Just to be clear, I am suggesting
2 different ways to solve this problem...
- BEFORE drawing to the screen, save a copy of what's about to be drawn to a buffer. Making sure each buffer is a full keyframe.
- AFTER drawing to the screen, run the built-in "snapshot" function (this option might be slower, but cannot not work)
"why the f*** do i need a google+ account to comment on a video?" — jawed (2013) (about YouTube's new requirement of Google+)
youtube.lua — Play YouTube videos in VLC!
Updated: Thu, Jan 15, 2015 --- 1/15/15, 7:19:19pm EST
forum.videolan.org/viewtopic.php?f=29&t=111977&p=379147#p379147
Sigh, the above can't be a link: "You cannot use certain BBCodes: [url]."...so, I can't even link back to a post on this forum?
How about this: can long-term/trusted users be allowed links in sigs?