command-line interface

Bug #507284 reported by hva
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenShot Video Editor
Fix Released
Medium
Unassigned

Bug Description

I've coded a command-line openshot renderer.
It takes an osp openshot project file as input and renders it according to options given in command.
(it defaults to mpeg4 avi video, 5 Mb/s, with libmp3lame as audio codec, 2 channels, 48000 as sample-rate and 128 kb/s as audio bitrate)
if no output file name or folder is given as option, then user openshot dir is used, and the default output file is called temp.
The command-line version can be very useful for batch-rendering of large or multiple project files, as it can be used in a bash script, or used in a remote server with no graphical interface.
The command-line part is self-contained, as it doesn't alter any existing openshot source files, and it doens't load any gtk.
An ascii progressbar is displayed to console while rendering, showing completed percentage.
I've tested it with several project files, and seems to work.

the branch is:

lp:~francesco-hermanitosverdes/openshot/hv_francesco

Tags: patch
Changed in openshot:
status: New → Fix Committed
Revision history for this message
hva (francesco-hermanitosverdes) wrote :

this is the patch for the last version of command-line osp renderer

Changed in openshot:
milestone: none → 1.1.0
Changed in openshot:
importance: Undecided → Medium
Revision history for this message
Jonathan Thomas (jonoomph) wrote :

This has been added to the trunk. Thanks!

Revision history for this message
Dan Dennedy (dan-dennedy) wrote :

If you can offer a MLT XML export, then one can render with melt, the official command utility of MLT, use the project with the Melted video server, and open the project as a clip in Kdenlive.

Revision history for this message
hva (francesco-hermanitosverdes) wrote :

good idea Dan!
I've added a preliminary implementation of MLT XML export feature.
It exports a mlt-xml in project folder, using project name and .xml extension

It can be further enhanced letting the user to choose a file name and destination folder.

the branch is here

lp:~francesco-hermanitosverdes/openshot/francesco

patch attached

Revision history for this message
hva (francesco-hermanitosverdes) wrote :

for the people that don't know it yet, you can then render the file using melt
To play it with the default SDL PAL consumer, usage then would be:

melt xml:/path_to_project_folder/project_name.xml

This opens very interesting possibilities indeed in my opinion...

Revision history for this message
hva (francesco-hermanitosverdes) wrote :

I was trying to improve human-readibility of XML file, but seems that xml.dom.minidom prettyfication breaks xml output in some way that makes it unreadable for MLT (melt segfaults when feeded such a file).
Must be something with newline or indent, don't know.
Jonhatan, had you already tested it?

Revision history for this message
hva (francesco-hermanitosverdes) wrote :

ok, now I'm rather sure that it is a MLT bug in parsing xml files:
If content of a property tag goes to a new line (as it is produced by xml.dom.minidom), melt segfaults, though it is perfectly valid XML.
I include two sample files, containing same XML, both valid, but one works with MLT, the other does not.

Revision history for this message
hva (francesco-hermanitosverdes) wrote :

beautified XML output in order to make it more human-friendly.
Had to substitute xml.dom.minidom writexml() function
in order to avoid extra new-lines inside property tags and produce
a XML that can be parsed correctly by MLT

Revision history for this message
hva (francesco-hermanitosverdes) wrote :

I had forgotten to credit the original authors of the the hack to fix minidom writexml function,
I have adapted some code taken from here:

http://www.gamedev.net/community/forums/topic.asp?topic_id=497185
http://ronrothman.com/public/leftbraned/xml-dom-minidom-toprettyxml-and-silly-whitespace/

moimael (moimael)
Changed in openshot:
status: Fix Committed → Fix Released
tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.