none
How to go to specific time in a video using vlc api in c#. RRS feed

  • Question

  • Hi, my project is TV channel in C# and I'm using Vlc API. I want to go to specific time in video using input time from textbox like when the video start and its duration is 3:00 minutes and I want to go to 1:30 this time what should I do?

    That's the code of button which I'm using but I've no idea how to do this.

     private void btn_go_Click(object sender, EventArgs e)
            {
                frm.vlc.input.time = int.Parse(txt_time.Text);          // this one is showing the total length of video in textbox
               // frm.vlc.MediaPlayerPositionChanged += txt_time.Text.ToString();
               // TimeSpan span = new TimeSpan(int.Parse(txt_time.Text));
                //MessageBox.Show(span.ToString());
                
            }

    • Moved by Fei Hu Thursday, January 4, 2018 7:22 AM VLC related
    Wednesday, January 3, 2018 4:51 AM

All replies

  • Hi,

    Can you try this code?

    Process.Start(PathToFile, ArgumentsThatIncludeExactTimeOrFrameIndex);

    Here is an excerpt from the VLC Documentation

    --start-time <integer> starts the video here; the integer is the number of seconds from the beginning (e.g. 1:30 is written as 90)

    https://wiki.videolan.org/Documentation:Advanced_Use_of_VLC/#Video_options


    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"

    Wednesday, January 3, 2018 9:37 AM
  • Hi lftikhar_here,

    Your question is more related to third party libraries, you could post a new thread to VLC forum for suitable support.

    If you have some grammar or code errors in using C#, please feel free to contact us. We will try our best to give you a solution.

    Best Regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 4, 2018 7:18 AM