Skip to content

Commit

Permalink
heck yea bud
Browse files Browse the repository at this point in the history
  • Loading branch information
deanveloper committed Apr 19, 2022
1 parent cfb2205 commit 84ae86c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ a personal project to make an ffmpeg wrapper that trims videos, sets target file

## usage

`ddmpeg -i <input> -o <output> [-r <range>] [-ts <size>] [-d]`
`ddmpeg -i <input> -o <output> [-r <range>] [-s <size>] [-m <1[,...]>] [-d]`

| flag | description | usage |
| --------------- | -------------------------------------------------------------------------------------------------- | ---------------- |
Expand All @@ -24,7 +24,30 @@ a personal project to make an ffmpeg wrapper that trims videos, sets target file
- Trim video to include everything after 4mins 34.3secs
- `ddmpeg -i in.mp4 -o out.mp4 -r 4m34.3s:`
- Trim video to only include the first 30 seconds
- `ddmpeg -i in.mp4 -o out.mp4 -r 30s:`
- `ddmpeg -i in.mp4 -o out.mp4 -r :30s`

#### audio stuff

- Merge audio tracks with equal weights
- `ddmpeg -i in.mp4 -o out.mp4 -m 1`
- Merge audio tracks, with the second track being louder than the first
- `ddmpeg -i in.mp4 -o out.mp4 -m 1,5`
- Suitable for sharing clips but you don't want to break people's headphones with your screaming
- `ddmpeg -i in.mp4 -o out.mp4 -d` (dampens loud noises)

#### set target size

- Try to shoot for a 30MB video
- `ddmpeg -i in.mp4 -o out.mp4 -s 30m`

#### putting it all together

- Share your Valorant clip!
- Your clipping software captures 5 minutes, but you only want the last 30 seconds.
- The first audio stream has your desktop sounds, and the second audio stream has your microphone sounds.
- Your microphone was pretty loud, so you want to make sure that has less weight when we mix the streams.
- You're going to share this on Discord, so you can't let it go over 100MB
- `ddmpeg -i in.mp4 -o out.mp4 -t 4m30s: -m 3,1 -s 75m`

## installation (from source)

Expand Down
2 changes: 1 addition & 1 deletion ffwrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export async function* trim(options: TrimArgs): AsyncGenerator<number> {
const startArgs = start ? ["-ss", start.toString(10)] : [];
const endArgs = end ? ["-to", end.toString(10)] : [];
const bitrateArgs = bitrate ? ["-b:v", bitrate.toString(10)] : [];
const dampenArgs = dampenAudio ? ["-af", "loudnorm"] : [];
const audioWeightsArgs = parseAudioWeightsArgs(audioWeights);
const dampenArgs = dampenAudio ? ["-af", "loudnorm"] : [];

const cmd = [
"ffmpeg",
Expand Down

0 comments on commit 84ae86c

Please sign in to comment.