-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Add concat-playlist flag to merge videos from a playlist into one continuous file #28153
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DISCLAIMER: I am not a maintainer of this project. I am just putting up my suggestions since I find this PR interesting
@@ -1677,6 +1692,7 @@ def is_wellformed(f): | |||
new_info = dict(info_dict) | |||
new_info.update(format) | |||
self.process_info(new_info) | |||
format.update(new_info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
@@ -203,7 +201,7 @@ def get_audio_codec(self, path): | |||
return mobj.group(1) | |||
return None | |||
|
|||
def run_ffmpeg_multiple_files(self, input_paths, out_path, opts): | |||
def run_ffmpeg_multiple_files(self, input_paths, out_path, opts, file_opts): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to make this an optional argument than changing the code in the other classes
@@ -274,7 +273,8 @@ def run(self, information): | |||
raise PostProcessingError('WARNING: unable to obtain file audio codec with ffprobe') | |||
|
|||
more_opts = [] | |||
if self._preferredcodec == 'best' or self._preferredcodec == filecodec or (self._preferredcodec == 'm4a' and filecodec == 'aac'): | |||
if self._preferredcodec == 'best' or self._preferredcodec == filecodec or ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best not to make unrelated changes in a PR. Same issue below. Also these changes often don't obey the linter
def can_merge(self): | ||
return True | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
def run(self, info): | ||
filename = info['filepath'] | ||
|
||
list_filename = prepend_extension(filename, 'list') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filename will end up as .list.mkv
which doesn't make sense. It should be either .mkv.list
or just .list
This does not work with using output titles, I think that it's expecting different filenames when concatenating and it misses. I have tested with using an output format: https://pastebin.com/jspQV0Q0 and without using an output format: https://pastebin.com/iAiMZAMB The command I'm using is referenced from yt-dlp/yt-dlp#447 - he also has a workaround for renaming the files after finished, but I think the --concat-playlist flag is failing if it doesn't work only when using the --output flag. Since these 'acts' are all of the same episode (there could be a check to see if they match for all x acts), it should work. It is interesting to me that the %(title)s finds the %(episode)s part and that becomes the final output file. |
Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Prior art
#12385
#995
#2723
#2844
Description of your pull request and other information
Added flag to merge videos from a playlist into one continuous file.
In its current form, it uses the ffmpeg concat demux, which has limited support for mixed streams within a playlist, therefore is only really suited to the use case below.
The main use case is downloading episodes from MTV, as episodes are internally represented as a playlist of multiple segments, and downloading them as individual files becomes a pain for managing in other applications.
HELP WANTED - need to improve the filename/extractor logic as often the playlist name is not the best name for the video, in the example of MTV, the individual segments have more metadata about the show/season/episode than the playlist does.
Resolves #30093.