aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom-Oliver Heidel <github@tom-oliver.eu>2020-11-30 02:24:39 +0100
committerGitHub <noreply@github.com>2020-11-30 02:24:39 +0100
commitbccdb02e9351e7f507135c9a4ccd4211e5a325bb (patch)
tree2db84afa19e3f3972ac1e80ba3d27789b868c713
parentef5a4db06cb7667dc555f0dc1982de2c5258eb37 (diff)
parent958804ad4e019ce59c6b5d72918dff846839220c (diff)
downloadhypervideo-pre-bccdb02e9351e7f507135c9a4ccd4211e5a325bb.tar.lz
hypervideo-pre-bccdb02e9351e7f507135c9a4ccd4211e5a325bb.tar.xz
hypervideo-pre-bccdb02e9351e7f507135c9a4ccd4211e5a325bb.zip
Merge pull request #205 from pukkandan/ffmpeg-use-map
[ffmpeg] Ensure all streams are copied
-rw-r--r--youtube_dlc/postprocessor/embedthumbnail.py5
-rw-r--r--youtube_dlc/postprocessor/ffmpeg.py11
2 files changed, 8 insertions, 8 deletions
diff --git a/youtube_dlc/postprocessor/embedthumbnail.py b/youtube_dlc/postprocessor/embedthumbnail.py
index 4a0d02fc4..7ca0ce6e5 100644
--- a/youtube_dlc/postprocessor/embedthumbnail.py
+++ b/youtube_dlc/postprocessor/embedthumbnail.py
@@ -94,7 +94,8 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
thumbnail_filename = 'cover.jpg'
options = [
- '-c', 'copy', '-attach', thumbnail_filename, '-metadata:s:t', 'mimetype=image/jpeg']
+ '-c', 'copy', '-map', '0',
+ '-attach', thumbnail_filename, '-metadata:s:t', 'mimetype=image/jpeg']
self._downloader.to_screen('[ffmpeg] Adding thumbnail to "%s"' % filename)
@@ -140,6 +141,6 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
os.remove(encodeFilename(filename))
os.rename(encodeFilename(temp_filename), encodeFilename(filename))
else:
- raise EmbedThumbnailPPError('Only mp3 and m4a/mp4 are supported for thumbnail embedding for now.')
+ raise EmbedThumbnailPPError('Only mp3, mkv, m4a and mp4 are supported for thumbnail embedding for now.')
return [], info
diff --git a/youtube_dlc/postprocessor/ffmpeg.py b/youtube_dlc/postprocessor/ffmpeg.py
index c38db3143..c7071d73d 100644
--- a/youtube_dlc/postprocessor/ffmpeg.py
+++ b/youtube_dlc/postprocessor/ffmpeg.py
@@ -359,7 +359,7 @@ class FFmpegVideoRemuxerPP(FFmpegPostProcessor):
if information['ext'] == self._preferedformat:
self._downloader.to_screen('[ffmpeg] Not remuxing video file %s - already is in target format %s' % (path, self._preferedformat))
return [], information
- options = ['-c', 'copy']
+ options = ['-c', 'copy', '-map', '0']
prefix, sep, ext = path.rpartition('.')
outpath = prefix + sep + self._preferedformat
self._downloader.to_screen('[' + 'ffmpeg' + '] Remuxing video from %s to %s, Destination: ' % (information['ext'], self._preferedformat) + outpath)
@@ -428,8 +428,7 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
input_files = [filename] + sub_filenames
opts = [
- '-map', '0',
- '-c', 'copy',
+ '-c', 'copy', '-map', '0',
# Don't copy the existing subtitles, we may be running the
# postprocessor a second time
'-map', '-0:s',
@@ -579,7 +578,7 @@ class FFmpegFixupStretchedPP(FFmpegPostProcessor):
filename = info['filepath']
temp_filename = prepend_extension(filename, 'temp')
- options = ['-c', 'copy', '-aspect', '%f' % stretched_ratio]
+ options = ['-c', 'copy', '-map', '0', '-aspect', '%f' % stretched_ratio]
self._downloader.to_screen('[ffmpeg] Fixing aspect ratio in "%s"' % filename)
self.run_ffmpeg(filename, temp_filename, options)
@@ -597,7 +596,7 @@ class FFmpegFixupM4aPP(FFmpegPostProcessor):
filename = info['filepath']
temp_filename = prepend_extension(filename, 'temp')
- options = ['-c', 'copy', '-f', 'mp4']
+ options = ['-c', 'copy', '-map', '0', '-f', 'mp4']
self._downloader.to_screen('[ffmpeg] Correcting container in "%s"' % filename)
self.run_ffmpeg(filename, temp_filename, options)
@@ -613,7 +612,7 @@ class FFmpegFixupM3u8PP(FFmpegPostProcessor):
if self.get_audio_codec(filename) == 'aac':
temp_filename = prepend_extension(filename, 'temp')
- options = ['-c', 'copy', '-f', 'mp4', '-bsf:a', 'aac_adtstoasc']
+ options = ['-c', 'copy', '-map', '0', '-f', 'mp4', '-bsf:a', 'aac_adtstoasc']
self._downloader.to_screen('[ffmpeg] Fixing malformed AAC bitstream in "%s"' % filename)
self.run_ffmpeg(filename, temp_filename, options)