Renamed re-encoding parameters, amended README

This commit is contained in:
snobu 2020-05-02 16:58:20 +03:00
parent c21fb96ff6
commit 8902ccef80
3 changed files with 20 additions and 14 deletions

View file

@ -82,19 +82,28 @@ Options:
[boolean] [default: false] [boolean] [default: false]
--noCleanup, --nc Don't delete the downloaded video file when an FFmpeg --noCleanup, --nc Don't delete the downloaded video file when an FFmpeg
error occurs [boolean] [default: false] error occurs [boolean] [default: false]
--encodeVideo, --ev Encode the video with a specify encoder. Set to --vcodec Re-encode video track. Specify FFmpeg codec (e.g.
"none" to disable video. [string] [default: "copy"] libx265) or set to "none" to disable video.
--encodeAudio, --ea Encode the audio with a specify encoder. Set to [string] [default: "copy"]
"none" to disable audio. [string] [default: "copy"] --acodec Re-encode audio track. Specify FFmpeg codec (e.g.
--format, -F The file format of the output file(s) libopus) or set to "none" to disable audio.
[string] [default: "copy"]
--format The file format of the output file(s)
[string] [default: "mkv"] [string] [default: "mkv"]
``` ```
We default to `.mkv` for the output container. If you prefer something else (like `mp4`), pass `--format mp4`.
Download a video - Download a video -
```sh ```sh
$ ./destreamer.sh -i "https://web.microsoftstream.com/video/VIDEO-1" $ ./destreamer.sh -i "https://web.microsoftstream.com/video/VIDEO-1"
``` ```
Download a video and re-encode with HEVC (libx265):
```sh
$ ./destreamer.sh -i "https://web.microsoftstream.com/video/VIDEO-1" --vcodec libx265
```
Download a video and speed up the interactive login by automagically filling in the username - Download a video and speed up the interactive login by automagically filling in the username -
```sh ```sh
$ ./destreamer.sh -u user@example.com -i "https://web.microsoftstream.com/video/VIDEO-1" $ ./destreamer.sh -u user@example.com -i "https://web.microsoftstream.com/video/VIDEO-1"

View file

@ -62,22 +62,19 @@ export const argv = yargs.options({
default: false, default: false,
demandOption: false demandOption: false
}, },
encodeVideo: { vcodec: {
alias: 'ev', describe: 'Re-encode video track. Specify FFmpeg codec (e.g. libx265) or set to "none" to disable video.',
describe: 'Encode the video with a specify encoder. Set to "none" to disable video.',
type: 'string', type: 'string',
default: 'copy', default: 'copy',
demandOption: false demandOption: false
}, },
encodeAudio: { acodec: {
alias: 'ea', describe: 'Re-encode audio track. Specify FFmpeg codec (e.g. libopus) or set to "none" to disable audio.',
describe: 'Encode the audio with a specify encoder. Set to "none" to disable audio.',
type: 'string', type: 'string',
default: 'copy', default: 'copy',
demandOption: false demandOption: false
}, },
format: { format: {
alias: 'F',
describe: 'The file format of the output file(s)', describe: 'The file format of the output file(s)',
type: 'string', type: 'string',
default: 'mkv', default: 'mkv',

View file

@ -217,8 +217,8 @@ async function downloadVideo(videoUrls: string[], outputDirectories: string[], s
['headers', headers] ['headers', headers]
])); ]));
const ffmpegOutput = new FFmpegOutput(outputPath, new Map([ const ffmpegOutput = new FFmpegOutput(outputPath, new Map([
argv.encodeAudio === 'none' ? ['an', null] : ['c:a', argv.encodeAudio], argv.acodec === 'none' ? ['an', null] : ['c:a', argv.acodec],
argv.encodeVideo === 'none' ? ['vn', null] : ['c:v', argv.encodeVideo] argv.vcodec === 'none' ? ['vn', null] : ['c:v', argv.vcodec]
])); ]));
const ffmpegCmd = new FFmpegCommand(); const ffmpegCmd = new FFmpegCommand();