Why can't I replay the same video twice with python?

Dimitrios Katsaros patcherwork at gmail.com
Thu Feb 9 15:45:22 UTC 2017


I think we need a bit more information before figuring this out.

Have you tried running and stopping a single pipeline?
What happens when you stop one video? Does the recording stop
or continue playing?
Are you sure the callbacks for the keys are working after launching the
pipeline?
If you are running g-main_loop on your main thread it may be blocking the
callbacks for
key events?

Dimitrios

On Wed, Feb 8, 2017 at 3:39 PM, Michael Yarochkin <
michael.yarochkin at timetronics.be> wrote:

> Hello,
>
>
> Don`t you need to use
>
> p1.set_state(Gst.State.PAUSED)
>
>
> Just a guess. I can be wrong.
>
>
> Mikl
> ------------------------------
> *From:* gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org>
> on behalf of whoman at gmail.com <whoman at gmail.com>
> *Sent:* Tuesday, January 10, 2017 7:27:59 PM
> *To:* gstreamer-devel at lists.freedesktop.org
> *Subject:* Why can't I replay the same video twice with python?
>
> Hello,
> I want to play 3 video files, like a piano.
>
> I have it working, however it will only play each video one time...
> 2nd time I press any of the 3 keys, the video does not start playing
> again.
> No error messages returned.  GST acts as if it's doing everything as
> expected.
>
> I'm using python....  Here's the pertinent parts of my code:
>
> p1 = Gst.parse_launch ("filesrc location=file1.mp4 ! qtdemux !
> h264parse ! vaapidecodebin ! videoconvert ! vaapisink
> fullscreen=true")
> p2 = Gst.parse_launch ("filesrc location=file2.mp4 ! qtdemux !
> h264parse ! vaapidecodebin ! videoconvert ! vaapisink
> fullscreen=true")
> p3 = Gst.parse_launch ("filesrc location=file3.mp4 ! qtdemux !
> h264parse ! vaapidecodebin ! videoconvert ! vaapisink
> fullscreen=true")
>
> def StopAllPipelines():
>     #Stop all other pipelines
>     p1.set_state(Gst.State.NULL)
>     p2.set_state(Gst.State.NULL)
>     p3.set_state(Gst.State.NULL)
>
> def PlayVideo1():
>     StopAllPipelines()
>     p1.set_state(Gst.State.PLAYING)
>
> def PlayVideo2():
>     StopAllPipelines()
>     p1.set_state(Gst.State.PLAYING)
>
> def PlayVideo3():
>     StopAllPipelines()
>     p1.set_state(Gst.State.PLAYING)
>
> I've tried deleting the pipeline variable references (p1 p2 and p3)
> and then recreating them, same result.
> I've tried setting p1 p2 and p3 to "None" and then recreating them, same
> result.
>
> The only thing I can think is that there's some kind of async issue,
> where my PlayVideo1() functions aren't waiting for StopAllPipelines()
> to finish, before trying to set the p1 state to PLAYING?
> I tried inserting a "p1.get_state(1)" in between, same result.
> Perhaps there's more that needs to be done between setting the states
> to NULL, then back to PLAYING
>
> Any ideas?
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170209/f0c77d6c/attachment.html>


More information about the gstreamer-devel mailing list