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

Is it possible for the console progress output to be % of the total operation rather than % of each fragment? #21253

Closed
brunoriddy opened this issue May 30, 2019 · 6 comments

Comments

@brunoriddy
Copy link

@brunoriddy brunoriddy commented May 30, 2019

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

Question

Is it possible for the console progress output to be % of the total operation rather than % of each fragment?

I am writing a web tool that uses youtube-dl. It runs youtube-dl on a post request from my main app page. Sometimes users request a very large file and the download takes so long the request times out before my youtube-dl endpoint page can respond to the post, so I have rewritten the endpoint page. Now it responds immediately to the POST request with the address of a logfile for the download and pipes the console output of youtube-dl to this logfile. Now on my main application page I can constantly GET request that logfile to see the progress of the download and serve the file to the user once it is complete.

I have not had any problems telling when the download is complete, but I want to also report the completion % to the user while it is in process. I can't tell what the % completion is though, because the console output of youtube-dl reports the % completion of each fragment, and not the % completion of the total operation. Is there any way to get the console output to report the % completion of the total operation?

Thanks and let me know if I can clarify anything.

@brunoriddy brunoriddy added the question label May 30, 2019
@remitamine
Copy link
Collaborator

@remitamine remitamine commented May 30, 2019

Is there any way to get the console output to report the % completion of the total operation?

youtube-dl already report the estimated progress of the full download not the progress for fragment download.

@brunoriddy
Copy link
Author

@brunoriddy brunoriddy commented May 30, 2019

Thanks for getting back to me. Can you help me understand this output I get:

[youtube] Nhw0NfSf3D0: Downloading webpage
[youtube] Nhw0NfSf3D0: Downloading video info webpage
[youtube] Nhw0NfSf3D0: Looking for automatic captions
[youtube] Nhw0NfSf3D0: Downloading MPD manifest
[info] Writing video subtitles to: static/videos/Nhw0NfSf3D0/video.en.vtt
[dashsegments] Total fragments: 9
[download] Destination: static/videos/Nhw0NfSf3D0/video.f135.mp4
[download] 11.1% of ~6.68KiB at Unknown speed ETA 00:01
[download] 11.1% of ~6.68KiB at Unknown speed ETA 00:01
[download] 0.1% of ~1.42MiB at 535.88KiB/s ETA 04:52
[download] 0.3% of ~1.42MiB at 1.25MiB/s ETA 02:16
[download] 0.5% of ~1.42MiB at 2.33MiB/s ETA 01:05
[download] 1.1% of ~1.42MiB at 4.00MiB/s ETA 00:32
[download] 2.2% of ~1.42MiB at 6.35MiB/s ETA 00:15
[download] 4.4% of ~1.42MiB at 2.87MiB/s ETA 00:08
[download] 8.8% of ~1.42MiB at 3.69MiB/s ETA 00:03
[download] 17.6% of ~1.42MiB at 5.22MiB/s ETA 00:01
[download] 22.2% of ~1.42MiB at 5.80MiB/s ETA 00:01
[download] 22.2% of ~1.42MiB at 5.80MiB/s ETA 00:01
[download] 17.2% of ~1.84MiB at 551.52KiB/s ETA 00:02
[download] 17.3% of ~1.84MiB at 1.20MiB/s ETA 00:02
[download] 17.5% of ~1.84MiB at 2.25MiB/s ETA 00:02
[download] 18.0% of ~1.84MiB at 3.95MiB/s ETA 00:02
[download] 18.8% of ~1.84MiB at 6.29MiB/s ETA 00:02
[download] 20.5% of ~1.84MiB at 3.61MiB/s ETA 00:01
[download] 23.9% of ~1.84MiB at 4.26MiB/s ETA 00:01
[download] 30.7% of ~1.84MiB at 5.96MiB/s ETA 00:01
[download] 33.3% of ~1.84MiB at 6.47MiB/s ETA 00:01
[download] 33.3% of ~1.84MiB at 6.47MiB/s ETA 00:01
[download] 31.7% of ~1.93MiB at 653.93KiB/s ETA 00:01
[download] 31.8% of ~1.93MiB at 1.38MiB/s ETA 00:01
[download] 32.1% of ~1.93MiB at 2.50MiB/s ETA 00:01
[download] 32.5% of ~1.93MiB at 4.17MiB/s ETA 00:01
[download] 33.3% of ~1.93MiB at 6.35MiB/s ETA 00:01
[download] 34.9% of ~1.93MiB at 3.38MiB/s ETA 00:01
[download] 38.1% of ~1.93MiB at 4.30MiB/s ETA 00:01
[download] 44.4% of ~1.93MiB at 5.80MiB/s ETA 00:00
[download] 44.4% of ~1.93MiB at 5.80MiB/s ETA 00:00
[download] 40.9% of ~2.10MiB at 474.63KiB/s ETA 00:01
[download] 40.9% of ~2.10MiB at 1.08MiB/s ETA 00:01
[download] 41.1% of ~2.10MiB at 1.98MiB/s ETA 00:01
[download] 41.5% of ~2.10MiB at 3.54MiB/s ETA 00:01
[download] 42.2% of ~2.10MiB at 5.76MiB/s ETA 00:01
[download] 43.7% of ~2.10MiB at 3.38MiB/s ETA 00:00
[download] 46.7% of ~2.10MiB at 4.24MiB/s ETA 00:00
[download] 52.6% of ~2.10MiB at 5.81MiB/s ETA 00:00
[download] 55.6% of ~2.10MiB at 6.67MiB/s ETA 00:00
[download] 55.6% of ~2.10MiB at 6.67MiB/s ETA 00:00
[download] 55.3% of ~2.12MiB at 833.36KiB/s ETA 00:00
[download] 55.4% of ~2.12MiB at 1.61MiB/s ETA 00:00
[download] 55.6% of ~2.12MiB at 2.72MiB/s ETA 00:00
[download] 56.0% of ~2.12MiB at 4.54MiB/s ETA 00:00
[download] 56.7% of ~2.12MiB at 6.00MiB/s ETA 00:00
[download] 58.2% of ~2.12MiB at 3.27MiB/s ETA 00:00
[download] 61.1% of ~2.12MiB at 3.79MiB/s ETA 00:00
[download] 66.7% of ~2.12MiB at 5.19MiB/s ETA 00:00
[download] 66.7% of ~2.12MiB at 5.19MiB/s ETA 00:00
[download] 67.0% of ~2.11MiB at 572.13KiB/s ETA 00:00
[download] 67.1% of ~2.11MiB at 1.30MiB/s ETA 00:00
[download] 67.2% of ~2.11MiB at 2.42MiB/s ETA 00:00
[download] 67.6% of ~2.11MiB at 4.27MiB/s ETA 00:00
[download] 68.4% of ~2.11MiB at 5.98MiB/s ETA 00:00
[download] 69.8% of ~2.11MiB at 3.50MiB/s ETA 00:00
[download] 72.8% of ~2.11MiB at 4.20MiB/s ETA 00:00
[download] 77.8% of ~2.11MiB at 5.66MiB/s ETA 00:00
[download] 77.8% of ~2.11MiB at 5.66MiB/s ETA 00:00
[download] 78.9% of ~2.08MiB at 385.33KiB/s ETA 00:00
[download] 79.0% of ~2.08MiB at 1010.11KiB/s ETA 00:00
[download] 79.2% of ~2.08MiB at 2.06MiB/s ETA 00:00
[download] 79.6% of ~2.08MiB at 4.02MiB/s ETA 00:00
[download] 80.3% of ~2.08MiB at 5.39MiB/s ETA 00:00
[download] 81.8% of ~2.08MiB at 3.41MiB/s ETA 00:00
[download] 84.8% of ~2.08MiB at 4.24MiB/s ETA 00:00
[download] 88.9% of ~2.08MiB at 5.43MiB/s ETA 00:00
[download] 88.9% of ~2.08MiB at 5.43MiB/s ETA 00:00
[download] 90.1% of ~2.05MiB at 860.55KiB/s ETA 00:00
[download] 90.1% of ~2.05MiB at 1.63MiB/s ETA 00:00
[download] 90.3% of ~2.05MiB at 2.88MiB/s ETA 00:00
[download] 90.7% of ~2.05MiB at 4.83MiB/s ETA 00:00
[download] 91.5% of ~2.05MiB at 6.74MiB/s ETA 00:00
[download] 93.0% of ~2.05MiB at 3.41MiB/s ETA 00:00
[download] 96.0% of ~2.05MiB at 543.31KiB/s ETA 00:00
[download] 100.0% of ~2.05MiB at 872.27KiB/s ETA 00:00
[download] 100.0% of ~2.05MiB at 872.27KiB/s ETA 00:00
[download] 100% of 2.05MiB in 00:01
[dashsegments] Total fragments: 5
[download] Destination: static/videos/Nhw0NfSf3D0/video.mp4.f140
[download] 20.0% of ~3.20KiB at Unknown speed ETA 00:02
[download] 20.0% of ~3.20KiB at Unknown speed ETA 00:02
[download] 0.4% of ~396.41KiB at 332.22KiB/s ETA 02:42
[download] 0.9% of ~396.41KiB at 837.74KiB/s ETA 01:12
[download] 1.9% of ~396.41KiB at 1.67MiB/s ETA 00:34
[download] 3.9% of ~396.41KiB at 3.17MiB/s ETA 00:16
[download] 8.0% of ~396.41KiB at 2.07MiB/s ETA 00:07
[download] 16.1% of ~396.41KiB at 2.56MiB/s ETA 00:03
[download] 32.2% of ~396.41KiB at 3.36MiB/s ETA 00:01
[download] 40.0% of ~396.41KiB at 3.66MiB/s ETA 00:01
[download] 40.0% of ~396.41KiB at 3.66MiB/s ETA 00:01
[download] 30.3% of ~527.19KiB at 725.78KiB/s ETA 00:01
[download] 30.6% of ~527.19KiB at 1.50MiB/s ETA 00:01
[download] 31.4% of ~527.19KiB at 2.85MiB/s ETA 00:01
[download] 32.9% of ~527.19KiB at 5.01MiB/s ETA 00:01
[download] 36.0% of ~527.19KiB at 1.78MiB/s ETA 00:01
[download] 42.0% of ~527.19KiB at 2.45MiB/s ETA 00:01
[download] 54.2% of ~527.19KiB at 3.01MiB/s ETA 00:00
[download] 60.0% of ~527.19KiB at 3.22MiB/s ETA 00:00
[download] 60.0% of ~527.19KiB at 3.22MiB/s ETA 00:00
[download] 53.5% of ~592.89KiB at 398.74KiB/s ETA 00:00
[download] 53.9% of ~592.89KiB at 980.05KiB/s ETA 00:00
[download] 54.5% of ~592.89KiB at 1.92MiB/s ETA 00:00
[download] 55.9% of ~592.89KiB at 3.45MiB/s ETA 00:00
[download] 58.6% of ~592.89KiB at 1.92MiB/s ETA 00:00
[download] 64.0% of ~592.89KiB at 2.46MiB/s ETA 00:00
[download] 74.8% of ~592.89KiB at 3.08MiB/s ETA 00:00
[download] 80.0% of ~592.89KiB at 3.40MiB/s ETA 00:00
[download] 80.0% of ~592.89KiB at 3.40MiB/s ETA 00:00
[download] 78.9% of ~602.26KiB at 393.39KiB/s ETA 00:00
[download] 79.3% of ~602.26KiB at 983.65KiB/s ETA 00:00
[download] 79.9% of ~602.26KiB at 1.93MiB/s ETA 00:00
[download] 81.2% of ~602.26KiB at 3.55MiB/s ETA 00:00
[download] 83.9% of ~602.26KiB at 1.55MiB/s ETA 00:00
[download] 89.2% of ~602.26KiB at 2.11MiB/s ETA 00:00
[download] 99.8% of ~602.26KiB at 2.77MiB/s ETA 00:00
[download] 100.0% of ~602.26KiB at 2.74MiB/s ETA 00:00
[download] 100.0% of ~602.26KiB at 2.74MiB/s ETA 00:00
[download] 100% of 602.26KiB in 00:01
[ffmpeg] Merging formats into "static/videos/Nhw0NfSf3D0/video.mp4"
Deleting original file static/videos/Nhw0NfSf3D0/video.f135.mp4 (pass -k to keep)
Deleting original file static/videos/Nhw0NfSf3D0/video.mp4.f140 (pass -k to keep)
[ffmpeg] Not converting video file static/videos/Nhw0NfSf3D0/video.mp4 - already is in target format mp4

@remitamine
Copy link
Collaborator

@remitamine remitamine commented May 30, 2019

as I said in the case of fragmented streams, the progress is estimated, it tries to calculate approximately the size of the full download based on the size of the downloaded fragments and report the total progress of the download.

@brunoriddy
Copy link
Author

@brunoriddy brunoriddy commented May 30, 2019

Thanks, I just mean that it goes all the way up to 100% and then seems to start again from the bottom and build up to 100%?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 30, 2019

You are downloading two media files (video and audio) in a row.

@brunoriddy
Copy link
Author

@brunoriddy brunoriddy commented May 30, 2019

Thank you for explaining.

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