Skip to content

Instantly share code, notes, and snippets.

View Valentin-Laurent's full-sized avatar

Valentin Laurent Valentin-Laurent

View GitHub Profile
@masgari
masgari / video-errors-fixer.py
Created August 5, 2018 11:12
python script for fixing video errors (mp4, mkv) using ffmpeg
#!/usr/bin/env python3.6
import subprocess
import sys
import os
import glob
def fix_video_using_ffmpeg(f, output_dir):
out_f = os.path.join(output_dir, os.path.basename(f))
# ffmpeg -err_detect ignore_err -i video.mkv -c copy video_fixed.mkv
exit_code = subprocess.call(['ffmpeg', '-err_detect', 'ignore_err', '-i', f, '-c', 'copy', out_f])