Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Nothing happens :-( #11

Open
ghost opened this issue Nov 30, 2017 · 0 comments
Open

Nothing happens :-( #11

ghost opened this issue Nov 30, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 30, 2017

Hi
I have this code writen:

using DotImaging;
using System;
using System.Windows.Forms;

namespace youtube_new_c
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

            var sourceName = String.Empty;

            var pipeName = new Uri("https://www.youtube.com/watch?v=Vpg9yizPP_g").NamedPipeFromYoutubeUri(); //Youtube

            sourceName = String.Format(@"\\.\pipe\{0}", pipeName);

            
            ImageStreamReader reader = new FileCapture(sourceName);
            reader.Open();

            //seek if you can
            if (reader.CanSeek)
                reader.Seek((int)(reader.Length * 0.25), System.IO.SeekOrigin.Begin);

            //read video frames
            Bgr<byte>[,] frame = null;
            do
            {
                reader.ReadTo(ref frame);
                if (frame == null)
                    break;
                
                frame.Show(scaleForm: true);
                ((double)reader.Position / reader.Length).Progress();
            }
            while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape));

        }
    }
}

and when run i got a black window, one empty form and another form with a progressbar but nothing happens. Any idea of what i need to do?
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants