I am getting an error "Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_drawtext_3" for the below command, I don't know where it is going wrong. Can anyone help with this issue?
ffmpeg -i test.png -i test.mp4 -y -filter_complex [1:v]scale=1152:648[scale0];[scale0]rotate=0:c=black#0:ow=rotw(0):oh=roth(0)[rotate0];[0:v][rotate0]overlay=304.2:172.29;drawtext=fontfile=test.ttf:text=hi text:fontsize=40:fontcolor=white:x=426.05:y=852.04 -pix_fmt yuv420p est.mp4
ffmpeg -y -i test.png -i test.mp4 -filter_complex "[1:v]scale=1152:648,rotate=0:c=black#0:ow=rotw(0):oh=roth(0)[rotate0];[0:v][rotate0]overlay=304.2:172.29,drawtext=fontfile=test.ttf:text='hi text':fontsize=40:fontcolor=white:x=426.05:y=852.04,format=yuv420p" est.mp4
Join simple filters with a comma. This makes a filterchain.
Join filterchains or complex filters with a semicolon (;).
Wrap the filtergraph (the complete line of filters) in double quotes (") and the drawtext text in single quotes (').
Related
I am trying to put a logo in an rtmp stream using ffmpeg. My version of ffmpeg is ffmpeg version 4.3.1 Currently in my complex filter I have:
ffmpeg -re -i 'video.mp4' -filter_complex "tpad=start_duration=10:stop_duration=15:start_mode=add:color=black:stop_mode=add" -f flv rtmp://example.com/a/stream
And it works! But when I add :overlay=0:0 at the end:
ffmpeg -re -i 'video.mp4' -i image.jpeg -filter_complex "tpad=start_duration=10:stop_duration=15:start_mode=add:color=black:stop_mode=add:overlay=0:0" -f flv rtmp://example.com/a/stream
I get the errors:
[Parsed_tpad_0 # 0x555bc5d99f40] Option 'overlay' not found
[AVFilterGraph # 0x555bc5e7a980] Error initializing filter 'tpad' with args 'start_duration=10:stop_duration=15:start_mode=add:color=black:stop_mode=add:overlay=0:0'
Error initializing complex filters.
Option not found
What might I be doing wrong?
ffmpeg -re -i 'video.mp4' -i image.jpeg -filter_complex "tpad=start_duration=10:stop_duration=15:start_mode=add:color=black:stop_mode=add[bg];[bg][1]overlay" -f flv rtmp://example.com/a/stream
The overlay filter requires 2 inputs but you are only giving it 1.
Filters in the same linear chain are separated by commas (,) and distinct linear chains of filters are separated by semicolons (;). See FFmpeg Filtering Introduction.
I'm trying to concat multiple videos with ffmpeg, im using a text file as input but im getting "Files.txt: Invalid data found when processing input".
My command:
ffmpeg -i Files.txt -filter_complex "[0:v]fps=25,format=yuv420p,setpts=PTS-STARTPTS[v0];[0:a]aformat=sample_rates=44100:channel_layouts=stereo,asetpts=PTS-STARTPTS[a0];[1:v]fps=25,format=yuv420p,setpts=PTS-STARTPTS[v1];[1:a]aformat=sample_rates=44100:channel_layouts=stereo,asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1" -movflags +faststart output.mp4
My text file:
file '1.mp4'
file '2.mp4'
Only the concat demuxer accepts a text file list
Either use the concat demuxer:
ffmpeg -f concat -i input.txt output.mp4
Or list the inputs normally and use the concat filter:
ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "[0:v]fps=25,format=yuv420p,setpts=PTS-STARTPTS[v0];[0:a]aformat=sample_rates=44100:channel_layouts=stereo,asetpts=PTS-STARTPTS[a0];[1:v]fps=25,format=yuv420p,setpts=PTS-STARTPTS[v1];[1:a]aformat=sample_rates=44100:channel_layouts=stereo,asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1" -movflags +faststart output.mp4
You can't use a text file listing inputs unless you use the concat demuxer as shown above, or if you use some capability in your shell to interpret the list as inputs. ffmpeg has no such feature.
It's likely that you have your file is encoded in a non UTF-8 encoding. Try to save the file in UTF-8 encoding.
I have read this question in toppic:
FFMPEG overlay two video and add text
ffmpeg -i raw_video.mp4 -i watermark.png -i watermark2.png -filter_complex [0:v]drawtext=fontfile=font.ttf:text='text1':fontcolor=black#1.0:fontsize=24:x=20:y=259, drawtext=fontfile=font.ttf:text='text2':fontcolor=black#1.0:fontsize=24:x=500:y=500[text]; [text][1:v]overlay=215:0[ol1];[ol1][2:v]overlay=400:300[filtered]"-map "[filtered]" -codec:v libx264 -codec:a copy output.mp4 "
I try to using this ffmpeg but it error .
Please help me
Your first command
Problem 1: The command has a trailing " resulting in an error:
[AVFilterGraph # 0x55f096873c40] No such filter: ''
Error initializing complex filters.
Invalid argument
Remove the trailing ".
Problem 2: Missing space
Change [filtered]"-map to [filtered]" -map.
Problem 3: Filtergraph not quoted
Enclose the filtergraph in quotes: "[0:v]drawtext...overlay=400:300[filtered]"
Your second command
Problem: Unlabeled filterchain is ignored
Change enable='between(t,0,20)';[v]drawtext to enable='between(t,0,20)',drawtext and read Filtering Introduction and Filtergraph description.
Trying to get ffmpeg to create an audio waveform while being able to control the image size, color, and amplitude. I have tried this (and many variations) but it just returns unmatched " .
ffmpeg -i input -filter_complex "aformat=channel_layouts=mono,compand=gain=-3,showwavespic=s=1000x350,color=s=1000x350:color=A072FD” -frames:v 1 output.png
Thoughts?
Use
ffmpeg -i input -filter_complex
"aformat=channel_layouts=mono,
compand=gain=-3,
showwavespic=s=1000x350:colors=A072FD"
-frames:v 1 output.png
Your closing quote is curly which doesn't match the opening straight quote. Besides that, by putting a , after s=1000x350, you prematurely terminated the arguments for showwavespic.
I know it’s possible to get a part of a file using the command:
ffmpeg -ss 00:02:00.000 -i input.mp4" -t 00:00:05.000 out.mp4
But is it possible to combine multiple videos with text and other effects?
I want to create a output from the following
File1.mp4:
Read from 00:02:00.000 to 00:02:05.000
File2.mp4
Read from 00:00:00.000 to 00:01:30.000
Insert overlay image “logo.png” for 20 seconds
File3.mp4
Insert the whole file
Insert text from 00:00:10.000 to 00:00:30.000
It can be done with FFmpeg, but it isn't really an 'editor' so the command will get long, unwieldy and prone to execution errors the more the number of input clips and effects you apply.
That said, one way to do this is using the concat filter.
ffmpeg -i file1.mp4 -i file2.mp4 -i file3.mp4 -loop 1 -t 20 -i logo.png \
-filter_complex "[0:v]trim=120:125,setpts=PTS-STARTPTS[v1];
[1:v]trim=duration=90,setpts=PTS-STARTPTS[vt2];
[vt2][3:v]overlay=eof_action=pass[v2];
[2:v]drawtext=enable='between(t,10,30)':fontfile=font.ttf:text='Hello World'[v3];
[0:a]atrim=120:125,asetpts=PTS-STARTPTS[a1];
[1:a]trim=duration=90,setpts=PTS-STARTPTS[a2];
[v1][a1][v2][a2][v3][2:a]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4
I haven't specified any encoding parameters like codec or bitrate..etc. Assuming you're familiar with those. Also, haven't specified arguments for overlay or drawtext like position..etc. Consult the documentation for a guide to those.