Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ffmpeg.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ category: CLI
-codecs # list codecs
-c:v # video codec (-vcodec) - 'copy' to copy stream
-c:a # audio codec (-acodec)
-ss # Stream Seek (90 = 1min 30sec, 01:00:00 = 1hr)
-t # Time Duration (10 for first 10 sec)
```

```bash
Expand All @@ -29,6 +31,8 @@ category: CLI
-r RATE # frame rate per sec
-s WIDTHxHEIGHT # frame size
-vn # no video
-pix_fmt FORMAT # Pixel Format (yuv420p, yuv420p10le)
-crf LEVEL # Constant rate factor (0-51 lower value for high quality)
```

### Audio
Expand All @@ -48,6 +52,19 @@ category: CLI
```bash
ffmpeg -i foo.mp3 -ac 1 -ab 128000 -f mp4 -acodec libfaac -y target.m4r
```
### Stream Selection in ffmpeg

```bash
ffmpeg -i input1.mp4 -i input2.mp4 -map 0:v:0 -map 1:a:0 output.mp4
# To create output file with video from 1st file & audio from 2nd file.

ffmpeg -i input1.mp4 -i input2.mp3 -map 0:v -map 1:a output.mkv
# To create output file with all video streams from 1st file & audio streams from 2nd file.

# -map [INPUT_FILE_INDEX]:[STREAM_SPECIFIER]
# -map [INPUT_FILE_INDEX]:[STREAM_SPECIFIER]:[STREAM_INDEX]
```


### To web

Expand Down