Comments (5)
Convert video to gif
ffmpeg -y -i input.flv -filter_complex "fps=4,scale=1920:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=256[p];[s1][p]paletteuse=dither=bayer" output.gif
scale
and max_colors
impact the output gif's size
from blog-post-issues.
Concat (w/o re-encode - fast)
- ref
- input: A.mp4, B.mp4, C.mp4, ...
ffmpeg -safe 0 -f concat -i <(find . -type f -name '*.mp4' -printf "file '$PWD/%p'\n" | sort) -c copy output.mp4
Concat (w/ re-encode - slow)
- remove
-c:v h264_nvenc
if there is no GPU driver
ffmpeg -i A.mp4 -i B.mp4 -filter_complex "concat=n=2:v=1:a=1" -c:v h264_nvenc output.mp4
if error when different DAR
[Parsed_concat_4 @ 0x55c55ae4d400] Input link in0:v0 parameters (size 1280x720, SAR 1:1) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 8001:8000)
[Parsed_concat_4 @ 0x55c55ae4d400] Failed to configure output pad on Parsed_concat_4
Error reinitializing filters!
Correct the aspect of one of videos first.
ffmpeg -i tmpA.mp4 -aspect 16:9 -c copy A.mp4
from blog-post-issues.
Convert webp images into jpeg format
find . -iname '*.webp' -exec bash -c 'ffmpeg -y -hide_banner -loglevel error -i "$1" -q:v 1 -qmin 1 -qmax 1 "${1%.*}.jpg"; printf "$1\n"' _ {} \;
轉換完後刪除原檔
find . -iname '*.webp' -exec bash -c 'ffmpeg -y -hide_banner -loglevel error -i "$1" -q:v 1 -qmin 1 -qmax 1 "${1%.*}.jpg"; printf "$1\n" && rm "$1"' _ {} \;
from blog-post-issues.
Reduce file size
-crf N
: N: 0–51, where 0 is lossless, 23 is the default, and 51 is worst quality possible-b 800k
: limit the bitrate (optional)
ffmpeg -i input.flv -c:v h264_nvenc -crf 30 -c:a aac -b:a 192k -vf format=yuv420p -movflags +faststart output.mp4
from blog-post-issues.
Combine video and audio
ffmpeg -i video.mp4 -i audio.m4a -c copy -map 0:v:0 -map 1:a:0 output.mp4
optional
yt-dlp -F {youtube url}
from blog-post-issues.
Related Issues (20)
- apt list installed packages with time
- _tkinter.TclError: bitmap not defined when using pyinstaller
- ConfigParser: use newline in INI file not working
- ssh with nautilus sftp
- enfuse: image focus stacking tool HOT 1
- Must do after installing ubuntu Extension HOT 1
- C++ pimpl (Pointer to IMPLementation)
- Get file from GitHub via url
- Bibtex in Hugo
- Setup include path in vscode with clangd
- Use LDAC/aptX on Ubuntu 20.04
- View webcam feed in terminal
- C++ enum to its value
- C convert long integer to bytes (binary)
- Get host name by IP
- Use exiftool to group photos by their date HOT 1
- nobuild vs onlybuild
- Convert pdf to png in windows
- Windows Defender won’t open in Windows 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog-post-issues.