Skip to content

Commit

Permalink
escape filenames for ffmpeg concatenating
Browse files Browse the repository at this point in the history
  • Loading branch information
lilydjwg committed Feb 14, 2015
1 parent 66053b0 commit e6581b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/you_get/processor/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def ffmpeg_concat_flv_to_mp4(files, output='output.mp4'):
concat_list = open(output + '.txt', 'w', encoding="utf-8")
for file in files:
if os.path.isfile(file):
concat_list.write("file '%s'\n" % file)
# for escaping rules, see:
# https://www.ffmpeg.org/ffmpeg-utils.html#Quoting-and-escaping
concat_list.write("file '%s'\n" % file.replace("'", r"'\''"))
concat_list.close()

params = [FFMPEG, '-f', 'concat', '-y', '-i']
Expand Down

0 comments on commit e6581b9

Please sign in to comment.