问题
I am hoping to find a way to write generated video (non-real time) from Python and mix it with external audio file (MP3) simultaneously.
What's the current status of GStreamer Python bindings, are they up-to-date?
Would it be possible to write MPEG-4 output with GStreamer and feed raw image frames from Python
Is it possible to construct pipeline so that GStreamer would also read MP3 audio and mix it into the container, so that I do not need to reprocess the resulting video track with ffmpeg etc. external tools to have the audio track
Are there any up-to-date tutorials for using GStreamer with Python? (I couldn't find anything dated since 2006-2009)
(my old question: did not really give good pointers Writing video with OpenCV + Python + Mac )
回答1:
Whether or not the binding are "up-to-date" really depends on what version of Python you're using. As for Python 2.7, I am using GStreamer without incident.
I have been fighting a major bug in developing with Python 2.7 and GStreamer on Windows 7 (WinBuilds installers), but I'm able to work with GStreamer just fine on Ubuntu.
GStreamer does have mp3 codecs, but there are some legal matters surrounding their legality in some countries. I'd do a Google search on that before using them.
As for tutorials, no luck. All the same, the existing tutorials do quite well for the modern version, especially this one and this one.
In regards to writing MPEG-4 output and feeding raw images, I do not know. That would be a good stand-alone question, in all honesty.
来源:https://stackoverflow.com/questions/6963302/gstreamer-status-of-python-bindings-and-encoding-video-with-mixed-audio