Etherna.YoutubeDownloader.Converter 6.2.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package Etherna.YoutubeDownloader.Converter --version 6.2.11
NuGet\Install-Package Etherna.YoutubeDownloader.Converter -Version 6.2.11
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Etherna.YoutubeDownloader.Converter" Version="6.2.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Etherna.YoutubeDownloader.Converter --version 6.2.11
#r "nuget: Etherna.YoutubeDownloader.Converter, 6.2.11"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Etherna.YoutubeDownloader.Converter as a Cake Addin
#addin nuget:?package=Etherna.YoutubeDownloader.Converter&version=6.2.11

// Install Etherna.YoutubeDownloader.Converter as a Cake Tool
#tool nuget:?package=Etherna.YoutubeDownloader.Converter&version=6.2.11

YoutubeExplode.Converter

Version Downloads

YoutubeExplode.Converter is an extension package for YoutubeExplode that provides the capability to download YouTube videos by muxing separate streams into a single file. This package relies on FFmpeg under the hood.

Install

  • 📦 NuGet: dotnet add package YoutubeExplode.Converter

Usage

YoutubeExplode.Converter exposes its functionality by enhancing YoutubeExplode's clients with additional extension methods. To use them, simply add the corresponding namespace and follow the examples below.

Warning: This package requires the FFmpeg executable to work, which can be downloaded here. Ensure that it's located in your application's probe directory or on the system's PATH, or provide a custom location directly using various overloads.

Downloading videos

You can download a video directly through one of the extension methods provided on VideoClient. For example, to download a video in the specified format using the highest quality streams, simply call DownloadAsync(...) with the video ID and the destination path:

using YoutubeExplode;
using YoutubeExplode.Converter;

var youtube = new YoutubeClient();

var videoUrl = "https://youtube.com/watch?v=u_yIGGhubZs";
await youtube.Videos.DownloadAsync(videoUrl, "video.mp4");

Under the hood, this resolves the video's media streams, downloads the best candidates based on format, bitrate, framerate, and quality, and muxes them together into a single file.

Note: If the specified output format is a known audio-only container (e.g. mp3 or ogg) then only the audio stream is downloaded.

Warning: Stream muxing is a resource-intensive process. You can improve the execution speed by making sure that both the input streams and the output file use the same format, which eliminates the need for transcoding. Currently, YouTube provides adaptive streams only in mp4 and webm containers, with the highest quality video streams (e.g. 4K) only available in webm.

Customizing the conversion process

To configure various aspects of the conversion process, use the following overload of DownloadAsync(...):

using YoutubeExplode;
using YoutubeExplode.Converter;

var youtube = new YoutubeClient();
var videoUrl = "https://youtube.com/watch?v=u_yIGGhubZs";

await youtube.Videos.DownloadAsync(videoUrl, "video.mp4", o => o
    .SetContainer("webm") // override format
    .SetPreset(ConversionPreset.UltraFast) // change preset
    .SetFFmpegPath("path/to/ffmpeg") // custom FFmpeg location
);

Manually selecting streams

If you need precise control over which streams are used for the muxing process, you can also provide them yourself instead of relying on the automatic resolution:

using YoutubeExplode;
using YoutubeExplode.Videos.Streams;
using YoutubeExplode.Converter;

var youtube = new YoutubeClient();

// Get stream manifest
var videoUrl = "https://youtube.com/watch?v=u_yIGGhubZs";
var streamManifest = await youtube.Videos.Streams.GetManifestAsync(videoUrl);

// Select streams (1080p60 / highest bitrate audio)
var audioStreamInfo = streamManifest.GetAudioStreams().GetWithHighestBitrate();
var videoStreamInfo = streamManifest.GetVideoStreams().First(s => s.VideoQuality.Label == "1080p60");
var streamInfos = new IStreamInfo[] { audioStreamInfo, videoStreamInfo };

// Download and process them into one file
await youtube.Videos.DownloadAsync(streamInfos, new ConversionRequestBuilder("video.mp4").Build());
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.3.10 172 3/23/2024
6.3.9 239 11/10/2023
6.3.8 159 8/29/2023
6.3.6 93 8/29/2023
6.3.5 158 7/3/2023
6.3.4 162 5/28/2023
6.3.3 119 5/6/2023
6.3.2 126 5/6/2023
6.2.14 128 5/3/2023
6.2.12 181 3/31/2023
6.2.11 206 3/20/2023