Looping (part of) video using LibVLC
Posted: 26 Jan 2011 10:38
Hello,
I am looking for a nice way to loop video, or a part of a video using LibVLC.
What I did until now, was call play again, as soon as the status was libvlc_ended. This pauses the video for a few ms, while vlc starts to play again.
Then there's also the options
Another option would be for me to count the frames myself, and then do a seek when needed, but this is not so easy (also because the length reported by media_get_length for video files is often less than what player_get_position returns when reaching the end of the video file. I suppose this is a bug, but working around that is not easy, obviously).
Anyway, I am just searching for the best option to implement seamless looping. Any ideas are welcome.
I am looking for a nice way to loop video, or a part of a video using LibVLC.
What I did until now, was call play again, as soon as the status was libvlc_ended. This pauses the video for a few ms, while vlc starts to play again.
Then there's also the options
- --input-repeat=
- --start-time=
- --stop-time=
- --run-time= (I don't really know what this does yet)
Another option would be for me to count the frames myself, and then do a seek when needed, but this is not so easy (also because the length reported by media_get_length for video files is often less than what player_get_position returns when reaching the end of the video file. I suppose this is a bug, but working around that is not easy, obviously).
Anyway, I am just searching for the best option to implement seamless looping. Any ideas are welcome.