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

Multi-Threaded postproc for playlists #12215

Open
d3fault opened this issue Feb 22, 2017 · 5 comments
Open

Multi-Threaded postproc for playlists #12215

d3fault opened this issue Feb 22, 2017 · 5 comments

Comments

@d3fault
Copy link

@d3fault d3fault commented Feb 22, 2017

Would be nice if postproc was done in separate thread(s) (up to N threads, N being the number of CPU cores). As soon as a download is finished, the postproc job should be dispatched and the next download should start immediately. But if all N cores are doing postproc, wait for one to finish before downloading another playlist item. If the machine has only 1 core then the the behavior is exactly the same as it currently is.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Feb 22, 2017

FYI: #12077 is useful in some cases.

@d3fault
Copy link
Author

@d3fault d3fault commented Feb 22, 2017

Indeed, thanks. N ffmpeg processes working on their own files almost always parallelizes better than 1x ffmpeg process passed -threads N, because not all routines in ffmpeg can-be/are parallelized: it depends on the underlying codec to support multi-threading. but you already knew this ;-P

@jcppkkk
Copy link

@jcppkkk jcppkkk commented May 24, 2017

Using parallel to utilize CPU cores, run N postproc at same time.
parallel's default is 100% which will run one job per CPU core on each machine.

e.g.

youtube-dl --get-id PLAYLIST_ID -i | tee ids
parallel --linebuffer -- youtube-dl -x -k --embed-thumbnail --add-metadata --audio-format mp3 <ids
@d3fault
Copy link
Author

@d3fault d3fault commented May 24, 2017

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Nov 8, 2017

As a side note: #3746 is related

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
4 participants
@jcppkkk @yan12125 @d3fault and others
You can’t perform that action at this time.