ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.31k stars 9.95k forks source link

invalid subtitle file causes error and fails to clean up temp files #8855

Open y opened 8 years ago

y commented 8 years ago

This appears related to #8568.

> youtube-dl -v -f http-740 http://www.cbsnews.com/videos/prime-minister-trudeau-king-of-coal-death-row-in-livingston-texas/
[debug] System config: []
[debug] User config: [u'--restrict-filenames', u'--sub-lang', u'en', u'--convert-subtitles', u'srt', u'--write-sub', u'--embed-sub']
[debug] Command-line args: [u'-v', u'-f', u'http-740', u'http://www.cbsnews.com/videos/prime-minister-trudeau-king-of-coal-death-row-in-livingston-texas/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.03.06
[debug] Python version 2.7.11 - Darwin-15.3.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.8.6, ffprobe 2.8.6, rtmpdump 2.4
[debug] Proxy map: {}
...
[download] 100% of 236.79MiB
[ffmpeg] Converting subtitles
WARNING: You have requested to convert dfxp (TTML) subtitles into another format, which results in style information loss
Deleting original file Prime_Minister_Trudeau_King_of_Coal_Death_Row_in_Livingston_Texas-prime-minister-trudeau-king-of-coal-death-row-in-livingston-texas.en.ttml (pass -k to keep)
[ffmpeg] Embedding subtitles in 'Prime_Minister_Trudeau_King_of_Coal_Death_Row_in_Livingston_Texas-prime-minister-trudeau-king-of-coal-death-row-in-livingston-texas.mp4'
ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

And it doesn't clean up the srt and temp.mp4 files:

> ls
Prime_Minister_Trudeau_King_of_Coal_Death_Row_in_Livingston_Texas-prime-minister-trudeau-king-of-coal-death-row-in-livingston-texas.en.srt
Prime_Minister_Trudeau_King_of_Coal_Death_Row_in_Livingston_Texas-prime-minister-trudeau-king-of-coal-death-row-in-livingston-texas.mp4
Prime_Minister_Trudeau_King_of_Coal_Death_Row_in_Livingston_Texas-prime-minister-trudeau-king-of-coal-death-row-in-livingston-texas.temp.mp4
yan12125 commented 8 years ago

Temporary files should be kept unless the whole operation is done. It's the errors but not temporary files that should be fixed.

y commented 8 years ago

@yan12125, If the error needs to be fixed, why was this ticket closed without fixing it?

yan12125 commented 8 years ago

Sorry the command at #8568 works fine, and I thought this issue is the same as the previous one.