Best approach to detect if URI exist

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Best approach to detect if URI exist

Jack
Hello,

What is the best approach to detect if URI exist with Gstreamer and
Python (or command line), for http://... or file://... ?
The idea is to detect if the URI exists before to build (and insert in
the pipeline) a Bin containing the uridecodebin element.
Thanx!
++

Jack

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Best approach to detect if URI exist

Arjen Veenhuizen
I would use python's `urllib2` or the like to check the URL for anything
other than 200 OK before feeding the URL to gstreamer. For local files, you
could use os.path.exists().



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Best approach to detect if URI exist

Jack
Hello Arjen,

Thanks for your answer.
I was more thinking about a tool from Gstreamer but it is quite simple
and make sense to use standard module to test if a URL or file exist.
++

Jack



Le 11/09/2019 à 09:15, Arjen Veenhuizen a écrit :

> I would use python's `urllib2` or the like to check the URL for anything
> other than 200 OK before feeding the URL to gstreamer. For local files, you
> could use os.path.exists().
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Best approach to detect if URI exist

Jack
For people who want to use gstreamer tools in Python program, there is
GstPbutils.Discoverer().
++

Jack



Le 11/09/2019 à 16:44, Jack a écrit :

> Hello Arjen,
>
> Thanks for your answer.
> I was more thinking about a tool from Gstreamer but it is quite simple
> and make sense to use standard module to test if a URL or file exist.
> ++
>
> Jack
>
>
>
> Le 11/09/2019 à 09:15, Arjen Veenhuizen a écrit :
>> I would use python's `urllib2` or the like to check the URL for anything
>> other than 200 OK before feeding the URL to gstreamer. For local files, you
>> could use os.path.exists().
>>
>>
>>
>> --
>> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel