Last active
April 26, 2019 13:30
-
-
Save 0asa/5d2e3c30353e11497ba3ac5ae90c527c to your computer and use it in GitHub Desktop.
Interleave fields and deinterlace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://ffmpeg.org/ffmpeg-filters.html#il | |
import ffmpeg | |
try: | |
top = ffmpeg.input("top/%d.jpg") | |
bot = ffmpeg.input("bottom/%d.jpg") | |
s = ( | |
ffmpeg | |
.filter([top, bot], 'vstack') | |
.filter('il', l='i', c='i') | |
.filter('yadif', mode=1, parity=0) | |
.output('out.mp4') | |
.global_args('-y') | |
) | |
s.run(capture_stdout=False, capture_stderr=True) | |
except ffmpeg.Error as e: | |
print(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://ffmpeg.org/ffmpeg-filters.html#tinterlace | |
try: | |
s = ( | |
ffmpeg | |
.input("%04d.jpg") | |
.filter('tinterlace', mode=0) | |
.filter('setsar', sar='1/1') | |
.filter('yadif', mode=1, parity=0) | |
.output('out.mp4') | |
.global_args('-y') | |
) | |
s.run(capture_stdout=False, capture_stderr=True) | |
except ffmpeg.Error as e: | |
print(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment