projects
/
vidi-player.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f778b0a
)
create_test_videofont.py: generate the PNG rest sample
author
Antonio Ospite <ao2@ao2.it>
Mon, 5 Dec 2016 15:55:21 +0000
(16:55 +0100)
committer
Antonio Ospite <ao2@ao2.it>
Mon, 5 Dec 2016 15:55:21 +0000
(16:55 +0100)
create_test_videofont.py
patch
|
blob
|
history
diff --git
a/create_test_videofont.py
b/create_test_videofont.py
index
acde8ab
..
92f17b5
100755
(executable)
--- a/
create_test_videofont.py
+++ b/
create_test_videofont.py
@@
-35,6
+35,12
@@
FILE_PIPELINE_TEMPLATE = """
""" % (VIDEO_BUFFERS, VIDEO_FRAMERATE, FONT_DESC, AUDIO_BUFFERS,
AUDIO_SAMPLESPERBUFFER, AUDIO_SAMPLERATE)
""" % (VIDEO_BUFFERS, VIDEO_FRAMERATE, FONT_DESC, AUDIO_BUFFERS,
AUDIO_SAMPLESPERBUFFER, AUDIO_SAMPLERATE)
+PNG_REST_SAMPLE_TEMPLATE = """
+ videotestsrc num-buffers=1 pattern=black ! \
+ textoverlay valignment=center halignment=center font-desc="%s" text="rest" ! \
+ pngenc ! filesink location="{0}/sample_rest.png"
+""" % FONT_DESC
+
def create_test_videofont(pipeline_template, notes_range, destination_dir=None):
print("Silence")
def create_test_videofont(pipeline_template, notes_range, destination_dir=None):
print("Silence")
@@
-77,6
+83,10
@@
def main():
os.mkdir(destination_dir)
create_test_videofont(FILE_PIPELINE_TEMPLATE, notes_range,
destination_dir)
os.mkdir(destination_dir)
create_test_videofont(FILE_PIPELINE_TEMPLATE, notes_range,
destination_dir)
+
+ pipeline_string = PNG_REST_SAMPLE_TEMPLATE.format(destination_dir)
+ player = vidi.Player.from_pipeline_string(pipeline_string)
+ player.play()
else:
create_test_videofont(LIVE_PIPELINE_TEMPLATE, notes_range)
else:
create_test_videofont(LIVE_PIPELINE_TEMPLATE, notes_range)