2013-02-25, 23:41
Hi dev's,
I'm trying to implement a new class CGUIVideoBackground to enable skins to play a video loop in the background. As a proof of concept this more or less works and I find the effect really beautiful.
There is however one thing that is not so beautiful and that is the fact that the video loop is not seamless. When the video restarts, for a very brief, but very noticable moment the background becomes black. At first I thought it was something with my code (which basically is a stripped version of the CApplication:layFile() function) so I decided to do a small test and copy the video that I use 3 times and rename the files such that they appear as a single stacked video in XBMC.
I then noticed that unfortunately, this stacked video also shows the black background when it moves from one video in the stack to the next. For normal stacked videos this does not seem to be a problem because they get cut at the end of a scene and you don't really notice it.
Basically, I'm looking for some hints and tips to overcome this limitation. I was thinking about introducing a new URI in CDVDFactoryInputStream::CreateInputStream() called 'loop://'. When encountered this would then instantiate a CDVDInputStreamFileLoop object. The CDVDInputStreamFileLoop class would be derived from CDVDInputStreamFile and would when the end of the video file is reached simply seek to the beginning of the file.
Now I'm wondering whether or not this is the right approach, or if there are better solutions.
Edit: Updated title, was "Seamless playback of video loop?"
I'm trying to implement a new class CGUIVideoBackground to enable skins to play a video loop in the background. As a proof of concept this more or less works and I find the effect really beautiful.
There is however one thing that is not so beautiful and that is the fact that the video loop is not seamless. When the video restarts, for a very brief, but very noticable moment the background becomes black. At first I thought it was something with my code (which basically is a stripped version of the CApplication:layFile() function) so I decided to do a small test and copy the video that I use 3 times and rename the files such that they appear as a single stacked video in XBMC.
I then noticed that unfortunately, this stacked video also shows the black background when it moves from one video in the stack to the next. For normal stacked videos this does not seem to be a problem because they get cut at the end of a scene and you don't really notice it.
Basically, I'm looking for some hints and tips to overcome this limitation. I was thinking about introducing a new URI in CDVDFactoryInputStream::CreateInputStream() called 'loop://'. When encountered this would then instantiate a CDVDInputStreamFileLoop object. The CDVDInputStreamFileLoop class would be derived from CDVDInputStreamFile and would when the end of the video file is reached simply seek to the beginning of the file.
Now I'm wondering whether or not this is the right approach, or if there are better solutions.
Edit: Updated title, was "Seamless playback of video loop?"