Skip to content

How to open Video with External Audio? #382

Closed Answered by SuRGeoNix
SuRGeoNix asked this question in Q&A
Discussion options

You must be logged in to vote
Task.Run(() =>
{
    var res = Player.Open(@"rtsp://video", defaultAudio: false, defaultSubtitles: false);
    if (res.Success)
    {
        var playlistItem = Player.Playlist.Selected;
        var extStream = new FlyleafLib.MediaFramework.MediaStream.ExternalAudioStream() {  Url = @"rtsp://audio"};
        playlistItem.AddExternalStream(extStream, playlistItem, null, null);

        var res2 = Player.Open(extStream);        
    }
});

Note 1: In case of live steams it might no be able to resync audio/video if seek is not supported
Note 2: This would be currently better handled through a plugin (see YoutubeDL plugin as sample)

Replies: 1 comment

Comment options

SuRGeoNix
Dec 8, 2023
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by SuRGeoNix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant