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

static_ffmpeg fails to see video file where ffmpeg doesnt #9

Closed
sh34v3 opened this issue Mar 19, 2022 · 3 comments
Closed

static_ffmpeg fails to see video file where ffmpeg doesnt #9

sh34v3 opened this issue Mar 19, 2022 · 3 comments

Comments

@sh34v3
Copy link

sh34v3 commented Mar 19, 2022

I'm making a subprocess call like so:

subprocess.call([
                'static_ffmpeg',                   # call ffmpeg
                '-ss', str(start_time),          # our clip starts here
                '-i', infile_video,         # this is the video to be converted
                '-t', str(end_time - start_time), #how long our clip is
                '-threads', '4',            # use 4 threads for the video conversion
                '-c:v', 'libvpx-vp9',       # c[odec]:v[ideo] - we use libvpx cause we want webm
                '-c:a', 'libvorbis',        # c[odec]:a[udio] - this is the one everyone else was using
                '-b:v',  '400k',            # reccomended video bitrate
                '-b:a', '192k',             # reccomended audio bitrate
                '-deadline', 'good',    # setting for quality vs. speed (best, good, realtime (fastest)); boundry for quality vs. time set the following settings
                '-qmin', '0',               # quality minimum boundry. (lower means better)
                '-qmax', '50',              # quality maximum boundry (higher means worse)
                uniquename               # file to be written out
            ])

When I do, I get this error Some: No such file or directory. Meanwhile, this works fine:

subprocess.call([
                'ffmpeg',                   # call ffmpeg
                '-ss', str(start_time),          # our clip starts here
                '-i', infile_video,         # this is the video to be converted
                '-t', str(end_time - start_time), #how long our clip is
                '-threads', '4',            # use 4 threads for the video conversion
                '-c:v', 'libvpx-vp9',       # c[odec]:v[ideo] - we use libvpx cause we want webm
                '-c:a', 'libvorbis',        # c[odec]:a[udio] - this is the one everyone else was using
                '-b:v',  '400k',            # reccomended video bitrate
                '-b:a', '192k',             # reccomended audio bitrate
                '-deadline', 'good',    # setting for quality vs. speed (best, good, realtime (fastest)); boundry for quality vs. time set the following settings
                '-qmin', '0',               # quality minimum boundry. (lower means better)
                '-qmax', '50',              # quality maximum boundry (higher means worse)
                uniquename               # file to be written out
            ])

If it's relevant, the media files are in script's directory, and they end up having filenames with whitespace so their names look like: 'Some Youtube Video.mp4'

@sh34v3
Copy link
Author

sh34v3 commented Mar 19, 2022

I was able to work around the issue by substituting infile_video for a static complete path to the video that is being converted. That being said, this issue remains.

For reference, here is an example of infile_video: /full/path/to/video/'Youtube Video Title.mp4'

@zackees
Copy link
Owner

zackees commented Mar 20, 2022

Thanks for this bug report.

The quickest work around is to use the api to get the path to the real ffmpeg and then just use that for your subprocess.call

from static_ffmpeg import run
ffmpeg, ffprobe = run.get_or_fetch_platform_executables_else_raise()
subprocess.call([ffmpeg, ...])

@zackees
Copy link
Owner

zackees commented Mar 20, 2022

Fixed in v2.2
b1e150e

Please run

python -m pip install static-ffmpeg --upgrade

And your issue should be resolved.

@zackees zackees closed this as completed Mar 20, 2022
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

No branches or pull requests

2 participants