YoutubeExplode.Converter 6.2.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package YoutubeExplode.Converter --version 6.2.9                
NuGet\Install-Package YoutubeExplode.Converter -Version 6.2.9                
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="YoutubeExplode.Converter" Version="6.2.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add YoutubeExplode.Converter --version 6.2.9                
#r "nuget: YoutubeExplode.Converter, 6.2.9"                
#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 YoutubeExplode.Converter as a Cake Addin
#addin nuget:?package=YoutubeExplode.Converter&version=6.2.9

// Install YoutubeExplode.Converter as a Cake Tool
#tool nuget:?package=YoutubeExplode.Converter&version=6.2.9                

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 (1)

Showing the top 1 NuGet packages that depend on YoutubeExplode.Converter:

Package Downloads
MP3DL.lib

Package Description

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on YoutubeExplode.Converter:

Repository Stars
Tyrrrz/YoutubeDownloader
Downloads videos and playlists from YouTube
crobibero/jellyfin-plugin-tmdb-trailers
Version Downloads Last updated
6.4.3 1,861 10/3/2024
6.4.2 1,358 9/27/2024
6.4.1 818 9/18/2024
6.4.0 3,196 7/25/2024
6.3.16 4,455 5/21/2024
6.3.15 230 5/18/2024
6.3.14 1,562 4/27/2024
6.3.13 2,247 2/22/2024
6.3.12 3,823 1/18/2024
6.3.11 860 1/4/2024
6.3.10 640 12/27/2023
6.3.9 1,238 11/29/2023
6.3.8 924 11/23/2023
6.3.7 912 11/9/2023
6.3.6 1,150 10/17/2023
6.3.5 1,000 9/28/2023
6.3.4 1,291 9/6/2023
6.3.3 1,325 8/31/2023
6.3.2 1,016 8/18/2023
6.3.2-alpha1 599 7/30/2023
6.3.1 1,447 7/23/2023
6.3.0 681 7/20/2023
6.2.17 1,164 7/12/2023
6.2.16 1,222 6/28/2023
6.2.15 1,627 5/25/2023
6.2.14 1,982 5/2/2023
6.2.13 1,050 4/27/2023
6.2.12 1,767 3/31/2023
6.2.11 979 3/24/2023
6.2.10 816 3/17/2023
6.2.9 1,004 3/10/2023
6.2.8 5,304 3/1/2023
6.1.0 107,945 2/19/2022
6.0.8 13,622 2/10/2022
6.0.7 119,103 12/10/2021
6.0.6 4,650 12/9/2021
2.1.0 342,591 4/18/2021
2.0.2 2,557 12/26/2020
2.0.1 890 12/26/2020
2.0.0 2,641 10/14/2020
1.5.1 3,673 4/22/2020
1.5.0 1,243 4/13/2020
1.4.4 971 4/12/2020
1.4.3 3,948 7/27/2019
1.4.2 1,794 5/12/2019
1.4.1 1,698 3/3/2019
1.4.0 1,762 1/17/2019
1.3.0 1,194 1/16/2019
1.2.0 1,220 1/9/2019
1.1.0 1,153 1/8/2019
1.0.3 1,350 12/20/2018
1.0.2 1,217 12/17/2018
1.0.1 1,825 10/27/2018
1.0.0 1,276 10/27/2018