m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/ffmpeg.md
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg.md')
-rw-r--r--ffmpeg.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/ffmpeg.md b/ffmpeg.md
index 7495cb0..b87ab63 100644
--- a/ffmpeg.md
+++ b/ffmpeg.md
@@ -1,5 +1,11 @@
# ffmpeg tricks
+## Convert
+
+Works for audio, too.
+
+ ffmpeg -i in.EXT1 out.EXT2
+
## Cut
ffmpeg -i in.mp4 -codec:v copy -codec:a copy -ss START_TIME -t DURATION out.mp4
@@ -11,6 +17,15 @@
# -1 means to automatically preserve aspect ratio
ffmpeg -i in.mp4 -filter:v scale=720:-1 out.mp4
+## Audio/video delay
+
+ ffmpeg -i "$input" -itsoffset <offset in seconds> -i "$input" -map 1:v -map 0:a -c:a copy -c:v libx264 "$output"
+
+For reverse offset, swap 1 and 0.
+
+Basically, take the input once with an offset, once without. Take the audio from
+one of them, video from the other.
+
## Rotate
# 90 degrees clockwise
@@ -52,3 +67,11 @@ For the transpose parameter you can pass:
[in1] ... [ink] filter_name=option1=val1:...:optionn=valn [out1] ... [outm]
* Use `-filter_complex` if more than one input or output stream.
+
+## Video file info
+
+Just running
+
+ ffmpeg -i video.mp4
+
+will fail, but give a bunch of info about the file (including resolution, fps, etc)