23:24
I have this command that I run via cmd in a folder and it executes without problems:
for %i in (*) do ffmpeg -y -i "%i" -vcodec copy -acodec copy -map 0:v -map 0:a "%i.mp4"
Now I want to create a batch file that I can just open and it will execute this command in the current folder.
However for the life of me I cannot get anything to work.
Ive tried googling the answer and tried lots of answers from here also, but it seems my knowledge is lacking a bit.
If anyone can give any tips that would be appreciated, thanks.
I apologize beforehand if something is blatantly (...)
21:39
I'm using ffmpeg to check for errors in video files, but while it reports tons of issues it doesn't tell me where exactly the error happens in the file. It just dumps some crazy long hex numbers (0x7fa…) which doesn't tell me anything. Is there a way to make it report some timestamps, or at least estimated timestamps, or byte-offsets into the stream? I tried the -debug_ts flag, but nothing changed in the output.
$ ffmpeg -debug_ts -v error -i a_broken_file.mp4 -f null -
[h264 ⓐ 0x7fa513023400] Reference 4 >= 4
[h264 ⓐ 0x7fa513023400] error while decoding MB (...)
09:54
I am trying to add a text to a video using ffmpeg and python.
I tried to do this in the following ways, but it didn't work.
first
(
ffmpeg
.input(in_video)
.filter('drawtext',
fontsize=30,
fontfile=r"D:\\projects\\python\\editor_bot\\downloads\\Candara.ttf",
text='test test test.',
x='if (eq(mod(t\\\\, 15)\\\\, 0)\\\\, rand(0\\\\, (w-text_w))\\\\, x)',
y='if (eq(mod(t\\\\, 10)\\\\, 0)\\\\, rand(0\\\\, (h-text_h))\\\\, y)')
.output(f'output-final.mp4')
.run()
)
second
fil = (...)
08:12
I am trying to use a custom font in the subtitles of a video using ffmpeg, but despite my efforts, the font defaults to Helvetica. Here is the code I am using:
import ffmpeg
import os
import tempfile
def test_subtitle_font(font_path):
# Simple arbitrary video and audio stream
video = ffmpeg.input('color=color=black:size=640x360:duration=5', f='lavfi')
audio = ffmpeg.input('anullsrc=channel_layout=stereo:duration=5', f='lavfi')
# Create arbitrary temp subtitle file
with (...)