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

--extract-audio progress #288

Closed
porjo opened this issue Feb 8, 2012 · 4 comments
Closed

--extract-audio progress #288

porjo opened this issue Feb 8, 2012 · 4 comments
Labels

Comments

@porjo
Copy link

@porjo porjo commented Feb 8, 2012

The following patch will send the encoding progress output from FFMPEG to youtube-dl stdout ( code taken from http://stackoverflow.com/a/2525493 )

--- youtube-dl  2012-01-16 03:23:22.000000000 +0000
+++ youtube-dl.new  2012-02-08 01:02:28.366720567 +0000
@@ -4075,7 +4075,13 @@
        cmd = ['ffmpeg', '-y', '-i', _encodeFilename(path), '-vn'] + acodec_opts + more_opts + ['--', _encodeFilename(out_path)]
        try:
            p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-           stdout,stderr = p.communicate()
+           while True:
+               out = p.stderr.read(1)
+               if out == '' and p.poll() != None:
+                   break
+               if out != '':
+                   sys.stdout.write(out)
+                   sys.stdout.flush()
        except (IOError, OSError):
            e = sys.exc_info()[1]
            if isinstance(e, OSError) and e.errno == 2:
@phihag
Copy link
Contributor

@phihag phihag commented Feb 26, 2012

I'm not certain that we should output ffmpeg's status; that may confuse some programs that parse our output. I'll leave this open; in the next batch of changes (probably April, May), I expect an API to make it. Once that API is established, we'll have more freedom over what we output.

@rgl
Copy link

@rgl rgl commented Dec 31, 2017

Can't all lines be prefixed with [ffmpeg] so they don't confuse other programs?

@fergalmoran
Copy link

@fergalmoran fergalmoran commented Mar 4, 2018

Are we ever going to get this implemented? #1304 seems to track this but it's been locked so can't comment. I've been tracking that issue for over a year now and no updates??

fergalmoran added a commit to fergalmoran/podnoms that referenced this issue Mar 6, 2018
fergalmoran added a commit to podnoms/podnoms-backend that referenced this issue May 13, 2018
fergalmoran added a commit to podnoms/podnoms-web that referenced this issue May 13, 2018
fergalmoran added a commit to podnoms/podnoms-web that referenced this issue Sep 4, 2018
@MrRopain
Copy link

@MrRopain MrRopain commented Mar 2, 2020

Would be much appreciated.

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
5 participants
You can’t perform that action at this time.