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]
--noCleanup, --nc Don't delete the downloaded video file when an FFmpeg
error occurs [boolean] [default: false]
--encodeVideo, --ev Encode the video with a specify encoder. Set to
"none" to disable video. [string] [default: "copy"]
--encodeAudio, --ea Encode the audio with a specify encoder. Set to
"none" to disable audio. [string] [default: "copy"]
--format, -F The file format of the output file(s)
--vcodec Re-encode video track. Specify FFmpeg codec (e.g.
libx265) or set to "none" to disable video.
[string] [default: "copy"]
--acodec Re-encode audio track. Specify FFmpeg codec (e.g.
libopus) or set to "none" to disable audio.
[string] [default: "copy"]
--format The file format of the output file(s)
[string] [default: "mkv"]
```
We default to `.mkv` for the output container. If you prefer something else (like `mp4`), pass `--format mp4`.
Download a video -
```sh
$ ./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 -
```sh
$ ./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,
demandOption: false
},
encodeVideo: {
alias: 'ev',
describe: 'Encode the video with a specify encoder. Set to "none" to disable video.',
vcodec: {
describe: 'Re-encode video track. Specify FFmpeg codec (e.g. libx265) or set to "none" to disable video.',
type: 'string',
default: 'copy',
demandOption: false
},
encodeAudio: {
alias: 'ea',
describe: 'Encode the audio with a specify encoder. Set to "none" to disable audio.',
acodec: {
describe: 'Re-encode audio track. Specify FFmpeg codec (e.g. libopus) or set to "none" to disable audio.',
type: 'string',
default: 'copy',
demandOption: false
},
format: {
alias: 'F',
describe: 'The file format of the output file(s)',
type: 'string',
default: 'mkv',

View file

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