Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does youtube-dl have slight delay on start? #21580

Closed
XezolesS opened this issue Jun 30, 2019 · 1 comment
Closed

Does youtube-dl have slight delay on start? #21580

XezolesS opened this issue Jun 30, 2019 · 1 comment
Labels

Comments

@XezolesS
Copy link

@XezolesS XezolesS commented Jun 30, 2019

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

I'm trying to make discord bot written in C# and trying to use youtube-dl to play audio from youtube.
But when the youtube-dl is executed, it delayed about 4 seconds to run. I want this process run immediately.
I don't know whether it is a natural thing or not. Is there any way to fix this?

Here's my arguments in case it needed.

this is for download youtube video.

Process prcs = Process.Start(new ProcessStartInfo
{
    FileName = "cmd",
    Arguments = $"/C youtube-dl -o - \"{url}\" | ffmpeg -hide_banner -loglevel panic -i pipe:0 -ac 2 -f s16le -ar 48000 pipe:1",
    UseShellExecute = false,
    RedirectStandardOutput = true,
    CreateNoWindow = true
});

and this is for getting the information of youtube video.

Process prcs = Process.Start(new ProcessStartInfo
{
    FileName = "youtube-dl",
    Arguments = $"-q -s --get-title --get-duration \"{url}\"",
    UseShellExecute = false,
    RedirectStandardOutput = true,
    CreateNoWindow = true
});
@XezolesS XezolesS added the question label Jun 30, 2019
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 30, 2019

On slow machine it may take some time to start. Lazy extractors feature may reduce it to some extent.

@dstftw dstftw closed this Jun 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.