Questions tagged [ffmpeg-python]

Python FFmpeg wrapper wiith complex filter support. ffmpeg-python works well for simple as well as complex signal graphs.

Python FFmpeg wrapper with complex filter support. ffmpeg-python works well for simple as well as complex signal graphs.

113 questions
9
votes
4 answers

How to combine The video and audio files in ffmpeg-python

I'm trying to combine a video(with no sound) and its separate audio file I've tried ffmpeg ffmpeg -i video.mp4 -i audio.mp4 -c copy output.mp4 and it works fine. i'm trying to achieve the same output from ffmpeg-python but with no luck. Any help on…
Isaac Wassouf
  • 93
  • 1
  • 1
  • 5
6
votes
4 answers

How to hide console output of FFmpeg in Python?

I was working on a YouTube video downloader Python program. I want to encode downloaded data to other media formats for this job i used FFmpeg and FFmpeg-Python (Package to use FFmpeg in Python). Everything is Fine but i want to ask that how can i…
Shiven Saini
  • 318
  • 2
  • 7
4
votes
1 answer

How to overlay sequence of frames on video using ffmpeg-python?

I tried below but it is only showing the background video. background_video = ffmpeg.input( "input.mp4") overlay_video = ffmpeg.input(f'{frames_folder}*.png', pattern_type='glob', framerate=25) subprocess = ffmpeg.overlay( …
Yogesh Yadav
  • 723
  • 6
  • 21
4
votes
3 answers

How to convert ffmpeg complex_filter to ffmpeg-python

I am trying to learn to convert ffmpeg command line background blur filter to ffmpeg-python format. '-lavfi' and…
v78
  • 2,803
  • 21
  • 44
4
votes
3 answers

ffmpeg Python command only runs once in PM2 environment

PM2 is running as a web user. ffmpeg was installed native to Ubuntu 16.04 LTS using sudo apt install ffmpeg. The Python version is 3.6. The software uses ffmpeg-python@0.1.17. The applications spawned produce no errors. When the ffmpeg code executes…
4Z4T4R
  • 2,340
  • 2
  • 26
  • 45
4
votes
2 answers

Python ffmpeg: overlaying videos is dropping all audio

I am using ffmpeg-python (source) to create the effect where you add a blurred background to fill in the sides of a tall vertical video as shown below: The problem is that the output has no audio attached. Since the clips are the same, I want to…
swagrov
  • 1,510
  • 3
  • 22
  • 38
3
votes
1 answer

FFmpeg Matching decibel level between two audio tracks when mixing?

I have a collection of mp3 files for various frequencies (i.e. 528hz). I also have a collection of mp3's of ambient background music. So here is the scenario: I am mixing the tone frequency mp3's with the music mp3's. This works great using the amix…
JohnWick
  • 4,929
  • 9
  • 37
  • 74
3
votes
1 answer

ffmpeg-python: Test if video clip has audio

Im using ffmpeg-python to do some video transformations. If I have the following: infiles = [] infile = ffmpeg.input("/tmp/xxx.mp4") infiles.append( infile['v'] .filter('scale', size='1920x1080', force_original_aspect_ratio='decrease') …
KingFish
  • 8,773
  • 12
  • 53
  • 81
3
votes
1 answer

How to use multi-input filters with ffmpeg-python

I want to mimic the following ffmpeg command with ffmpeg-python ffmpeg -y -i in.mp4 -t 30 -filter_complex "fps=10,scale=-1:-1:flags=lanczos[x];[0:v]palettegen[y];[x][y]paletteuse" out.gif So far, this is what I've got: in_stream = ffmpeg.input(src,…
Benjamin Barrois
  • 2,566
  • 13
  • 30
2
votes
2 answers

Python yt-dlp and ffmpeg error "merging of multiple formats but ffmpeg is not installed"

I am using the latest version of yt-dlp with Python 3.9. I am trying to download a youtube video in mp4 format with outputname as the youtubeid.mp4 and with best resolution not more than 4K. This is my Python code: ytid = '4cDqaLxrt6Q' url =…
T Tea Tie
  • 21
  • 4
2
votes
1 answer

How to drawtext with a color gradient fill with ffmpeg (ffmpeg-python)? and then mix with music?

I'd like to achieve this result (to place a text with gradint or whatever picture-fill on top of a video): So I decided to make a picture of gradient: and then with chroma-key technique transform it to this (with transparent background): and then…
2
votes
1 answer

FFmpeg-Python audio getting dropped in final video

Im trying to place a video on top of a background image but the output video is getting generated without audio. Is there any way to keep the audio as it is? def ConvertVideo(source,background,start,end,dest): stream = ffmpeg.input(source) …
oneclick
  • 91
  • 2
  • 9
2
votes
2 answers

How can I get service_name and program list by ffmpeg-python

I have a ".ts" file. It is the baseband frame of a DVBS signal which have been recorded. It has some Programs and streams. I use FFmpeg to reconstruct the streams. When I use FFmpeg, this context is shown which contains service_name. How I can…
2
votes
1 answer

How can I convert an FFmpeg command line to ffmpeg-python code?

I have this command-line code: ffmpeg -i 0.mp4 -c:v libx265 -preset fast -crf 28 -tag:v hvc1 -c:a aac -bitexact -map_metadata -1 out.mkv And I want to convert it to ffmpeg-python code in Python. But how can I do it? This is what I have done so…
kup
  • 731
  • 5
  • 18
2
votes
1 answer

ffmpeg-python extract a specific video stream, change its FPS and embed it back in the video

I have a video containing several streams. A few data and one video. I need to extract the video stream, change the frame rate, embed it back in the video (or combine all stream back to an output file) If needed, this is the list of existing…
user972014
  • 3,296
  • 6
  • 49
  • 89
1
2 3 4 5 6 7 8