Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cross-platform apps and directories #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

felciano
Copy link

Added support for running on Macs (and maybe other platforms) by using cross-platform libraries to identify the temp directory and file names.

@@ -0,0 +1,17 @@
[tool.poetry]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please exclude this python poetry configuration file from your commit

import tempfile # platform-independent tempoary files and directories

# default filenames
MP4BOX_DEFAULT_FILENAME = "mp4box" if not (platform.system() == "Windows") else "mp4box.exe"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider simplifying the conditional here to not use a negative, easier to read, also consider making the comparison case insensitive, i.e.

"mp4box.exe" if platform.system().casefold() == "Windows".casefold() else "mp4box"

@@ -55,6 +61,8 @@ def runMain():

# Construct the argument parser for the commandline
args = parseArguments()

print(args)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove print statement

def findffmpeg(path_to_ffmpeg_install=None, working_dir=None):
if( not path_to_ffmpeg_install is None and os.path.isfile(os.path.join(path_to_ffmpeg_install, "ffmpeg.exe")) ):
return os.path.join(path_to_ffmpeg_install, "ffmpeg.exe")
def findffmpeg(path_to_ffmpeg_install=None, working_dir=None, ffmpeg_filename="ffmpeg"):
Copy link
Owner

@sverrirs sverrirs Nov 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please make the same type of constant for FFMPEG as you've done for mp4box otherwise the script breaks on Windows

@@ -611,4 +619,5 @@ def parseArguments():

# If the script file is called by itself then execute the main function
if __name__ == '__main__':
print("HELLO")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this print statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants