-
Notifications
You must be signed in to change notification settings - Fork 110
Migrate to GStreamer 1.0 #407
base: master
Are you sure you want to change the base?
Conversation
Biskelion
commented
Oct 25, 2013
- As per issue Porting to GStreamer 1.0 and PyGObject #308 I am going to migrate the code over to GStreamer 1.0
- This branch will incrementally help move the program over to GStreamer 1.0 but currently the Windows port of PyGo is incomplete, as well as the included GStreamer 1.0.5 implementation is missing 2 key video sinks. GStreamer 1.0.5 is missing "dshowvideosrc" #408 GStreamer 1.0.5 is missing "dx9screencapsrc" #409
- If successful this port will work on Linux but will not work under Windows
- As per GStreamer 1.x is currently missing the "GstPropertyProbe interface" #410 FreeSeer will not have the ability to list devices. EX you can't select a USB Src
This reverts commit 7ddd9c2.
- This commit is pretty much so that the project can see this migration in progress. It will is all likeliness be squashed later. - Having limited the functionality of this migration to; working in Linux, and Windows using the test source, I am starting to make so actual progress. - Up to this point the project builds without errors, in Windows, and if you select the test source as the source it will play. Unfortunately currently GStreamer opens its own window for the preview instead of painting it in FreeSeer - I would pretty much assume this will fail Travis
-In windows anyway, linux is still not tested -I didn't think multimedia.py line 310-318 were being called. So having replaced every single part of the pipe line (and then put them back) this road block came down to the .link_pads call. It caused the pipe to freeze. - I accidently copied plugin.py into the usbsrc last commit, I am deleting in this commit.
- The audio test signal is now combined and recorded to ogg - FYI the name of the source from a tee element has change from "src%d" to "src_%u" - The audio portion now has 2 queues, one on its input and one on its output - All meta tagging is still commented out - Linux is still on the todo list
- Using the auto audio source causes python in Windows to lock up - I've used a system detection guard, if you're in Windows it will just sub in the autiotestsrc -Autoaudiosource is in the current version of GST for Windows so I don't know why it locks up -This has not been tested in Linux
-I jumped the gun and hadn't saved my changes for the OS guard
-The code for creating the audio elements is taken from the Ogg plugin, it was mostly the same anyway. -Not tested on Linux
- This works in both Linux and Windows
- The test source can be combined with either the USB or test video source. - The USB source seems to stall on recording for both the audio and the video, it seems like it is buffering somewhere. I do not know if this is an actual problem, or a "feature" of the virtual machine I am running linux in.
- Currently there is only two types of tag that we are using, gchararrays and one gdate. - Tagging is very different in GST 1.0 than under 0.1. There are no examples I can find of anyone using it in Python yet. - This has been tested in Windows, not Linux yet
-I am not sure that the WebM format can take tagging? -I tested a clean version of FreeSeer, aka one I have not been editing, and did not get any meta tags when recording to webM
- Also some minor code clean up -Works in Windows and Linux
-I am not sure what the error is caused by but I've added a pipeline and comments in the code that explain the problem.
self.videocolourComboBox.addItem("video/x-raw-rgb") | ||
self.videocolourComboBox.addItem("video/x-raw-yuv") | ||
self.videocolourComboBox.addItem("video/x-raw") | ||
self.videocolourComboBox.addItem("video/x-raw") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this change?
Are the colour profiles no longer valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's only 1 option I don't understand why this is still even an option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said in another comment, I guess in the new GStreamer video/x-raw is now the base and a new field "format" represents colour. So this combo box configuration should now be repurposed to configure the new format field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, there is no need for a drop down box if it is only going to give you one option. When I passed through this section of code I was in a "get things working" frame of mind and less in a "how things should probably end up working" mind set. I was hoping to get back to code like this and clean it up but instead ended up running out of time.
The color format, from what I understand, is now set in this line:
videorate_cap.set_property("caps",
Gst.caps_from_string("%s, framerate=%d/1, format=Y444" % (self.input_type, self.framerate)))
in the init.py file. I have it hard set to Y444 for now, but that drop box should be repurposed to change that.
.
Did a bit of testing today. videotestsrc seems to work. USBSrc works but freezes immediately once it starts recording with no error. DesktopSrc does not work, instead throws this error: 2013-12-01 10:22:44,143 ( ERROR) freeseer.framework.multimedia : Internal data flow error.gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstBin:bin4/GstXImageSrc:videosrc: streaming task paused, reason not-linked (-1) Ogg output plugin works. As for audio plugins, my microphone isn't working so I couldn't test them other than the Test audio source. One thing of note is the audio plugins didn't crash at least and the video was recorded so I guess something was working. |
|
||
audiosrc = gst.element_factory_make("autoaudiosrc", "audiosrc") | ||
elif sys.platform in ["win32", "cygwin"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why you need to do this. If the plugin doesn't support windows then just remove it from the "os" list on line 41. The os variable represents what OSes this plugin supports and Freeseer will automatically filter the plugin out when someone tries to run it on an unsupported OS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned in IRC my thinking was along the lines of, I knew that it didn't work currently but that it would probably be supported in an upcoming version of Gst so that it would a simple matter of just deleting the added code to allow Windows to use an audio source once the feature was implemented.
I didn't think at this point that this would be a functional product that I'd be delivering but one that could be built upon in the future.
- As per the comments related to this feature I have changed the drop down box in the GUI to give you the option of selecting the, Y444, RGBx, or YVYU, color formats. It does not make much sense to have a drop box with two options that are the same. - I had originally selected Y444 because it was the format used in an example from Novacut (http://bazaar.launchpad.net/~jderose/+junk/gst-examples/view/head:/transcoder-1.0) - There is a long list of possible video formats that I found here: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-videotestsrc.html - It is a simple process to change the color format and if the desired format is not implemented it just needs to be added in widget.py - The 3 I have coded work with the test source in Windows
@Biskelion is there anything left you're working on here, or should we start looking at merging this? |
Well there are lots of things left to work on, more so once I found that a much more recent version of PyGObject had come out for windows at the end of November. It now includes all the way up to Gst 1.2 and considerably more sinks are implemented. But I am off to Australia for 3 weeks so I won't be able to putter away at it until the new year. If you guys aren't in any serious hurry I wouldn't mind putting some more work into this in the new year. However if you'd like to take over migrating over to Gst 1.X then feel free to close the issue and continue working on this code. Either way let me know, I am happy to keep helping but I am also happy to let you take over. |
We'll leave it open and unmerged so you can continue to make changes whenever you're ready. Enjoy Australia! |