diff --git a/README.md b/README.md index 047280c..fc126e6 100644 --- a/README.md +++ b/README.md @@ -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" diff --git a/src/CommandLineParser.ts b/src/CommandLineParser.ts index d0529e4..e9cee0b 100644 --- a/src/CommandLineParser.ts +++ b/src/CommandLineParser.ts @@ -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', diff --git a/src/destreamer.ts b/src/destreamer.ts index a0f5d76..288c515 100644 --- a/src/destreamer.ts +++ b/src/destreamer.ts @@ -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();