Extracting Video Clip to file
Posted: 29 Apr 2014 18:16
I am fairly new to LibVLC development, and I am sure this topic has come up before, but I am creating a custom video player using LibVLC (v2.1.3).
I am trying to create an interface that allows users to extract a portion of a video, and save it to a file. I have been able to sucessfully save video to a file by instantiating a new media and player instance with a file output type. My problem is that I usually want to start the file output sometime after the start of the original video, and stop it before the end of the original video with at least a few seconds of accuracy. It appears that the position and time of the media player can only be set when it is playing. So I have to start the media player playing, set the position, and monitor the position until it reaches the desired stop position. This has the fundamental flaw that it likely writes a few frames to the file before I can set the player to the desired starting position. Is there any way to position the media player to a desired position before outputting the video to file?
I am trying to create an interface that allows users to extract a portion of a video, and save it to a file. I have been able to sucessfully save video to a file by instantiating a new media and player instance with a file output type. My problem is that I usually want to start the file output sometime after the start of the original video, and stop it before the end of the original video with at least a few seconds of accuracy. It appears that the position and time of the media player can only be set when it is playing. So I have to start the media player playing, set the position, and monitor the position until it reaches the desired stop position. This has the fundamental flaw that it likely writes a few frames to the file before I can set the player to the desired starting position. Is there any way to position the media player to a desired position before outputting the video to file?