From f5b2b07772f929b40c2732314427ecda66b21159 Mon Sep 17 00:00:00 2001 From: Nikoli Date: Sat, 23 May 2015 23:02:35 +0300 Subject: [PATCH] Create reproducible non unique files when muxing or encoding Also prevents adding Unique ID and ffmpeg/libav version to files. '-fflags +bitexact' affects only muxer and '-flags +bitexact' affects only encoder: https://libav.org/avconv.html https://git.libav.org/?p=libav.git;a=blob;f=tests/fate-run.sh;h=a0a69ad0a7ca716e008446eea67f69b19fb14840;hb=HEAD#l122 https://www.ffmpeg.org/ffmpeg-formats.html#toc-Format-Options https://www.ffmpeg.org/ffmpeg-codecs.html#toc-Codec-Options https://git.videolan.org/?p=ffmpeg.git;a=blob;f=tests/fate-run.sh;h=1a8ff940bd92f4e301435c49d0dc9331bda61700;hb=HEAD#l143 --- youtube_dl/downloader/hls.py | 2 +- youtube_dl/postprocessor/ffmpeg.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py index 8be4f4249..a990e5e0a 100644 --- a/youtube_dl/downloader/hls.py +++ b/youtube_dl/downloader/hls.py @@ -30,7 +30,7 @@ class HlsFD(FileDownloader): args = [ encodeArgument(opt) - for opt in (ffpp.executable, '-y', '-i', url, '-f', 'mp4', '-c', 'copy', '-bsf:a', 'aac_adtstoasc')] + for opt in (ffpp.executable, '-y', '-i', url, '-f', 'mp4', '-c', 'copy', '-bsf:a', 'aac_adtstoasc', '-fflags', '+bitexact', '-flags', '+bitexact')] args.append(encodeFilename(tmpfilename, True)) retval = subprocess.call(args) diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py index cc65b34e7..898feed7f 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dl/postprocessor/ffmpeg.py @@ -131,6 +131,7 @@ class FFmpegPostProcessor(PostProcessor): os.stat(encodeFilename(path)).st_mtime for path in input_paths) files_cmd = [] + opts += ['-fflags', '+bitexact', '-flags', '+bitexact'] for path in input_paths: files_cmd.extend([encodeArgument('-i'), encodeFilename(path, True)]) cmd = ([encodeFilename(self.executable, True), encodeArgument('-y')] +