130 questions
-3
votes
0
answers
71
views
How to Turn image A + audio + A into Video A with the exact same attributes of Video B so both can be concatenated without encoding [closed]
I have image A and it is PNG
I have audio A and it is MP3
I have video B that can be any format, resolution, encoding, audio, etc
Now I want to turn image A + audio A into video A with the exact ...
1
vote
0
answers
37
views
Automate removing segments of a video using ffmpeg-python
I'm very new to ffmpeg and unable to wrap my head around the concepts entirely. My goal for this little script I've been working on all day is to:
Step 1: Read a list of timestamps from a text file ...
-1
votes
0
answers
32
views
Python ffmpeg: [WinError 2] The system cannot find the file specified [duplicate]
#what i did to install
pip install ffmpeg-python
#code
import ffmpeg
crop_dimensions = "640:480:0:0"
input_file = "input.mp4"
output_file = "output.mp4"
(
...
-1
votes
1
answer
41
views
How to Stream Audio from Google Cloud Storage in Chunks and Convert Each Chunk to WAV for Whisper Transcription
I'm working on a project where I need to transcribe audio stored in a Google Cloud Storage bucket using OpenAI's Whisper model. The audio is stored in WebM format with Opus encoding, and due to the ...
0
votes
1
answer
32
views
Saving frames for mov file with multiple streams using python-ffmpeg
I have a mov file with multiple video streams, and I'm trying to use ffmpeg python bindings to read each stream and save all of its frames.
To do so, I've made a code similar to this one:
import numpy ...
0
votes
0
answers
13
views
OpenCV error: "CAP_IMAGES: can't find starting number" when processing uploaded video in Streamlit
I am trying to upload a video file in Streamlit, save it, convert it to .mpg, and then process it with OpenCV. However, I’m getting an error: OpenCV error: CAP_IMAGES: can't find starting number. Here’...
0
votes
1
answer
128
views
Getting Error while trying to download youtube video by using python
Code
I'm working on a script that allows users to manually select and download separate video and audio streams from YouTube using yt-dlp. The script lists the available video and audio formats, lets ...
0
votes
0
answers
11
views
How do I create an ffmpeg-python pipeline that adds an audio (numpy) array to a set of output frames?
How do I add a numpy audio signal to a set of frames that I am sending to ffmpeg-python and storing in a file?
This code generates the proper video. But how do I add the audio data? The audio data ...
0
votes
1
answer
131
views
AttributeError: 'FilterableStream' object has no attribute 'input' - ffmpeg-python
I am a fresh programmer and I am learning the Python language.
I have been trying to design a graphical application (using tkinter and ffmpeg-python libraries) that converts an image file along with ...
-1
votes
2
answers
50
views
how i can save overlay text box with a video in gallery by using ffmpeg?
final escapedOverlayText = overlayText.replaceAll(''', '\'');
final command =
'-i $videoPath -vf "drawtext=text='$escapedOverlayText':x=10:y=10:fontsize=24:fontcolor=white" -c:a copy $...
0
votes
0
answers
70
views
ffmpeg python causing deadlock
I am facing issues using ffmpeg python to process camera frames. My first approach with process.communicate() worked well, but has latency issues.
process = (
ffmpeg
.input('...
0
votes
0
answers
150
views
Piping yt_dlp to FFMPEG using python: ffmpeg failing to recognize video data from pipe
I am trying to pipe the output of yt_dlp into a pipe used by ffmpeg which then outputs.:
def pipe_function(url):
ydl_command = [
'yt-dlp', '-f', 'bestvideo+bestaudio', '--quiet', '--no-warnings', ...
-1
votes
1
answer
84
views
How Do I Get Python To Capture My Screen At The Right Frame Rate
I have this python script that is supposed to record my screen, on mac os.
import cv2
import numpy as np
from PIL import ImageGrab
import subprocess
import time
def record_screen():
# Define the ...
0
votes
1
answer
31
views
Trying to convert code to be compatible with macOS by not using the .exe version of FFmpeg and FFmprobe. Cant open the .mp4 file when i go to run code
I am attempting to edit some code in python for extracting frames from a video (using parallel processing to make it faster) a friend created that works on windows, so that it can be used on macOS. ...
1
vote
0
answers
160
views
the "non-monotonic DTS in output stream " error while concatenation even after reencoded input files
hi I am trying to write a Python program that is trying to first edit different videos separately under the heading "intro" "story" and "byte" with the help of FFmpeg and ...
0
votes
1
answer
60
views
TypeError: source must be an AudioSource not FFmpegOpusAudio
async def play(ctx, *, link):
try:
voice_client = await ctx.author.voice.channel.connect()
voice_clients[voice_client.guild.id] = voice_client
except Exception as e:
...
1
vote
0
answers
116
views
How do I merge video, audio and subtitles together in ffmpeg via python?
I have been trying to merge a video, audio and subtitle stream in ffmepg but, since it is my first time trying it out, I am having a bit of trouble figuring out how to do so.
Goal: The output I am ...
1
vote
1
answer
488
views
Coordinates with file format .ASS
I'm grabbing my text coordinates that I want to use for the file format .ASS and for centering on a 1080 by 1920 video, I have an application that displays where the text is on the video and can ...
1
vote
1
answer
78
views
FFMPEG stream from python to browser using socketio
I want to show the video on the browser streamed by ffmpeg.
Here's the python script which i made but can't find the way to do so since i am not much into javascript. Can anyone help me please ?
...
-1
votes
1
answer
123
views
ffmpeg subtitles filter defaults to Helvetica instead of specified font
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
...
0
votes
2
answers
147
views
FFmpeg-Python command too long because of drawtext
I have a FFmpeg-Python program that puts subtitles into a video, pseudocode below:
for i in range(10000):
video= video.filter(
'drawtext', fontfile=FONT_FILE, text=cur_string, x='(w-text_w)...
0
votes
0
answers
98
views
ffmpeg python error when adding subtitles
When I run it I think there is an error with the subtitle path, but I can't solve it.
The error in terminal:
[Parsed_subtitles_0 @ 0000019bcc509780] Unable to parse option value
"...
0
votes
0
answers
77
views
How can I convert a ffmpeg command to the ffmpeg-python script?
I have a ffmpeg command for converting an audio file from .mpt to .aac and then combining it with a .mp4 video file to create a new video file, as shown below. I would like to convert these commands ...
1
vote
1
answer
254
views
Streaming audio over websockets and process it with ffmpeg, Invalid frame size error
I am building an application in Python that processes audio data on a streaming connection with WebSockets. To work with it, I need to process it with ffmpeg on the server before passing it to some ML ...
-1
votes
1
answer
62
views
define the input FPS of a stream using ffmpeg-python
Im creating an HLS playlist using ffmpeg, reading my input from an RTSP stream.
When probing the RTSP stream, i get an FPS which is not the true FPS, and i want to "tell" ffmpeg the actual ...
1
vote
1
answer
1k
views
FileNotFoundError: [WinError 2] The system cannot find the file specified - FFMPEG
I am running a script using conda environment on Windows and getting this error (stack trace below), which is apparently caused by python executable not being able to find the ffmpeg.exe. There are ...
-1
votes
1
answer
123
views
edit a video in python [closed]
I'm trying edit a MP4 video using ffmpeg-python library but I get
TypeError: 'ffmpeg' has no attribute 'input'
Here is my code, directly copied from the official repository):
import ffmpeg
x=ffmpeg....
-1
votes
1
answer
352
views
Is there an efficient way to use ffmpeg to perform a large quantity of cuts from a single file?
I'm trying to cut video files into smaller chunks. (each one being one word said in the video, so they're not all of equal size)
I've tried a lot of different approaches to try to be as efficient as ...
0
votes
1
answer
981
views
Play a video with ffmpeg and SDL2 on a Raspberry Pi 5
I want to create a python script that decodes a h264 1080p video and outputs it via SDL2 on a Raspberry Pi 5. The Raspberry Pi 5 is able to play a h264 1080p video without problem using VLC. Total CPU ...
0
votes
1
answer
200
views
Subtitels with ffmpeg-python
I'm currently working on a video processor project and aiming to generate subtitles for the videos processed.
I've found that code that combines audio, video, and adds subtitles. However, I'm ...
2
votes
0
answers
148
views
How to interpret ndarray in a pyAV AudioFrame?
I want to process streaming audio (coming in from a person speaking on the peer of a webRTC peer connection) to detect when the person is done talking. I have got the audio track and access to ...
0
votes
0
answers
37
views
FFFMPEG-Python write filters to file then use them
So I am trying to do a slide animation between a lot of files using FFMpeg Python.
for image_path, audio_path in zip(images_path, audios_path):
audio_dur = AudioSegment.from_file(audio_path)....
0
votes
0
answers
167
views
FFMPEG Python command too long
I am trying to make a program that will overlay some images with a "slide" animation.
So I am doing this with FFMPEG in my Python code, and there are lots of files and commmands since the ...
0
votes
0
answers
58
views
Trim with transition/fade using FFMPEG given a list of timestamps
I have a video and a list of timestamps that I want to filter.
[
{
"timestamp": [10, 20],
"state": true
},
{
"timestamp": [30, 40],
"state"...
0
votes
0
answers
38
views
How to Write the Numpy array video to Disk While adding Audio from File using the python ffmpegio
I Have an A NumPy array Representing the Video in the memory how Can I Use the ffmpegio python module to save it on the File on the disk While adding the audio.
I Try Many things. I Also Ask answer on ...
0
votes
0
answers
172
views
ffmpeg-python lib's 'run' function works locally but doesn't work in server
I am using ffmpeg-python library to process video, specifically I had to add watermark to video. Code is very simple:
def set_watermark_to_video(
video_url: str,
directory: str,
filename: ...
1
vote
0
answers
687
views
Python - Extracting audio from video files to numpy array using ffmpeg
I want to use python & ffmpeg-python to extract the audio from a video directly into numpy array.
Currently, I first dump the audio as a wav file using ffmpeg through CLI and read it back to ...
0
votes
0
answers
128
views
how to use ffmpegs's afir in ffmpeg-python
My goal is to slow down a file and add reverberation using python
here's my code:
import ffmpeg
audio = ffmpeg.input(r'test_files\Gorillaz - Rhinestone Eyes.mp3').audio
audio = audio.filter('...
-1
votes
1
answer
255
views
How to edit metadata using ffmpeg-python?
import ffmpeg
input= "input.mkv"
output = "output.mkv"
title = "Clinton Abraham"
try:
datas = 'title=' + title
mains = ffmpeg.input(input)
nemos = mains....
0
votes
1
answer
214
views
Is it possible to save snapshots from multiple video streams using ffmpeg?
I would like to periodically save a snapshot from a video stream using ffmpeg. This is is possible using the following command:
ffmpeg -i [source] -r 0.2 -f image2 ./image-%04d.jpeg
or the (rough) ...
1
vote
1
answer
292
views
ffmpeg mp3 chunk to wav chunk adds gap in the start of the audio
I have an mp3 streaming from a URL, I save the chunks in 1024 byes buffer size.
After I get all the chunks, I'm using ffmpeg to convert the incoming mp3 chunk (22050 mono) to a wav chunk.
When I open/...
0
votes
0
answers
95
views
Popen subprocess giving wrong ffmpeg process ID when trying to close
I'm trying to create a Video Management System application using Python and Django, that displays live camera stream and do video recording. For this, I add cameras using POST request and everything ...
0
votes
1
answer
90
views
FFMPEG: How to add transparency to watermark logo? Getting error: "Filter scale2ref has an unconnected output"
Hey guys I am new to Ffmpeg, I want to resize a watermark logo according to the video size and add transparency to it. The code I have is not working as expected.
This is the code
ffmpeg -i $...
0
votes
1
answer
440
views
Add subtitles starting at a specific timestamp using Ffmpeg-Python
I want to add a .srt file (subtitles) to a .mp4 video. How can I add the subtitles at a specific timestamp?
As an example, my .mp4 video starts the talking part at 00:00:25, so thats there where I ...
0
votes
1
answer
137
views
Discord Python Music Bot Not Playing Music
I am new to making discord bots and while I was making a music bot and run on my ubuntu server with python Venv I receive some random number while I tried to play music and the music didn't start. But ...
0
votes
1
answer
112
views
Running command Subprocess python failed but the same exact command runs well in Terminal
As the title says: weird problem. I've been struggling to make this work for a whole day but to no avail. Any help would be deeply appreciated.
# I've tried every one of the below path but still ...
2
votes
1
answer
263
views
Timeline editing with ffmpeg-python
I'm trying to draw a box on one part of the screen at a specific instance in time. I've tried looking through the documentation for ffmpeg-python, but am unable to locate any instance of support for ...
0
votes
0
answers
121
views
How can I use the 'afade' parameter in ffmpeg-python without getting an 'option not found' error?
I am using the ffmpeg library with python to add subtitles and a video as an overlay to a background still image. This code is working fine, but I want to use the afade parameter. The code without ...
1
vote
1
answer
383
views
How to use argument with dash in name in ffmpeg-python?
Following is a simple ffmpeg command line for encoding an input video into a AV1 output with CRF 30:
ffmpeg -i input.mkv -c:v libsvtav1 -crf 30 output.mkv
Converting that command line into the syntax ...
0
votes
2
answers
1k
views
How do I reverse a video in ffmpeg?
- Full Error:
Stream specifier 's1:v' in filtergraph description [0]split=2:outputs=2[s0][s1];[s1:v]reverse[s2];[s0][s2]concat=a=0:n=2:v=1[s3] matches no streams.
- Formatted Error
[0]split=2:outputs=...