Getting file information

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

Getting file information

Albert Costa
Hi All,
a simple question, yet I haven't found how to achieve this: how can I retrieve information on the file I'm playing in my main loop?
I create my pipeline with just a filesrc, decodebin, ffmpegcolorspace and directdrawsink. I do connect a callback on the decodebin 'new-decoded-pad' signal, and that's all fine, I can play my video file.
But how can I retrieve the (width, height, framerate) inside my main loop? If I check the structure of the caps in the new-decoded-pad callback, there is no such properties...
Regards,
Al


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Getting file information

Ruben Gonzalez Uvigo
On Lunes 02 Marzo 2009 13:09:42 Albert Costa wrote:
Yuo can use gst.extend.discoverer

A python example:



import sys

import gobject
gobject.threads_init()

import pygst
pygst.require('0.10')
import gst
from gst.extend.discoverer import Discoverer


#
# NECESITA RELOJ PARA FUNCIONAR
#
def on_discovered(discoverer, ismedia, infile):
    print '\non_discovered:', infile
    discoverer.print_info()


if __name__ == '__main__':
    if len(sys.argv) >= 2:
        print 'ANALIZO: %s ' % sys.argv[0]
        discoverer = Discoverer(sys.argv[1])
        discoverer.connect('discovered', on_discovered, sys.argv[1])

        # The MainLoop
        mainloop = gobject.MainLoop()
        gobject.idle_add(discoverer.discover)
        mainloop.run()

    else:
        print 'Usage: %s <input_file>' % sys.argv[0]





> Hi All,
> a simple question, yet I haven't found how to achieve this: how can I retrieve information on the file I'm playing in my main loop?
> I create my pipeline with just a filesrc, decodebin, ffmpegcolorspace and directdrawsink. I do connect a callback on the decodebin 'new-decoded-pad' signal, and that's all fine, I can play my video file.
> But how can I retrieve the (width, height, framerate) inside my main loop? If I check the structure of the caps in the new-decoded-pad callback, there is no such properties...
> Regards,
> Al
>
>
>      




--
Un saludo
Ruben Gonzalez Gonzalez
[hidden email]

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel