Track Description to Media Track Mapping

This forum is about all development around libVLC.
william krzyzkowski
New Cone
New Cone
Posts: 2
Joined: 09 Aug 2024 21:08

Track Description to Media Track Mapping

Postby william krzyzkowski » 15 Aug 2024 20:04

Hello,
I am playing back an MPTS using LibVlcSharp. The Audio Track Description lists an id of perhaps 53. If I parse the media and get the Media Tracks, there is no Media Track with an Id of 53. I'm wondering how I can map these two together especially since the media tracks share descriptions. Any Help would be appreciated. I can also provide an example if needed.
Thank you in Advance!

mfkl
Developer
Developer
Posts: 746
Joined: 13 Jun 2017 10:41

Re: Track Description to Media Track Mapping

Postby mfkl » 26 Aug 2024 06:44

Provide a fully working example so we can test.
https://mfkl.github.io

william krzyzkowski
New Cone
New Cone
Posts: 2
Joined: 09 Aug 2024 21:08

Re: Track Description to Media Track Mapping

Postby william krzyzkowski » 26 Aug 2024 19:18

Code: Select all

using LibVLCSharp.Shared; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace TestApp { class Program { static void Main(string[] args) { Core.Initialize(); var vlcArgs = new List<string>(); vlcArgs.Add("--swscale-mode=4"); var libvlc = new LibVLC(vlcArgs.ToArray()); var player = new MediaPlayer(libvlc); var media = new Media(libvlc, "./wills_30_second.ts", FromType.FromPath); player.Play(media); Thread.Sleep(100); var audio = player.AudioTrackDescription; foreach (var track in audio) { Console.WriteLine($"Name {track.Name}, Id {track.Id}"); } player.Media.Parse(); var mediaTracks = player.Media.Tracks; var audioTracks = mediaTracks.Where(track => track.TrackType == TrackType.Audio); foreach (var audioTrack in audioTracks) { Console.WriteLine($"Description {audioTrack.Description}, Id {audioTrack.Id}"); } Console.WriteLine("how do I tie these together?"); Console.ReadLine(); } } }
C# framework 4.7.2, LibVlcSharp 3.6.5 and VideoLAN.LibVlc.Windows 3.0.18. Williing to provide a zip file if granted attachment permissions


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 8 guests