New answers tagged

0 votes

concat two videos with same format

First convert the intro video to match the main video: ffmpeg -i 1.mp4 -c:v libx265 -vtag hvc1 -c:a copy 1_.mp4 then change the conc.txt list to match 1_.mp4 or delete 1.mp4 and rename 1_.mp4 to 1....
1 vote

AV1 encoding with ffmpeg

The FFmpeg wiki mentions that there are now three software AV1 encoders in FFmpeg: libaom, SVT-AV1, and rav1e. It also claims that "[in] 2020, SVT-AV1 was adopted by AOMedia as the basis for the ...
0 votes

Processing YouTube video in ffmpeg

The answer to this is yes it is possible. You need to use PageSpeed Insights API. Use the Youtube API to showcase the video with a start and end time in a unique page, then allow PageSpeed Insights ...
0 votes

How to download sections from youtube videos from command line with bad internet

There are some (arguably) better forms of the ffmpeg command/arguments that could be used - although, admittedly, this still doesn't address the reconnection issue. From Reddit - How to download ...
  • 2,158
0 votes

ffmpeg -filter_complex "pad,overlay" makes file with 2 video

You have two maps in your command, and the first map maps the original video stream. The output from the filter complex is the 2nd video stream in the output. You should label all pads in the filter ...
  • 33.1k
0 votes

ffmpeg not working using h264_vaapi

What I do is use ffmpeg -hwaccel vaapi -i "infile" -vf scale=-2:size outfile.mp4 -vf scale=-2:1024,fps=fps=1/6 screenshots/%.jpg and I get errors because I am using a nvidia video card and ...
  • 1
0 votes

How can I use ffmpeg to mute only 2 channels?

You can use ffmpeg -v error -y -i original.mxf -map 0:v -filter_complex "[0:3]volume=enable='between(t,1,60)':volume=0[a5];[0:4]volume=enable='between(t,1,60)':volume=0[a6]" -map 0:1 -map 0:...
0 votes

Need help echoing audio sound cards to a text file in a dos bat

@echo off & cd /d "%~dp0" set "_cnt=1" set "_ffmpeg=C:\Program Files\ffmepg\bin\ffmpeg.exe" set "_arg=-hide_banner -list_devices true -f dshow -i dummy" ...
  • 7,043
0 votes
Accepted

FFmpeg command not producing desired video duration from image sequence

If you add to command line -framerate this will make what you want. The command will be: ffmpeg -pattern_type glob -framerate 5/8 -i '*_0[0-5].png' -r 25 -t 8 -c:v libx264 -pix_fmt yuv420p output.mp4 ...
  • 4,264
0 votes

Using ffmpeg to copy metadata from one file to another

When using ffmpeg at a file which has metadata (like a title) in its streams, you need to use -map_metadata again, as it will not hold those metadata in the new output
0 votes

FFmpeg scale+rotate+crop animation

I'll put it here so I don't forget: #!/bin/bash WID=1280 HEI=720 FPS=24000/1001 ffmpeg \ -ss 0.00 -to 1.00 -i input.mp4 \ -ss 1.00 -to 1.04 -i input.mp4 \ -ss 1.00 -to 2.80 -i input.mp4 \ -...
0 votes

Generate preview thumbnail (sample) using ffmpeg?

const NodeTerminal = require("child_process").exec; const { v4: uuidv4 } = require("uuid"); //mini video NodeTerminal( ffmpeg -i input.mp4 -s 320x240 -vf "select='between(t,5,...
  • 1
0 votes

FFMPEG Not Accepting Set Variable %~n1

The syntax issue about Set FF=%%~nG is resolved. But the second problem is not resolve and will be resubmitted to the group. The script %FF%.mp4 fails to pass which is in: ffmpeg -loop 1 -i out.png -c:...
  • 23
1 vote

How to answer 'yes' automatically to prompts in a recursive powershell loop?

For Remove-Item not to prompt, add the following parameters: -Force -Confirm:$false Reference : How can I delete files with PowerShell without confirmation?
  • 437k
0 votes
Accepted

FFMPEG Not Accepting Set Variable %~n1

The syntax for extracting the file-name part without extension or path for the loop variable of the FOR command is as follows: Set FF=%%~nG You need two percent characters inside the loop, rather ...
  • 437k
0 votes
Accepted

How to resize multiple videos inside nested folders using ffmpeg?

This PowerShell command should work for you: Get-ChildItem -Filter *.mp4 -Recurse | % { ffmpeg -i $_.FullName -vf "scale='if(gt(ih,iw),300,-2)':'if(gt(iw,ih),300,-2)'" "$($_.FullName)...
1 vote
Accepted

Trying to trim a WAV file with ffmpeg yields a "Unable to find a suitable output format" error

Try telling it to output to wav explicitly by adding -f wav ffmpeg -i /path/to/filename.wav -vn -acodec copy -ss 00:00:00 -t 00:13:00 /path/to/filename-0.wav
  • 415
0 votes

How to set the number of B frames in FFmpeg for H.265 encoding?

For ffmpeg you can use the -bf command to change the number of B frames between two frames. In your case you can use -bf 0
0 votes

independent rotation of each half of dual fisheye Gear360 video

Here is the best reference on using FFMPEG. You will see how to convert dual fisheye images to equirectangular and align image to desired orientation. The alternative is to use Mistika Boutique by SGO ...
  • 23
0 votes
Accepted

FFMPEG GT() Not Working

I identified two problems: gt() not working FOR %%G IN (Eqr_360_????.jpg) DO ( conflicts with gt() parentheses as quotes do not protect gt() nor does ^. Solution for problem 1) was resolved by ...
  • 23
0 votes

Mix arbitrary number of audio files into single stereo audio file using ffmpeg

For future reference: As said by llogan you need amerge first: ffmpeg -i input1.mp3 -i input2.mp3 -filter_complex "[0:a][1:a]amerge=inputs=2[a]" -map "[a]" -ac 2 output.mp3
0 votes

How to use ffmpeg to add metadata to an AAC file without reencoding?

This has been fixed many years ago according to this ticket. use the option -write_apetag ex: ffmpeg -i video.mp4 -vn -acodec copy -write_apetag 1 -metadata title="My Title" audio.aac
2 votes
Accepted

How to merge series of ffmpeg commands?

not script: ffmpeg \ -ss 666 -to 671 -i "input.mkv" \ -ss 671 -to 762 -i "input.mkv" \ -ss 762 -t 5 -i "input.mkv" \ -i logo.png \ -filter_complex " [1:v]setpts=PTS/...
0 votes

How to merge series of ffmpeg commands?

I think a script is your best bet here. Extract The first task sounds like it has specific perimeters that change with each project. You could write an interactive script that asks you how many videos ...
  • 415
0 votes

ffmpeg convert directory GIF in linux

The following example should do what you want. for f in /path/to/gifs/*.gif; do ffmpeg -i "$f" -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" "/...
  • 11
0 votes

Why many fonts don't work with ffmpeg subtitles?

fontsdir=CopperplateGothicStd-33BC.otf You are specifying a font file. The fontsdir option requires a path (e.g. c:\myfonts\ ) not a file.
  • 4,122
1 vote

Ffmpeg how merge or blend two images into one

Solving my own question. I seem to have started on the complicated track. Here is the simple solution using command CROP. FOR %%G IN (360_????.jpg) DO ( REM Crop image 5792x2896 to smaller size 1448:...
  • 23
0 votes

FFmpeg encoding for meta data wrong – need it in UTF8

I'm using a batch file to add subtitles to a media file using ffmpeg. For French-Forced subtitles I have following line : -metadata:s:s:%subMap0% language=fre -metadata:s:s:%subMap0% title="...
0 votes

ffmpeg loudnorm 2pass in single line

Starting from petermg suggestion, this is the equivalent for *nix users: ffmpeg -i $input -filter:a loudnorm=print_format=json -f null /dev/null 2>&1 >/dev/null | sed -n '/{/,/}/p' > /tmp/...
0 votes

Tried vcpkg install ffmpeg and found strange test.exe file is it a virus or not?

This is a false positive. You need not worry. Many “Linux-y” software projects use autoconf. These projects have a configure script. While the configure script is running, the C/C++ compiler may be ...
  • 57.9k
1 vote
Accepted

How can a color blindness simulation in FFmpeg be done?

You can use LUT for simulate different types of colour blindness. You can get these LUTs from here for example. And then apply one of them to specific video file adding lut3d filter: ffmpeg -i "...
  • 4,264
1 vote
Accepted

How does FFmpeg's versioning scheme work?

The FFmpeg versioning uses the "major.minor.patch" format. The major number is incremented for major releases with significant changes, the minor number for smaller feature releases, and the ...
  • 64
0 votes

ffmpeg using multiple GPUs of same model and performance, but different usage

You're looking in the wrong place. NVENC doesn't use the CUDA cores of the GPU. In your screenshot, "ENC" is show as 100% on device 0 and 97% on device 1.
  • 304
0 votes

FFMPEG: How to select X evenly spaced frames from a variable-length video including the first & last frame

If you want to save - let's say - the first, the last, and every 51th frame of a 25 fps video, you should try: $ ffmpeg -i <your-input> -ss 0.0 -vframes 1 -y first.png -vf fps=25/51 -y 51th_%02d....
  • 111
0 votes

FFmpeg writing to uncompressed numbered files

Select rawvideo video codec: ffmpeg -i input.mov -vcodec rawvideo -f image2 -pix_fmt yuv422p16le -pattern_type sequence output.%04d.yuv When video codec is unspecified, FFmpeg selects a default codec....
  • 1,137
1 vote

Why can't I use between function to slow down video with ffmpeg?

Your setpts expression leaves a gap after t=3. This is the mapping from input to output timestamps: 0 --> PTS --> 0 1 --> PTS --> 1 2 --> PTS --> 2 3 --> PTS*3 --> 9 4 --&...
  • 33.1k
0 votes

In ffmpeg, how to delay only the audio of a .mp4 video without converting the audio?

A method that works without ffmpeg having to read and process the file twice is to use a so-called complex filter that manipulates the presentation timestamps of either the video or audio tracks. The ...
0 votes

ffmpeg windows convert all images in a directory to a video file

You need to use -pattern_type glob to select images that way. See examples in documentation
0 votes
Accepted

Slowly speed up audio track

Audacity has Sliding Stretch tool for the purpose.
  • 4,086
2 votes

ffmpeg: How to zoom a video for few seconds in particular area?

Since each step is explained better in other answers I'll just link them in this post: Slice the video into N parts using this answer. Then use this answer to zoom required part(s). Merge all parts ...

Top 50 recent answers are included