mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	FFmpegMetadataPP; Write temporary file to something.temp.{ext} (fixes #2079)
				
					
				
			ffmpeg correctly recognize the formats of extensions like m4a, but it doesn’t works if it’s passed with the `—format` option.
This commit is contained in:
		@@ -10,6 +10,7 @@ from .utils import (
 | 
			
		||||
    PostProcessingError,
 | 
			
		||||
    shell_quote,
 | 
			
		||||
    subtitles_filename,
 | 
			
		||||
    prepend_extension,
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -496,13 +497,11 @@ class FFmpegMetadataPP(FFmpegPostProcessor):
 | 
			
		||||
            return True, info
 | 
			
		||||
 | 
			
		||||
        filename = info['filepath']
 | 
			
		||||
        ext = os.path.splitext(filename)[1][1:]
 | 
			
		||||
        temp_filename = filename + u'.temp'
 | 
			
		||||
        temp_filename = prepend_extension(filename, 'temp')
 | 
			
		||||
 | 
			
		||||
        options = ['-c', 'copy']
 | 
			
		||||
        for (name, value) in metadata.items():
 | 
			
		||||
            options.extend(['-metadata', '%s=%s' % (name, value)])
 | 
			
		||||
        options.extend(['-f', ext])
 | 
			
		||||
 | 
			
		||||
        self._downloader.to_screen(u'[ffmpeg] Adding metadata to \'%s\'' % filename)
 | 
			
		||||
        self.run_ffmpeg(filename, temp_filename, options)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user