projects
/
vidi-player.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use webm for the videofont, it has better support than shroedinger
[vidi-player.git]
/
create_test_videofont.py
diff --git
a/create_test_videofont.py
b/create_test_videofont.py
index
d113875
..
14c6509
100755
(executable)
--- a/
create_test_videofont.py
+++ b/
create_test_videofont.py
@@
-4,26
+4,30
@@
import sys
import os
import vidi
import os
import vidi
+#FONT_DESC = "Andale Mono, 72"
+FONT_DESC = "Mono, 72"
+
+SAMPLE_LENGTH_SECONDS = 4
+
+# 48000 samples per seconds, at 1024 samples per buffer
+NUM_AUDIO_BUFFERS = round(SAMPLE_LENGTH_SECONDS * 48000 / 1024)
LIVE_PIPELINE_TEMPLATE = """
videotestsrc num-buffers=1 pattern=black ! \
LIVE_PIPELINE_TEMPLATE = """
videotestsrc num-buffers=1 pattern=black ! \
- textoverlay valignment=center halignment=center font-desc="
Sans, 72
" text="{0}" ! \
+ textoverlay valignment=center halignment=center font-desc="
%s
" text="{0}" ! \
autovideosink \
autovideosink \
- audiotestsrc num-buffers=
100 freq={1:f}
! \
+ audiotestsrc num-buffers=
%d freq={1:f} ! audio/x-raw,rate=48000
! \
autoaudiosink
autoaudiosink
-"""
-
-#FONT_DESC = "Andale Mono, 72"
-FONT_DESC = "Mono, 72"
+""" % (FONT_DESC, NUM_AUDIO_BUFFERS)
FILE_PIPELINE_TEMPLATE = """
FILE_PIPELINE_TEMPLATE = """
-
matroskamux name=mux ! filesink location="{2}/sample_{0}.mkv
"
+
webmmux name=mux ! filesink location="{2}/sample_{0}.webm
"
videotestsrc num-buffers=1 pattern=black ! \
textoverlay valignment=center halignment=center font-desc="%s" text="{0}" ! \
videotestsrc num-buffers=1 pattern=black ! \
textoverlay valignment=center halignment=center font-desc="%s" text="{0}" ! \
- queue !
schroenc rate-control=3
! mux.
- audiotestsrc num-buffers=
100 freq={1:f}
! \
+ queue !
vp9enc
! mux.
+ audiotestsrc num-buffers=
%d freq={1:f} ! audio/x-raw,rate=48000
! \
queue ! audioconvert ! vorbisenc quality=0.5 ! queue ! mux.
queue ! audioconvert ! vorbisenc quality=0.5 ! queue ! mux.
-""" %
FONT_DESC
+""" %
(FONT_DESC, NUM_AUDIO_BUFFERS)
def create_test_videofont(pipeline_template, notes_range, destination_dir=None):
def create_test_videofont(pipeline_template, notes_range, destination_dir=None):