Gibt es eine Möglichkeit, Text in ein Video zu verbrennen, ohne neu zu kennern? Ich frage dies, weil der Neukodierprozess beim Schreiben in WebM rund 0,1x Geschwindigkeit auf meinem Gerät verläuft. Alternativ, wenn es eine schnellere Möglichkeit gibt, qualitativ hochwertige Videos schnell zu machen und gleichzeitig neu zu kodieren, wäre dies großartig. Ich erinnere mich vage an jemanden, der in eine temporäre Datei geschrieben hat, um dieses Problem zu lösen.
def processVideo(self):
print("creating video")
# File location management
font_path = self.input_path / "CalSans-Regular.ttf"
background_path = self.input_path / "new_video_background.webm"
audio_path = self.sound_output_path
video_ouput_path = self.parent_path / "new_result.webm"
sound_input = ffmpeg.input(str(audio_path))
video_input = ffmpeg.input(str(background_path))
# Adding captions
print(self.text_caption)
previous_timepoint = 0
for caption, timepoint in zip(self.text_caption, self.timepoints, strict=False):
# Text caption and timepooints are lists where the end of the words in text_caption correspond
# to the timepoint with the same index in timepoint
video_input = video_input.drawtext(
text=caption,
fontfile = font_path,
x='w-text_w/2',
y='h-text_h/2',
escape_text=True,
fontsize= 32,
bordercolor = "black",
borderw = 4,
enable=f'between(t,{previous_timepoint},{timepoint["timeSeconds"]})'
)
previous_timepoint = timepoint["timeSeconds"]
# Combining sound and video and writing output
command = ffmpeg.output(sound_input, video_input, str(video_ouput_path), codec='copy').overwrite_output().global_args('-shortest')
print("args =", command)
print(command.get_args())
command.run()
print("done!")
< /code>
File "c:\Desktop\Projects\video_project\main.py", line 239, in
post_list[0].processVideo()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "c:\Desktop\Projects\video_project\main.py", line 223, in processVideo
command.run()
~~~~~~~~~~~^^
File "C:\Desktop\Projects\video_project\.venv\Lib\site-packages\ffmpeg\_run.py", line 313, in run
process = run_async(
stream_spec,
......
overwrite_output=overwrite_output,
)
File "C:\Desktop\Projects\video_project\.venv\Lib\site-packages\ffmpeg\_run.py", line 284, in run_async
return subprocess.Popen(
~~~~~~~~~~~~~~~~^
args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1038, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pass_fds, cwd, env,
^^^^^^^^^^^^^^^^^^^
......
gid, gids, uid, umask,
^^^^^^^^^^^^^^^^^^^^^^
start_new_session, process_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1550, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
# no special security
^^^^^^^^^^^^^^^^^^^^^
......
cwd,
^^^^
startupinfo)
^^^^^^^^^^^^
FileNotFoundError: [WinError 206] The filename or extension is too long
Gibt es eine Möglichkeit, Text in ein Video zu verbrennen, ohne neu zu kennern? Ich frage dies, weil der Neukodierprozess beim Schreiben in WebM rund 0,1x Geschwindigkeit auf meinem Gerät verläuft. Alternativ, wenn es eine schnellere Möglichkeit gibt, qualitativ hochwertige Videos schnell zu machen und gleichzeitig neu zu kodieren, wäre dies großartig. Ich erinnere mich vage an jemanden, der in eine temporäre Datei geschrieben hat, um dieses [url=viewtopic.php?t=20324]Problem[/url] zu lösen.[code]def processVideo(self): print("creating video")
# Adding captions print(self.text_caption) previous_timepoint = 0 for caption, timepoint in zip(self.text_caption, self.timepoints, strict=False): # Text caption and timepooints are lists where the end of the words in text_caption correspond # to the timepoint with the same index in timepoint video_input = video_input.drawtext( text=caption, fontfile = font_path, x='w-text_w/2', y='h-text_h/2', escape_text=True, fontsize= 32, bordercolor = "black", borderw = 4, enable=f'between(t,{previous_timepoint},{timepoint["timeSeconds"]})' ) previous_timepoint = timepoint["timeSeconds"]
# Combining sound and video and writing output command = ffmpeg.output(sound_input, video_input, str(video_ouput_path), codec='copy').overwrite_output().global_args('-shortest') print("args =", command) print(command.get_args()) command.run() print("done!") < /code> File "c:\Desktop\Projects\video_project\main.py", line 239, in post_list[0].processVideo() ~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "c:\Desktop\Projects\video_project\main.py", line 223, in processVideo command.run() ~~~~~~~~~~~^^ File "C:\Desktop\Projects\video_project\.venv\Lib\site-packages\ffmpeg\_run.py", line 313, in run process = run_async( stream_spec, ...... overwrite_output=overwrite_output, ) File "C:\Desktop\Projects\video_project\.venv\Lib\site-packages\ffmpeg\_run.py", line 284, in run_async return subprocess.Popen( ~~~~~~~~~~~~~~~~^ args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "C:\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1038, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pass_fds, cwd, env, ^^^^^^^^^^^^^^^^^^^ ...... gid, gids, uid, umask, ^^^^^^^^^^^^^^^^^^^^^^ start_new_session, process_group) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1550, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^ # no special security ^^^^^^^^^^^^^^^^^^^^^ ...... cwd, ^^^^ startupinfo) ^^^^^^^^^^^^ FileNotFoundError: [WinError 206] The filename or extension is too long [/code]
Ich habe zwei .m4s-Dateien, eine nur für Videos (video.m4s):
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\video.m4s':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands:...
Ich habe nachforscht, aber meine App lädt von Zeit zu Zeit MP3 -Dateien herunter, ich bekomme seltsame Dateiname, was nicht weh tut, bis ich versuche, sie auf CD zu verbrennen. Ich verwende diesen...
Ich habe den Plantuml -Filter ausprobiert, um Latexzahlen aus dem Plantuml -Code in Markdown -Quelle zu generieren. Es funktioniert gut (ich habe es geändert, um PDF für Latex zu generieren, da es...
Derzeit versuche ich HLSJS zum Abspielen von M3U8 -Videos in meiner Webanwendung, aber wenn ich Video unabhängig vom Autoplay -Attribut lade, beginnt es zu spielen, wenn ich es zum ersten Mal lade....