From: yomguy Date: Thu, 13 Dec 2012 16:33:29 +0000 (+0100) Subject: init X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4a2cfa992a6d4845704f47bec85de4f5cefa4753;p=promaster.git init --- 4a2cfa992a6d4845704f47bec85de4f5cefa4753 diff --git a/auto_fade.py b/auto_fade.py new file mode 100644 index 0000000..6a0e639 --- /dev/null +++ b/auto_fade.py @@ -0,0 +1,10 @@ + +import sys +from kdenlive.fade import KdenliveAutoFade + +if __name__ == '__main__': + path_out = sys.argv[-1] + path_in = sys.argv[-2] + fade = KdenliveAutoFade() + fade.run(path_in, path_out) + diff --git a/kdenlive/__init__.py b/kdenlive/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/kdenlive/__init__.pyc b/kdenlive/__init__.pyc new file mode 100644 index 0000000..db4ccf1 Binary files /dev/null and b/kdenlive/__init__.pyc differ diff --git a/kdenlive/examples/Avec_Fade.kdenlive b/kdenlive/examples/Avec_Fade.kdenlive new file mode 100644 index 0000000..023ada1 --- /dev/null +++ b/kdenlive/examples/Avec_Fade.kdenlive @@ -0,0 +1,262 @@ + + + + + producer + 322768 + pause + black + 0 + colour + + + + + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + 1 + -1 + avformat + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + 1 + -1 + avformat + + + + + + 0 + 75 + 20dB + filter + volume + fadeout + volume + 1 + 1 + 0 + + + + + 0 + 75 + 20dB + filter + volume + fadein + volume + 1 + 0 + 1 + + + + + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + -1 + 0 + avformat + 24 + 1 + 24,000000 + 601 + 640 + 360 + 0 + 1 + + + + + + 0 + 1 + filter + brightness + fade_to_black + brightness + 1 + 0 + + + + + 0 + 0 + filter + brightness + fade_from_black + brightness + 1 + 1 + + + + + 1,000000 + + + + + + + + 1 + 2 + transition + mix + 1 + 1 + 237 + + + 1 + 3 + transition + mix + 1 + 1 + 237 + + + 1 + 4 + transition + mix + 1 + 1 + 237 + + + 1 + 5 + transition + mix + 1 + 1 + 237 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kdenlive/examples/Sans_Fade.kdenlive b/kdenlive/examples/Sans_Fade.kdenlive new file mode 100644 index 0000000..af3094e --- /dev/null +++ b/kdenlive/examples/Sans_Fade.kdenlive @@ -0,0 +1,214 @@ + + + + + producer + 322768 + pause + black + 0 + colour + + + + + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + 1 + -1 + avformat + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + 1 + -1 + avformat + + + + + + + + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + -1 + 0 + avformat + 24 + 1 + 24,000000 + 601 + 640 + 360 + 0 + 1 + + + + + + + + 1,000000 + + + + + + + + 1 + 2 + transition + mix + 1 + 1 + 237 + + + 1 + 3 + transition + mix + 1 + 1 + 237 + + + 1 + 4 + transition + mix + 1 + 1 + 237 + + + 1 + 5 + transition + mix + 1 + 1 + 237 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kdenlive/examples/avec_dict.diff b/kdenlive/examples/avec_dict.diff new file mode 100644 index 0000000..9a2376e --- /dev/null +++ b/kdenlive/examples/avec_dict.diff @@ -0,0 +1,141 @@ +--- sans_dict.txt 2012-12-13 14:33:47.457540336 +0100 ++++ avec_dict.txt 2012-12-13 14:33:15.634518355 +0100 +@@ -235,10 +235,70 @@ + {'attributes': {u'id': u'playlist2'}, + 'children': [{'attributes': {u'length': u'1138'}, 'name': 'blank'}, + {'attributes': {u'in': u'0', u'out': u'85261', u'producer': u'2_2_audio'}, ++ 'children': [{'attributes': {u'id': u'fadeout', ++ u'in': u'85259', ++ u'out': u'85261'}, ++ 'children': [{'attributes': {u'name': u'track'}, ++ 'cdata': '0', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'window'}, ++ 'cdata': '75', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'max_gain'}, ++ 'cdata': '20dB', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'mlt_type'}, ++ 'cdata': 'filter', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'mlt_service'}, ++ 'cdata': 'volume', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'kdenlive_id'}, ++ 'cdata': 'fadeout', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'tag'}, ++ 'cdata': 'volume', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'kdenlive_ix'}, ++ 'cdata': '1', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'gain'}, 'cdata': '1', 'name': 'property'}, ++ {'attributes': {u'name': u'end'}, 'cdata': '0', 'name': 'property'}], ++ 'name': 'filter'}], + 'name': 'entry'}, + {'attributes': {u'in': u'85323', + u'out': u'321690', + u'producer': u'2_3_audio'}, ++ 'children': [{'attributes': {u'id': u'fadein', ++ u'in': u'85323', ++ u'out': u'85325'}, ++ 'children': [{'attributes': {u'name': u'track'}, ++ 'cdata': '0', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'window'}, ++ 'cdata': '75', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'max_gain'}, ++ 'cdata': '20dB', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'mlt_type'}, ++ 'cdata': 'filter', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'mlt_service'}, ++ 'cdata': 'volume', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'kdenlive_id'}, ++ 'cdata': 'fadein', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'tag'}, ++ 'cdata': 'volume', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'kdenlive_ix'}, ++ 'cdata': '1', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'gain'}, 'cdata': '0', 'name': 'property'}, ++ {'attributes': {u'name': u'end'}, 'cdata': '1', 'name': 'property'}], ++ 'name': 'filter'}], + 'name': 'entry'}], + 'name': 'playlist'}, + {'attributes': {u'id': u'playlist3'}, 'name': 'playlist'}, +@@ -367,10 +427,58 @@ + {'attributes': {u'id': u'playlist5'}, + 'children': [{'attributes': {u'length': u'1138'}, 'name': 'blank'}, + {'attributes': {u'in': u'0', u'out': u'85261', u'producer': u'2_video'}, ++ 'children': [{'attributes': {u'id': u'fade_to_black', ++ u'in': u'85259', ++ u'out': u'85261'}, ++ 'children': [{'attributes': {u'name': u'track'}, ++ 'cdata': '0', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'start'}, 'cdata': '1', 'name': 'property'}, ++ {'attributes': {u'name': u'mlt_type'}, ++ 'cdata': 'filter', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'mlt_service'}, ++ 'cdata': 'brightness', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'kdenlive_id'}, ++ 'cdata': 'fade_to_black', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'tag'}, ++ 'cdata': 'brightness', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'kdenlive_ix'}, ++ 'cdata': '1', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'end'}, 'cdata': '0', 'name': 'property'}], ++ 'name': 'filter'}], + 'name': 'entry'}, + {'attributes': {u'in': u'85323', + u'out': u'321690', + u'producer': u'2_video'}, ++ 'children': [{'attributes': {u'id': u'fade_from_black', ++ u'in': u'85323', ++ u'out': u'85325'}, ++ 'children': [{'attributes': {u'name': u'track'}, ++ 'cdata': '0', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'start'}, 'cdata': '0', 'name': 'property'}, ++ {'attributes': {u'name': u'mlt_type'}, ++ 'cdata': 'filter', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'mlt_service'}, ++ 'cdata': 'brightness', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'kdenlive_id'}, ++ 'cdata': 'fade_from_black', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'tag'}, ++ 'cdata': 'brightness', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'kdenlive_ix'}, ++ 'cdata': '1', ++ 'name': 'property'}, ++ {'attributes': {u'name': u'end'}, 'cdata': '1', 'name': 'property'}], ++ 'name': 'filter'}], + 'name': 'entry'}], + 'name': 'playlist'}, + {'attributes': {u'global_feed': u'1', +@@ -482,7 +590,7 @@ + u'verticalzoom': u'1', + u'zonein': u'0', + u'zoneout': u'100', +- u'zoom': u'3'}, ++ u'zoom': u'13'}, + 'name': 'documentproperties'}, + {'name': 'documentnotes'}, + {'attributes': {u'description': u'HD 360p 24 fps', diff --git a/kdenlive/examples/avec_dict.txt b/kdenlive/examples/avec_dict.txt new file mode 100644 index 0000000..848ab53 --- /dev/null +++ b/kdenlive/examples/avec_dict.txt @@ -0,0 +1,674 @@ +{'attributes': {u'LC_NUMERIC': u'fr_FR.UTF-8', + u'root': u'/home/pre-barreau/Documents', + u'title': u'Anonymous Submission'}, + 'children': [{'attributes': {u'colorspace': u'709', + u'description': u'HD 360p 24 fps', + u'display_aspect_den': u'9', + u'display_aspect_num': u'16', + u'frame_rate_den': u'1', + u'frame_rate_num': u'24', + u'height': u'360', + u'progressive': u'1', + u'sample_aspect_den': u'1', + u'sample_aspect_num': u'1', + u'width': u'640'}, + 'name': 'profile'}, + {'attributes': {u'id': u'black', u'in': u'0', u'out': u'322767'}, + 'children': [{'attributes': {u'name': u'mlt_type'}, + 'cdata': 'producer', + 'name': 'property'}, + {'attributes': {u'name': u'length'}, + 'cdata': '322768', + 'name': 'property'}, + {'attributes': {u'name': u'eof'}, 'cdata': 'pause', 'name': 'property'}, + {'attributes': {u'name': u'resource'}, + 'cdata': 'black', + 'name': 'property'}, + {'attributes': {u'name': u'aspect_ratio'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'colour', + 'name': 'property'}], + 'name': 'producer'}, + {'attributes': {u'id': u'black_track'}, + 'children': [{'attributes': {u'in': u'0', + u'out': u'322767', + u'producer': u'black'}, + 'name': 'entry'}], + 'name': 'playlist'}, + {'attributes': {u'id': u'playlist1'}, 'name': 'playlist'}, + {'attributes': {u'id': u'2_2_audio', u'in': u'0', u'out': u'321690'}, + 'children': [{'attributes': {u'name': u'mlt_type'}, + 'cdata': 'producer', + 'name': 'property'}, + {'attributes': {u'name': u'length'}, + 'cdata': '321691', + 'name': 'property'}, + {'attributes': {u'name': u'eof'}, 'cdata': 'pause', 'name': 'property'}, + {'attributes': {u'name': u'resource'}, + 'cdata': '/home/pre-barreau/kdenlive/Droit priv\xc3\xa9 internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.nb_streams'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.type'}, + 'cdata': 'video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.sample_aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.pix_fmt'}, + 'cdata': 'yuv420p', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.sample_aspect_ratio'}, + 'cdata': '0,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.colorspace'}, + 'cdata': '601', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.name'}, + 'cdata': 'vp8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.long_name'}, + 'cdata': 'On2 VP8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.title.markup'}, + 'cdata': 'Video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.stream.type'}, + 'cdata': 'audio', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_fmt'}, + 'cdata': 's16', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_rate'}, + 'cdata': '48000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.channels'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.name'}, + 'cdata': 'vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.long_name'}, + 'cdata': 'Vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.title.markup'}, + 'cdata': 'Audio', + 'name': 'property'}, + {'attributes': {u'name': u'seekable'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_num'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_den'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'audio_index'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'video_index'}, + 'cdata': '-1', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'avformat', + 'name': 'property'}], + 'name': 'producer'}, + {'attributes': {u'id': u'2_3_audio', u'in': u'0', u'out': u'321690'}, + 'children': [{'attributes': {u'name': u'mlt_type'}, + 'cdata': 'producer', + 'name': 'property'}, + {'attributes': {u'name': u'length'}, + 'cdata': '321691', + 'name': 'property'}, + {'attributes': {u'name': u'eof'}, 'cdata': 'pause', 'name': 'property'}, + {'attributes': {u'name': u'resource'}, + 'cdata': '/home/pre-barreau/kdenlive/Droit priv\xc3\xa9 internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.nb_streams'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.type'}, + 'cdata': 'video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.sample_aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.pix_fmt'}, + 'cdata': 'yuv420p', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.sample_aspect_ratio'}, + 'cdata': '0,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.colorspace'}, + 'cdata': '601', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.name'}, + 'cdata': 'vp8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.long_name'}, + 'cdata': 'On2 VP8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.title.markup'}, + 'cdata': 'Video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.stream.type'}, + 'cdata': 'audio', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_fmt'}, + 'cdata': 's16', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_rate'}, + 'cdata': '48000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.channels'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.name'}, + 'cdata': 'vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.long_name'}, + 'cdata': 'Vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.title.markup'}, + 'cdata': 'Audio', + 'name': 'property'}, + {'attributes': {u'name': u'seekable'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_num'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_den'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'audio_index'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'video_index'}, + 'cdata': '-1', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'avformat', + 'name': 'property'}], + 'name': 'producer'}, + {'attributes': {u'id': u'playlist2'}, + 'children': [{'attributes': {u'length': u'1138'}, 'name': 'blank'}, + {'attributes': {u'in': u'0', u'out': u'85261', u'producer': u'2_2_audio'}, + 'children': [{'attributes': {u'id': u'fadeout', + u'in': u'85259', + u'out': u'85261'}, + 'children': [{'attributes': {u'name': u'track'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'window'}, + 'cdata': '75', + 'name': 'property'}, + {'attributes': {u'name': u'max_gain'}, + 'cdata': '20dB', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'filter', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'volume', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_id'}, + 'cdata': 'fadeout', + 'name': 'property'}, + {'attributes': {u'name': u'tag'}, + 'cdata': 'volume', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_ix'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'gain'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'end'}, 'cdata': '0', 'name': 'property'}], + 'name': 'filter'}], + 'name': 'entry'}, + {'attributes': {u'in': u'85323', + u'out': u'321690', + u'producer': u'2_3_audio'}, + 'children': [{'attributes': {u'id': u'fadein', + u'in': u'85323', + u'out': u'85325'}, + 'children': [{'attributes': {u'name': u'track'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'window'}, + 'cdata': '75', + 'name': 'property'}, + {'attributes': {u'name': u'max_gain'}, + 'cdata': '20dB', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'filter', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'volume', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_id'}, + 'cdata': 'fadein', + 'name': 'property'}, + {'attributes': {u'name': u'tag'}, + 'cdata': 'volume', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_ix'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'gain'}, 'cdata': '0', 'name': 'property'}, + {'attributes': {u'name': u'end'}, 'cdata': '1', 'name': 'property'}], + 'name': 'filter'}], + 'name': 'entry'}], + 'name': 'playlist'}, + {'attributes': {u'id': u'playlist3'}, 'name': 'playlist'}, + {'attributes': {u'id': u'playlist4'}, 'name': 'playlist'}, + {'attributes': {u'id': u'2_video', u'in': u'0', u'out': u'321690'}, + 'children': [{'attributes': {u'name': u'mlt_type'}, + 'cdata': 'producer', + 'name': 'property'}, + {'attributes': {u'name': u'length'}, + 'cdata': '321691', + 'name': 'property'}, + {'attributes': {u'name': u'eof'}, 'cdata': 'pause', 'name': 'property'}, + {'attributes': {u'name': u'resource'}, + 'cdata': '/home/pre-barreau/kdenlive/Droit priv\xc3\xa9 internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.nb_streams'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.type'}, + 'cdata': 'video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.sample_aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.pix_fmt'}, + 'cdata': 'yuv420p', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.sample_aspect_ratio'}, + 'cdata': '0,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.colorspace'}, + 'cdata': '601', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.name'}, + 'cdata': 'vp8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.long_name'}, + 'cdata': 'On2 VP8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.title.markup'}, + 'cdata': 'Video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.stream.type'}, + 'cdata': 'audio', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_fmt'}, + 'cdata': 's16', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_rate'}, + 'cdata': '48000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.channels'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.name'}, + 'cdata': 'vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.long_name'}, + 'cdata': 'Vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.title.markup'}, + 'cdata': 'Audio', + 'name': 'property'}, + {'attributes': {u'name': u'seekable'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_num'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_den'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'audio_index'}, + 'cdata': '-1', + 'name': 'property'}, + {'attributes': {u'name': u'video_index'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'avformat', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.frame_rate_num'}, + 'cdata': '24', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.frame_rate_den'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'source_fps'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.colorspace'}, + 'cdata': '601', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.width'}, + 'cdata': '640', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.height'}, + 'cdata': '360', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.top_field_first'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.progressive'}, + 'cdata': '1', + 'name': 'property'}], + 'name': 'producer'}, + {'attributes': {u'id': u'playlist5'}, + 'children': [{'attributes': {u'length': u'1138'}, 'name': 'blank'}, + {'attributes': {u'in': u'0', u'out': u'85261', u'producer': u'2_video'}, + 'children': [{'attributes': {u'id': u'fade_to_black', + u'in': u'85259', + u'out': u'85261'}, + 'children': [{'attributes': {u'name': u'track'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'start'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'filter', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'brightness', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_id'}, + 'cdata': 'fade_to_black', + 'name': 'property'}, + {'attributes': {u'name': u'tag'}, + 'cdata': 'brightness', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_ix'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'end'}, 'cdata': '0', 'name': 'property'}], + 'name': 'filter'}], + 'name': 'entry'}, + {'attributes': {u'in': u'85323', + u'out': u'321690', + u'producer': u'2_video'}, + 'children': [{'attributes': {u'id': u'fade_from_black', + u'in': u'85323', + u'out': u'85325'}, + 'children': [{'attributes': {u'name': u'track'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'start'}, 'cdata': '0', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'filter', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'brightness', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_id'}, + 'cdata': 'fade_from_black', + 'name': 'property'}, + {'attributes': {u'name': u'tag'}, + 'cdata': 'brightness', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_ix'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'end'}, 'cdata': '1', 'name': 'property'}], + 'name': 'filter'}], + 'name': 'entry'}], + 'name': 'playlist'}, + {'attributes': {u'global_feed': u'1', + u'id': u'maintractor', + u'in': u'0', + u'out': u'322767', + u'title': u'Anonymous Submission'}, + 'children': [{'attributes': {u'name': u'meta.volume'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'producer': u'black_track'}, 'name': 'track'}, + {'attributes': {u'hide': u'video', u'producer': u'playlist1'}, + 'name': 'track'}, + {'attributes': {u'hide': u'video', u'producer': u'playlist2'}, + 'name': 'track'}, + {'attributes': {u'producer': u'playlist3'}, 'name': 'track'}, + {'attributes': {u'producer': u'playlist4'}, 'name': 'track'}, + {'attributes': {u'producer': u'playlist5'}, 'name': 'track'}, + {'attributes': {u'id': u'transition0', u'in': u'0', u'out': u'0'}, + 'children': [{'attributes': {u'name': u'a_track'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'b_track'}, 'cdata': '2', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'transition', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'mix', + 'name': 'property'}, + {'attributes': {u'name': u'always_active'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'combine'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'internal_added'}, + 'cdata': '237', + 'name': 'property'}], + 'name': 'transition'}, + {'attributes': {u'id': u'transition1', u'in': u'0', u'out': u'0'}, + 'children': [{'attributes': {u'name': u'a_track'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'b_track'}, 'cdata': '3', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'transition', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'mix', + 'name': 'property'}, + {'attributes': {u'name': u'always_active'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'combine'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'internal_added'}, + 'cdata': '237', + 'name': 'property'}], + 'name': 'transition'}, + {'attributes': {u'id': u'transition2', u'in': u'0', u'out': u'0'}, + 'children': [{'attributes': {u'name': u'a_track'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'b_track'}, 'cdata': '4', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'transition', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'mix', + 'name': 'property'}, + {'attributes': {u'name': u'always_active'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'combine'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'internal_added'}, + 'cdata': '237', + 'name': 'property'}], + 'name': 'transition'}, + {'attributes': {u'id': u'transition3', u'in': u'0', u'out': u'0'}, + 'children': [{'attributes': {u'name': u'a_track'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'b_track'}, 'cdata': '5', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'transition', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'mix', + 'name': 'property'}, + {'attributes': {u'name': u'always_active'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'combine'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'internal_added'}, + 'cdata': '237', + 'name': 'property'}], + 'name': 'transition'}], + 'name': 'tractor'}, + {'attributes': {u'kdenliveversion': u'0.8', + u'profile': u'/home/pre-barreau/.kde/share/apps/kdenlive/profiles/customprofile0', + u'projectfolder': u'/home/pre-barreau/kdenlive', + u'version': u'0,85'}, + 'children': [{'name': 'customeffects'}, + {'attributes': {u'enableproxy': u'0', + u'generateimageproxy': u'0', + u'generateproxy': u'0', + u'position': u'86442', + u'proxyextension': u'ts', + u'proxyimageminsize': u'2000', + u'proxyminsize': u'1000', + u'proxyparams': u'-f mpegts -acodec libmp3lame -ac 2 -ab 92k -ar 48000 -vcodec mpeg2video -g 5 -deinterlace -s 480x270 -b 150k', + u'verticalzoom': u'1', + u'zonein': u'0', + u'zoneout': u'100', + u'zoom': u'13'}, + 'name': 'documentproperties'}, + {'name': 'documentnotes'}, + {'attributes': {u'description': u'HD 360p 24 fps', + u'display_aspect_den': u'9', + u'display_aspect_num': u'16', + u'frame_rate_den': u'1', + u'frame_rate_num': u'24', + u'height': u'360', + u'progressive': u'1', + u'sample_aspect_den': u'1', + u'sample_aspect_num': u'1', + u'width': u'640'}, + 'name': 'profileinfo'}, + {'children': [{'attributes': {u'blind': u'1', + u'locked': u'0', + u'mute': u'0', + u'trackname': u'Audio 2', + u'type': u'audio'}, + 'name': 'trackinfo'}, + {'attributes': {u'blind': u'1', + u'locked': u'0', + u'mute': u'0', + u'trackname': u'Audio 1', + u'type': u'audio'}, + 'name': 'trackinfo'}, + {'attributes': {u'blind': u'0', + u'locked': u'0', + u'mute': u'0', + u'trackname': u'Video 3'}, + 'name': 'trackinfo'}, + {'attributes': {u'blind': u'0', + u'locked': u'0', + u'mute': u'0', + u'trackname': u'Video 2'}, + 'name': 'trackinfo'}, + {'attributes': {u'blind': u'0', + u'locked': u'0', + u'mute': u'0', + u'trackname': u'Video 1'}, + 'name': 'trackinfo'}], + 'name': 'tracksinfo'}, + {'attributes': {u'aspect_ratio': u'1,000000', + u'audio_max': u'1', + u'audiocodec': u'Vorbis', + u'channels': u'2', + u'colorspace': u'601', + u'default_audio': u'1', + u'default_video': u'0', + u'duration': u'321691', + u'file_hash': u'78149b6acdabd39af1ab52ea72b5b24a', + u'file_size': u'729776788', + u'fps': u'24', + u'frame_size': u'640x360', + u'frequency': u'48000', + u'id': u'2', + u'name': u'crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm', + u'pix_fmt': u'yuv420p', + u'resource': u'/home/pre-barreau/kdenlive/Droit priv\xe9 internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm', + u'type': u'3', + u'video_max': u'0', + u'videocodec': u'On2 VP8'}, + 'name': 'kdenlive_producer'}, + {'name': 'markers'}, + {'children': [{'attributes': {u'comment': u'01:00:00:00', + u'time': u'3600'}, + 'name': 'guide'}], + 'name': 'guides'}, + {'children': [{'children': [{'attributes': {u'position': u'86400', + u'track': u'3'}, + 'name': 'clipitem'}, + {'attributes': {u'position': u'86400', u'track': u'0'}, + 'name': 'clipitem'}], + 'name': 'group'}, + {'children': [{'attributes': {u'position': u'1138', u'track': u'3'}, + 'name': 'clipitem'}, + {'attributes': {u'position': u'1138', u'track': u'0'}, + 'name': 'clipitem'}], + 'name': 'group'}], + 'name': 'groups'}], + 'name': 'kdenlivedoc'}], + 'name': 'mlt'} diff --git a/kdenlive/examples/sans_dict.txt b/kdenlive/examples/sans_dict.txt new file mode 100644 index 0000000..cdac01b --- /dev/null +++ b/kdenlive/examples/sans_dict.txt @@ -0,0 +1,566 @@ +{'attributes': {u'LC_NUMERIC': u'fr_FR.UTF-8', + u'root': u'/home/pre-barreau/Documents', + u'title': u'Anonymous Submission'}, + 'children': [{'attributes': {u'colorspace': u'709', + u'description': u'HD 360p 24 fps', + u'display_aspect_den': u'9', + u'display_aspect_num': u'16', + u'frame_rate_den': u'1', + u'frame_rate_num': u'24', + u'height': u'360', + u'progressive': u'1', + u'sample_aspect_den': u'1', + u'sample_aspect_num': u'1', + u'width': u'640'}, + 'name': 'profile'}, + {'attributes': {u'id': u'black', u'in': u'0', u'out': u'322767'}, + 'children': [{'attributes': {u'name': u'mlt_type'}, + 'cdata': 'producer', + 'name': 'property'}, + {'attributes': {u'name': u'length'}, + 'cdata': '322768', + 'name': 'property'}, + {'attributes': {u'name': u'eof'}, 'cdata': 'pause', 'name': 'property'}, + {'attributes': {u'name': u'resource'}, + 'cdata': 'black', + 'name': 'property'}, + {'attributes': {u'name': u'aspect_ratio'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'colour', + 'name': 'property'}], + 'name': 'producer'}, + {'attributes': {u'id': u'black_track'}, + 'children': [{'attributes': {u'in': u'0', + u'out': u'322767', + u'producer': u'black'}, + 'name': 'entry'}], + 'name': 'playlist'}, + {'attributes': {u'id': u'playlist1'}, 'name': 'playlist'}, + {'attributes': {u'id': u'2_2_audio', u'in': u'0', u'out': u'321690'}, + 'children': [{'attributes': {u'name': u'mlt_type'}, + 'cdata': 'producer', + 'name': 'property'}, + {'attributes': {u'name': u'length'}, + 'cdata': '321691', + 'name': 'property'}, + {'attributes': {u'name': u'eof'}, 'cdata': 'pause', 'name': 'property'}, + {'attributes': {u'name': u'resource'}, + 'cdata': '/home/pre-barreau/kdenlive/Droit priv\xc3\xa9 internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.nb_streams'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.type'}, + 'cdata': 'video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.sample_aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.pix_fmt'}, + 'cdata': 'yuv420p', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.sample_aspect_ratio'}, + 'cdata': '0,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.colorspace'}, + 'cdata': '601', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.name'}, + 'cdata': 'vp8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.long_name'}, + 'cdata': 'On2 VP8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.title.markup'}, + 'cdata': 'Video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.stream.type'}, + 'cdata': 'audio', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_fmt'}, + 'cdata': 's16', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_rate'}, + 'cdata': '48000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.channels'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.name'}, + 'cdata': 'vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.long_name'}, + 'cdata': 'Vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.title.markup'}, + 'cdata': 'Audio', + 'name': 'property'}, + {'attributes': {u'name': u'seekable'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_num'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_den'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'audio_index'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'video_index'}, + 'cdata': '-1', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'avformat', + 'name': 'property'}], + 'name': 'producer'}, + {'attributes': {u'id': u'2_3_audio', u'in': u'0', u'out': u'321690'}, + 'children': [{'attributes': {u'name': u'mlt_type'}, + 'cdata': 'producer', + 'name': 'property'}, + {'attributes': {u'name': u'length'}, + 'cdata': '321691', + 'name': 'property'}, + {'attributes': {u'name': u'eof'}, 'cdata': 'pause', 'name': 'property'}, + {'attributes': {u'name': u'resource'}, + 'cdata': '/home/pre-barreau/kdenlive/Droit priv\xc3\xa9 internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.nb_streams'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.type'}, + 'cdata': 'video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.sample_aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.pix_fmt'}, + 'cdata': 'yuv420p', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.sample_aspect_ratio'}, + 'cdata': '0,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.colorspace'}, + 'cdata': '601', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.name'}, + 'cdata': 'vp8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.long_name'}, + 'cdata': 'On2 VP8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.title.markup'}, + 'cdata': 'Video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.stream.type'}, + 'cdata': 'audio', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_fmt'}, + 'cdata': 's16', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_rate'}, + 'cdata': '48000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.channels'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.name'}, + 'cdata': 'vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.long_name'}, + 'cdata': 'Vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.title.markup'}, + 'cdata': 'Audio', + 'name': 'property'}, + {'attributes': {u'name': u'seekable'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_num'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_den'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'audio_index'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'video_index'}, + 'cdata': '-1', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'avformat', + 'name': 'property'}], + 'name': 'producer'}, + {'attributes': {u'id': u'playlist2'}, + 'children': [{'attributes': {u'length': u'1138'}, 'name': 'blank'}, + {'attributes': {u'in': u'0', u'out': u'85261', u'producer': u'2_2_audio'}, + 'name': 'entry'}, + {'attributes': {u'in': u'85323', + u'out': u'321690', + u'producer': u'2_3_audio'}, + 'name': 'entry'}], + 'name': 'playlist'}, + {'attributes': {u'id': u'playlist3'}, 'name': 'playlist'}, + {'attributes': {u'id': u'playlist4'}, 'name': 'playlist'}, + {'attributes': {u'id': u'2_video', u'in': u'0', u'out': u'321690'}, + 'children': [{'attributes': {u'name': u'mlt_type'}, + 'cdata': 'producer', + 'name': 'property'}, + {'attributes': {u'name': u'length'}, + 'cdata': '321691', + 'name': 'property'}, + {'attributes': {u'name': u'eof'}, 'cdata': 'pause', 'name': 'property'}, + {'attributes': {u'name': u'resource'}, + 'cdata': '/home/pre-barreau/kdenlive/Droit priv\xc3\xa9 internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.nb_streams'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.type'}, + 'cdata': 'video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.stream.sample_aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.frame_rate'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.pix_fmt'}, + 'cdata': 'yuv420p', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.sample_aspect_ratio'}, + 'cdata': '0,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.colorspace'}, + 'cdata': '601', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.name'}, + 'cdata': 'vp8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.long_name'}, + 'cdata': 'On2 VP8', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.0.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.0.stream.title.markup'}, + 'cdata': 'Video', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.stream.type'}, + 'cdata': 'audio', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_fmt'}, + 'cdata': 's16', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.sample_rate'}, + 'cdata': '48000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.channels'}, + 'cdata': '2', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.name'}, + 'cdata': 'vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.long_name'}, + 'cdata': 'Vorbis', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.1.codec.bit_rate'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.language.markup'}, + 'cdata': 'eng', + 'name': 'property'}, + {'attributes': {u'name': u'meta.attr.1.stream.title.markup'}, + 'cdata': 'Audio', + 'name': 'property'}, + {'attributes': {u'name': u'seekable'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_num'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.sample_aspect_den'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'aspect_ratio'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'name': u'audio_index'}, + 'cdata': '-1', + 'name': 'property'}, + {'attributes': {u'name': u'video_index'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'avformat', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.frame_rate_num'}, + 'cdata': '24', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.frame_rate_den'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'source_fps'}, + 'cdata': '24,000000', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.colorspace'}, + 'cdata': '601', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.width'}, + 'cdata': '640', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.height'}, + 'cdata': '360', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.top_field_first'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'meta.media.progressive'}, + 'cdata': '1', + 'name': 'property'}], + 'name': 'producer'}, + {'attributes': {u'id': u'playlist5'}, + 'children': [{'attributes': {u'length': u'1138'}, 'name': 'blank'}, + {'attributes': {u'in': u'0', u'out': u'85261', u'producer': u'2_video'}, + 'name': 'entry'}, + {'attributes': {u'in': u'85323', + u'out': u'321690', + u'producer': u'2_video'}, + 'name': 'entry'}], + 'name': 'playlist'}, + {'attributes': {u'global_feed': u'1', + u'id': u'maintractor', + u'in': u'0', + u'out': u'322767', + u'title': u'Anonymous Submission'}, + 'children': [{'attributes': {u'name': u'meta.volume'}, + 'cdata': '1,000000', + 'name': 'property'}, + {'attributes': {u'producer': u'black_track'}, 'name': 'track'}, + {'attributes': {u'hide': u'video', u'producer': u'playlist1'}, + 'name': 'track'}, + {'attributes': {u'hide': u'video', u'producer': u'playlist2'}, + 'name': 'track'}, + {'attributes': {u'producer': u'playlist3'}, 'name': 'track'}, + {'attributes': {u'producer': u'playlist4'}, 'name': 'track'}, + {'attributes': {u'producer': u'playlist5'}, 'name': 'track'}, + {'attributes': {u'id': u'transition0', u'in': u'0', u'out': u'0'}, + 'children': [{'attributes': {u'name': u'a_track'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'b_track'}, 'cdata': '2', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'transition', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'mix', + 'name': 'property'}, + {'attributes': {u'name': u'always_active'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'combine'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'internal_added'}, + 'cdata': '237', + 'name': 'property'}], + 'name': 'transition'}, + {'attributes': {u'id': u'transition1', u'in': u'0', u'out': u'0'}, + 'children': [{'attributes': {u'name': u'a_track'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'b_track'}, 'cdata': '3', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'transition', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'mix', + 'name': 'property'}, + {'attributes': {u'name': u'always_active'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'combine'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'internal_added'}, + 'cdata': '237', + 'name': 'property'}], + 'name': 'transition'}, + {'attributes': {u'id': u'transition2', u'in': u'0', u'out': u'0'}, + 'children': [{'attributes': {u'name': u'a_track'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'b_track'}, 'cdata': '4', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'transition', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'mix', + 'name': 'property'}, + {'attributes': {u'name': u'always_active'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'combine'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'internal_added'}, + 'cdata': '237', + 'name': 'property'}], + 'name': 'transition'}, + {'attributes': {u'id': u'transition3', u'in': u'0', u'out': u'0'}, + 'children': [{'attributes': {u'name': u'a_track'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'b_track'}, 'cdata': '5', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'transition', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'mix', + 'name': 'property'}, + {'attributes': {u'name': u'always_active'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'combine'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'internal_added'}, + 'cdata': '237', + 'name': 'property'}], + 'name': 'transition'}], + 'name': 'tractor'}, + {'attributes': {u'kdenliveversion': u'0.8', + u'profile': u'/home/pre-barreau/.kde/share/apps/kdenlive/profiles/customprofile0', + u'projectfolder': u'/home/pre-barreau/kdenlive', + u'version': u'0,85'}, + 'children': [{'name': 'customeffects'}, + {'attributes': {u'enableproxy': u'0', + u'generateimageproxy': u'0', + u'generateproxy': u'0', + u'position': u'86442', + u'proxyextension': u'ts', + u'proxyimageminsize': u'2000', + u'proxyminsize': u'1000', + u'proxyparams': u'-f mpegts -acodec libmp3lame -ac 2 -ab 92k -ar 48000 -vcodec mpeg2video -g 5 -deinterlace -s 480x270 -b 150k', + u'verticalzoom': u'1', + u'zonein': u'0', + u'zoneout': u'100', + u'zoom': u'3'}, + 'name': 'documentproperties'}, + {'name': 'documentnotes'}, + {'attributes': {u'description': u'HD 360p 24 fps', + u'display_aspect_den': u'9', + u'display_aspect_num': u'16', + u'frame_rate_den': u'1', + u'frame_rate_num': u'24', + u'height': u'360', + u'progressive': u'1', + u'sample_aspect_den': u'1', + u'sample_aspect_num': u'1', + u'width': u'640'}, + 'name': 'profileinfo'}, + {'children': [{'attributes': {u'blind': u'1', + u'locked': u'0', + u'mute': u'0', + u'trackname': u'Audio 2', + u'type': u'audio'}, + 'name': 'trackinfo'}, + {'attributes': {u'blind': u'1', + u'locked': u'0', + u'mute': u'0', + u'trackname': u'Audio 1', + u'type': u'audio'}, + 'name': 'trackinfo'}, + {'attributes': {u'blind': u'0', + u'locked': u'0', + u'mute': u'0', + u'trackname': u'Video 3'}, + 'name': 'trackinfo'}, + {'attributes': {u'blind': u'0', + u'locked': u'0', + u'mute': u'0', + u'trackname': u'Video 2'}, + 'name': 'trackinfo'}, + {'attributes': {u'blind': u'0', + u'locked': u'0', + u'mute': u'0', + u'trackname': u'Video 1'}, + 'name': 'trackinfo'}], + 'name': 'tracksinfo'}, + {'attributes': {u'aspect_ratio': u'1,000000', + u'audio_max': u'1', + u'audiocodec': u'Vorbis', + u'channels': u'2', + u'colorspace': u'601', + u'default_audio': u'1', + u'default_video': u'0', + u'duration': u'321691', + u'file_hash': u'78149b6acdabd39af1ab52ea72b5b24a', + u'file_size': u'729776788', + u'fps': u'24', + u'frame_size': u'640x360', + u'frequency': u'48000', + u'id': u'2', + u'name': u'crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm', + u'pix_fmt': u'yuv420p', + u'resource': u'/home/pre-barreau/kdenlive/Droit priv\xe9 internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm', + u'type': u'3', + u'video_max': u'0', + u'videocodec': u'On2 VP8'}, + 'name': 'kdenlive_producer'}, + {'name': 'markers'}, + {'children': [{'attributes': {u'comment': u'01:00:00:00', + u'time': u'3600'}, + 'name': 'guide'}], + 'name': 'guides'}, + {'children': [{'children': [{'attributes': {u'position': u'86400', + u'track': u'3'}, + 'name': 'clipitem'}, + {'attributes': {u'position': u'86400', u'track': u'0'}, + 'name': 'clipitem'}], + 'name': 'group'}, + {'children': [{'attributes': {u'position': u'1138', u'track': u'3'}, + 'name': 'clipitem'}, + {'attributes': {u'position': u'1138', u'track': u'0'}, + 'name': 'clipitem'}], + 'name': 'group'}], + 'name': 'groups'}], + 'name': 'kdenlivedoc'}], + 'name': 'mlt'} diff --git a/kdenlive/examples/test_avec_orig.kdenlive b/kdenlive/examples/test_avec_orig.kdenlive new file mode 100644 index 0000000..00dcb68 --- /dev/null +++ b/kdenlive/examples/test_avec_orig.kdenlive @@ -0,0 +1,262 @@ + + + + + producer + 322768 + pause + black + 0 + colour + + + + + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + 1 + -1 + avformat + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + 1 + -1 + avformat + + + + + + 0 + 75 + 20dB + filter + volume + fadeout + volume + 1 + 1 + 0 + + + + + 0 + 75 + 20dB + filter + volume + fadein + volume + 1 + 0 + 1 + + + + + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + -1 + 0 + avformat + 24 + 1 + 24,000000 + 601 + 640 + 360 + 0 + 1 + + + + + + 0 + 1 + filter + brightness + fade_to_black + brightness + 1 + 0 + + + + + 0 + 0 + filter + brightness + fade_from_black + brightness + 1 + 1 + + + + + 1,000000 + + + + + + + + 1 + 2 + transition + mix + 1 + 1 + 237 + + + 1 + 3 + transition + mix + 1 + 1 + 237 + + + 1 + 4 + transition + mix + 1 + 1 + 237 + + + 1 + 5 + transition + mix + 1 + 1 + 237 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kdenlive/examples/test_out.kdenlive b/kdenlive/examples/test_out.kdenlive new file mode 100644 index 0000000..0937dfc --- /dev/null +++ b/kdenlive/examples/test_out.kdenlive @@ -0,0 +1,262 @@ + + + + + producer + 322768 + pause + black + 0 + colour + + + + + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + 1 + -1 + avformat + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + 1 + -1 + avformat + + + + + + 0 + 75 + 20dB + filter + volume + fadeout + volume + 1 + 1 + 0 + + + + + 0 + 75 + 20dB + filter + volume + fadein + volume + 1 + 0 + 1 + + + + + + + producer + 321691 + pause + /home/pre-barreau/kdenlive/Droit privé internationnal/DIP_Brute/crfpa-droit-international-prive-cours-08_07_12-13-06-55.webm + 2 + video + 24,000000 + 1,000000 + 24,000000 + yuv420p + 0,000000 + 601 + vp8 + On2 VP8 + 0 + eng + Video + audio + s16 + 48000 + 2 + vorbis + Vorbis + 0 + eng + Audio + 1 + 1 + 1 + 1,000000 + -1 + 0 + avformat + 24 + 1 + 24,000000 + 601 + 640 + 360 + 0 + 1 + + + + + + 0 + 1 + filter + brightness + fade_to_black + brightness + 1 + 0 + + + + + 0 + 0 + filter + brightness + fade_from_black + brightness + 1 + 1 + + + + + 1,000000 + + + + + + + + 1 + 2 + transition + mix + 1 + 1 + 237 + + + 1 + 3 + transition + mix + 1 + 1 + 237 + + + 1 + 4 + transition + mix + 1 + 1 + 237 + + + 1 + 5 + transition + mix + 1 + 1 + 237 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kdenlive/fade.py b/kdenlive/fade.py new file mode 100644 index 0000000..ab53fce --- /dev/null +++ b/kdenlive/fade.py @@ -0,0 +1,189 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2012-2013 Guillaume Pellerin + +# This file is part of TimeSide. + +# TimeSide is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. + +# TimeSide is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with TimeSide. If not, see . + +# Author: Guillaume Pellerin + + +from xmltodict2 import * + + +class KdenliveAutoFade(object): + + def __init__(self): + self.n_frames = 2 + self.audio_count = 0 + self.video_count = 0 + + def audio_fade_in(self, frame_out): + child = {'attributes': {u'id': u'fadeout', + u'in': unicode(int(frame_out)-self.n_frames), + u'out': unicode(frame_out)}, + 'children': [{'attributes': {u'name': u'track'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'window'}, + 'cdata': '75', + 'name': 'property'}, + {'attributes': {u'name': u'max_gain'}, + 'cdata': '20dB', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'filter', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'volume', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_id'}, + 'cdata': 'fadeout', + 'name': 'property'}, + {'attributes': {u'name': u'tag'}, + 'cdata': 'volume', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_ix'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'gain'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'end'}, 'cdata': '0', 'name': 'property'}], + 'name': 'filter'} + + return child + + def audio_fade_out(self, frame_in): + child = {'attributes': {u'id': u'fadein', + u'in': unicode(frame_in), + u'out': unicode(int(frame_in)+self.n_frames)}, + 'children': [{'attributes': {u'name': u'track'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'window'}, + 'cdata': '75', + 'name': 'property'}, + {'attributes': {u'name': u'max_gain'}, + 'cdata': '20dB', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'filter', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'volume', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_id'}, + 'cdata': 'fadein', + 'name': 'property'}, + {'attributes': {u'name': u'tag'}, + 'cdata': 'volume', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_ix'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'gain'}, 'cdata': '0', 'name': 'property'}, + {'attributes': {u'name': u'end'}, 'cdata': '1', 'name': 'property'}], + 'name': 'filter'} + + return child + + + def video_fade_in(self, frame_out): + child = {'attributes': {u'id': u'fade_to_black', + u'in': unicode(int(frame_out)-self.n_frames), + u'out': unicode(frame_out)}, + 'children': [{'attributes': {u'name': u'track'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'start'}, 'cdata': '1', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'filter', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'brightness', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_id'}, + 'cdata': 'fade_to_black', + 'name': 'property'}, + {'attributes': {u'name': u'tag'}, + 'cdata': 'brightness', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_ix'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'end'}, 'cdata': '0', 'name': 'property'}], + 'name': 'filter'} + + return child + + + def video_fade_out(self, frame_in): + child = {'attributes': {u'id': u'fade_from_black', + u'in': unicode(frame_in), + u'out': unicode(int(frame_in)+self.n_frames)}, + 'children': [{'attributes': {u'name': u'track'}, + 'cdata': '0', + 'name': 'property'}, + {'attributes': {u'name': u'start'}, 'cdata': '0', 'name': 'property'}, + {'attributes': {u'name': u'mlt_type'}, + 'cdata': 'filter', + 'name': 'property'}, + {'attributes': {u'name': u'mlt_service'}, + 'cdata': 'brightness', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_id'}, + 'cdata': 'fade_from_black', + 'name': 'property'}, + {'attributes': {u'name': u'tag'}, + 'cdata': 'brightness', + 'name': 'property'}, + {'attributes': {u'name': u'kdenlive_ix'}, + 'cdata': '1', + 'name': 'property'}, + {'attributes': {u'name': u'end'}, 'cdata': '1', 'name': 'property'}], + 'name': 'filter'} + + return child + + def run(self, path_in, path_out): + d = xmltodict(path_in) + for attr in d['children']: + if 'playlist' in attr['name'] and 'children' in attr: + for att in attr['children']: + if 'producer' in att['attributes']: + producer = att['attributes']['producer'] + if producer != 'black': + frame_in = att['attributes']['in'] + frame_out = att['attributes']['out'] + + if 'audio' in producer: + if not self.audio_count % 2: + att['children'] = [self.audio_fade_in(frame_out)] + else: + att['children'] = [self.audio_fade_out(frame_in)] + self.audio_count =+ 1 + + if 'video' in producer: + if not self.video_count % 2: + att['children'] = [self.video_fade_in(frame_out)] + else: + att['children'] = [self.video_fade_out(frame_in)] + self.video_count =+ 1 + + data = dicttoxml(d) + f = open(path_out, 'w') + f.write(data.encode('utf-8')) + f.close() + + diff --git a/kdenlive/fade.pyc b/kdenlive/fade.pyc new file mode 100644 index 0000000..66cb751 Binary files /dev/null and b/kdenlive/fade.pyc differ diff --git a/kdenlive/xmltodict2.py b/kdenlive/xmltodict2.py new file mode 100644 index 0000000..35f7ab1 --- /dev/null +++ b/kdenlive/xmltodict2.py @@ -0,0 +1,398 @@ +# -*- coding: utf-8 -*- +""" xmltodict(): convert xml into tree of Python dicts. + +This was copied and modified from John Bair's recipe at aspn.activestate.com: + http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/149368 +""" +import os +import string +import locale +from xml.parsers import expat + +# If we're in Dabo, get the default encoding. +#import dabo +#import dabo.lib.DesignerUtils as desUtil +#from dabo.dLocalize import _ +#from dabo.lib.utils import resolvePath +#app = dabo.dAppRef +#if app is not None: + #default_encoding = app.Encoding +#else: + #enc = locale.getlocale()[1] + #if enc is None: + #enc = dabo.defaultEncoding + #default_encoding = enc + +# Python seems to need to compile code with \n linesep: +code_linesep = "\n" +eol = os.linesep +default_encoding = 'utf-8' +default_decoding = 'utf-8' + +class Xml2Obj: + """XML to Object""" + def __init__(self): + self.root = None + self.nodeStack = [] + self.attsToSkip = [] + self._inCode = False + self._mthdName = "" + self._mthdCode = "" + self._codeDict = None + self._inProp = False + self._propName = "" + self._propData = "" + self._propDict = None + self._currPropAtt = "" + self._currPropDict = None + + + def StartElement(self, name, attributes): + """SAX start element even handler""" + if name == "code": + # This is code for the parent element + self._inCode = True + parent = self.nodeStack[-1] + if not parent.has_key("code"): + parent["code"] = {} + self._codeDict = parent["code"] + + elif name == "properties": + # These are the custom property definitions + self._inProp = True + self._propName = "" + self._propData = "" + parent = self.nodeStack[-1] + if not parent.has_key("properties"): + parent["properties"] = {} + self._propDict = parent["properties"] + + else: + if self._inCode: + self._mthdName = name.encode() + elif self._inProp: + if self._propName: + # In the middle of a prop definition + self._currPropAtt = name.encode() + else: + self._propName = name.encode() + self._currPropDict = {} + self._currPropAtt = "" + else: + element = {"name": name.encode()} + if len(attributes) > 0: + for att in self.attsToSkip: + if attributes.has_key(att): + del attributes[att] + element["attributes"] = attributes + + # Push element onto the stack and make it a child of parent + if len(self.nodeStack) > 0: + parent = self.nodeStack[-1] + if not parent.has_key("children"): + parent["children"] = [] + parent["children"].append(element) + else: + self.root = element + self.nodeStack.append(element) + + + def EndElement(self, name): + """SAX end element event handler""" + if self._inCode: + if name == "code": + self._inCode = False + self._codeDict = None + else: + # End of an individual method + mth = self._mthdCode.strip() + if not mth.endswith("\n"): + mth += "\n" + self._codeDict[self._mthdName] = mth + self._mthdName = "" + self._mthdCode = "" + elif self._inProp: + if name == "properties": + self._inProp = False + self._propDict = None + elif name == self._propName: + # End of an individual prop definition + self._propDict[self._propName] = self._currPropDict + self._propName = "" + else: + # end of a property attribute + self._currPropDict[self._currPropAtt] = self._propData + self._propData = self._currPropAtt = "" + else: + self.nodeStack = self.nodeStack[:-1] + + + def CharacterData(self, data): + """SAX character data event handler""" + if self._inCode or data.strip(): + data = data.replace("<", "<") + data = data.encode(default_encoding) + if self._inCode: + if self._mthdCode: + self._mthdCode += data + else: + self._mthdCode = data + elif self._inProp: + self._propData += data + else: + element = self.nodeStack[-1] + if not element.has_key("cdata"): + element["cdata"] = "" + element["cdata"] += data + + + def Parse(self, xml): + # Create a SAX parser + Parser = expat.ParserCreate(default_encoding) + # SAX event handlers + Parser.StartElementHandler = self.StartElement + Parser.EndElementHandler = self.EndElement + Parser.CharacterDataHandler = self.CharacterData + # Parse the XML File + ParserStatus = Parser.Parse(xml, 1) + return self.root + + + def ParseFromFile(self, filename): + return self.Parse(open(filename,"r").read()) + + +def xmltodict(xml, attsToSkip=[], addCodeFile=False): + """Given an xml string or file, return a Python dictionary.""" + parser = Xml2Obj() + parser.attsToSkip = attsToSkip + isPath = os.path.exists(xml) + errmsg = "" + if eol not in xml and isPath: + # argument was a file + try: + ret = parser.ParseFromFile(xml) + except expat.ExpatError, e: + errmsg = _("The XML in '%s' is not well-formed and cannot be parsed: %s") % (xml, e) + else: + # argument must have been raw xml: + if not xml.strip().startswith(" 127: + chars.append("&#%s;" % ord(char)) + else: + chars.append(char) + val = "".join(chars) + val = val.replace("<", "<").replace(">", ">") + return "%s%s%s" % (qt, val, qt) + + +def dicttoxml(dct, level=0, header=None, linesep=None): + """Given a Python dictionary, return an xml string. + + The dictionary must be in the format returned by dicttoxml(), with keys + on "attributes", "code", "cdata", "name", and "children". + + Send your own XML header, otherwise a default one will be used. + + The linesep argument is a dictionary, with keys on levels, allowing the + developer to add extra whitespace depending on the level. + """ + att = "" + ret = "" + + if dct.has_key("attributes"): + for key, val in dct["attributes"].items(): + # Some keys are already handled. + noEscape = key in ("sizerInfo",) + val = escQuote(val, noEscape) + att += " %s=%s" % (key, val) + ret += "%s<%s%s" % ("\t" * level, dct["name"], att) + + if (not dct.has_key("cdata") and not dct.has_key("children") + and not dct.has_key("code") and not dct.has_key("properties")): + ret += " />%s" % eol + else: + ret += ">" + if dct.has_key("cdata"): + ret += "%s" % dct["cdata"].decode(default_encoding).replace("<", "<") + + if dct.has_key("code"): + if len(dct["code"].keys()): + ret += "%s%s%s" % (eol, "\t" * (level+1), eol) + methodTab = "\t" * (level+2) + for mthd, cd in dct["code"].items(): + # Convert \n's in the code to eol: + cd = eol.join(cd.splitlines()) + + # Make sure that the code ends with a linefeed + if not cd.endswith(eol): + cd += eol + + ret += "%s<%s>%s%s%s" % (methodTab, + mthd, eol, cd, eol, + methodTab, mthd, eol) + ret += "%s%s" % ("\t" * (level+1), eol) + + if dct.has_key("properties"): + if len(dct["properties"].keys()): + ret += "%s%s%s" % (eol, "\t" * (level+1), eol) + currTab = "\t" * (level+2) + for prop, val in dct["properties"].items(): + ret += "%s<%s>%s" % (currTab, prop, eol) + for propItm, itmVal in val.items(): + itmTab = "\t" * (level+3) + ret += "%s<%s>%s%s" % (itmTab, propItm, itmVal, + propItm, eol) + ret += "%s%s" % (currTab, prop, eol) + ret += "%s%s" % ("\t" * (level+1), eol) + + if dct.has_key("children") and len(dct["children"]) > 0: + ret += eol + for child in dct["children"]: + ret += dicttoxml(child, level+1, linesep=linesep) + indnt = "" + if ret.endswith(eol): + # Indent the closing tag + indnt = ("\t" * level) + ret += "%s%s" % (indnt, dct["name"], eol) + + if linesep: + ret += linesep.get(level, "") + + if level == 0: + if header is None: + header = '%s' \ + % (default_encoding, eol) + ret = header + ret + + return ret + + +def flattenClassDict(cd, retDict=None): + """Given a dict containing a series of nested objects such as would + be created by restoring from a cdxml file, returns a dict with all classIDs + as keys, and a dict as the corresponding value. The dict value will have + keys for the attributes and/or code, depending on what was in the original + dict. The end result is to take a nested dict structure and return a flattened + dict with all objects at the top level. + """ + if retDict is None: + retDict = {} + atts = cd.get("attributes", {}) + props = cd.get("properties", {}) + kids = cd.get("children", []) + code = cd.get("code", {}) + classID = atts.get("classID", "") + classFile = resolvePath(atts.get("designerClass", "")) + superclass = resolvePath(atts.get("superclass", "")) + superclassID = atts.get("superclassID", "") + if superclassID and os.path.exists(superclass): + # Get the superclass info + superCD = xmltodict(superclass, addCodeFile=True) + flattenClassDict(superCD, retDict) + if classID: + if os.path.exists(classFile): + # Get the class info + classCD = xmltodict(classFile, addCodeFile=True) + classAtts = classCD.get("attributes", {}) + classProps = classCD.get("properties", {}) + classCode = classCD.get("code", {}) + classKids = classCD.get("children", []) + currDict = retDict.get(classID, {}) + retDict[classID] = {"attributes": classAtts, "code": classCode, + "properties": classProps} + retDict[classID].update(currDict) + # Now update the child objects in the dict + for kid in classKids: + flattenClassDict(kid, retDict) + else: + # Not a file; most likely just a component in another class + currDict = retDict.get(classID, {}) + retDict[classID] = {"attributes": atts, "code": code, + "properties": props} + retDict[classID].update(currDict) + if kids: + for kid in kids: + flattenClassDict(kid, retDict) + return retDict + + +def addInheritedInfo(src, super, updateCode=False): + """Called recursively on the class container structure, modifying + the attributes to incorporate superclass information. When the + 'updateCode' parameter is True, superclass code is added to the + object's code + """ + atts = src.get("attributes", {}) + props = src.get("properties", {}) + kids = src.get("children", []) + code = src.get("code", {}) + classID = atts.get("classID", "") + if classID: + superInfo = super.get(classID, {"attributes": {}, "code": {}, "properties": {}}) + src["attributes"] = superInfo["attributes"].copy() + src["attributes"].update(atts) + src["properties"] = superInfo.get("properties", {}).copy() + src["properties"].update(props) + if updateCode: + src["code"] = superInfo["code"].copy() + src["code"].update(code) + if kids: + for kid in kids: + addInheritedInfo(kid, super, updateCode) + + + +#if __name__ == "__main__": + #test_dict = {"name": "test", "attributes":{"path": "c:\\temp\\name", + #"problemChars": "Welcome to \xc2\xae".decode("latin-1")}} + #print "test_dict:", test_dict + #xml = dicttoxml(test_dict) + #print "xml:", xml + #test_dict2 = xmltodict(xml) + #print "test_dict2:", test_dict2 + #print "same?:", test_dict == test_dict2 diff --git a/kdenlive/xmltodict2.pyc b/kdenlive/xmltodict2.pyc new file mode 100644 index 0000000..20f0bd5 Binary files /dev/null and b/kdenlive/xmltodict2.pyc differ