Created
November 20, 2023 06:33
-
-
Save Delnegend/fc84566c3f4af6e4a941d40633871489 to your computer and use it in GitHub Desktop.
Transcode any video into Nokia 150 compatible file so it can playback
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
import sys, subprocess, os | |
def main(): | |
input_file = sys.argv[1] | |
output_file = os.path.splitext(input_file)[0] + '.nokia150.avi' | |
subprocess.call(f"ffmpeg -i \"{input_file}\" -vf \"scale='min(320,iw)':min'(240,ih)':force_original_aspect_ratio=decrease\" -vcodec mjpeg -q:v 3 -acodec pcm_s16le -ar 8000 -ac 1 \"{output_file}\"", shell=True) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment