Re: Conduit & iPod Module - Last Report



Hi,

1) Can this actually read metadata correctly? I couldn't get it to work, and there are no tests to confirm it. This test script seems to hang forever

import gtk
import gobject
import conduit.datatypes.Audio as a

def foo(i):
    print i.get_audio_duration()
    print i.get_audio_artist()

song = a.Audio('/home/john/Music/Machine 15/01-millencolin-machine_15.mp3')

gobject.timeout_add(500, foo, song)
gtk.main()

Just what John Carr said. This code needs to run inside a thread to work. Take a look at TestCoreConvertAudioVideo.py, it has just the same problems.
Something like this at the end could work:
def idle_cb():
    threading.Thread(target=convert).start()

mainloop = gobject.MainLoop()
gobject.idle_add(idle_cb)
mainloop.run()

I'll try to write some tests for it. I just noticed the Video code wasnt working (I never used it anywhere, but them I started to use in the GStreamer conversion and noticed the problems).
 


2) Does the following fixme still apply?
        # FIXME: Using Discoverer for now, but we should switch to utils.GstMetadata

Yes. However, the GstMetadata code was borrowed from Elisa, and I only worked with it until I found the Discoverer class. The advantage of the GstMetadata code is that it could create thumbnails (if worked further), while with the Discoverer class it would be hard to add support for it. But the Discoverer code was much more well-tested, while the GstMetadata code was just hacked to work within Conduit. There is a lot more work left to integrate it completely with Conduit.

I made some changes and fixes in my code. I was able to make the Gstreamer conversion process cancellable, but it is only a short-term solution. I had a discussion with John Carr, and it seems the conversion process needs some changes to allow more control over it (this is included in the work needed in the threads system). For now, when it reports the progress every few seconds it also checks if it was cancelled.
I'm trying to make it not convert video files that are already supported. It will work for the iPod module, but not very well for other modules, such as the N800, because there is only one encoding passed to the converter, so it cant know if the file would be supported in another encoding (the iPod only accepts mp4 files so this is not a problem).
I've been testing the two-pass encoding code. It doesnt work as expected, but I think it is a GStreamer problem. For some reason, there is no signal when the first pass ends, so it hangs forever at the end.

And I just checked the bzr-mirror in Launchpad, and the bzr-playground in Gnome, and it seems they are not updated. I'll probably merge with my branch later, but it wont get the latest updates in the Gnome SVN. I could merge my changes to the SVN code and merge it directly with the Gnome SVN (I have a Gnome SVN account). Is that ok?

--
Alexandre Rosenfeld

EngComp 06 - USP São Carlos


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]