juanmcasillas/gopro2gpx

PermissionError: [WinError 5] Access is denied

RonvdZande opened this issue · 7 comments

Dear juanmcasillas,

installed python and gopro2gpx to extract GPS data from my MP4 files. With some trouble I activated python and your program. But when I try to extract data from a MP4 files I am stuck with "PermissionError: [WinError 5] Access is denied " error. It seems the call to FFMPEG is not going well. I am not familiar with Python or FFMPEG. Searched the internet on the error, found a number of hits but did not find a solution. Maybe you have an idea what might be wrong.

c:\Python39\Scripts>python -m gopro2gpx-script -vvv GX020115.mp4 d:\test
Traceback (most recent call last):
File "C:\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "c:\Python39\Scripts\gopro2gpx-script.py", line 33, in
sys.exit(load_entry_point('gopro2gpx==0.1', 'console_scripts', 'gopro2gpx')())
File "c:\Python39\Scripts\gopro2gpx-script.py", line 25, in importlib_load_entry_point
return next(matches).load()
File "C:\Python39\lib\importlib\metadata.py", line 77, in load
module = import_module(match.group('module'))
File "C:\Python39\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 664, in _load_unlocked
File "", line 627, in load_backward_compatible
File "", line 259, in load_module
File "C:\Python39\lib\site-packages\gopro2gpx-0.1-py3.9.egg\gopro2gpx_main
.py", line 3, in
File "C:\Python39\lib\site-packages\gopro2gpx-0.1-py3.9.egg\gopro2gpx\gopro2gpx.py", line 148, in main
File "C:\Python39\lib\site-packages\gopro2gpx-0.1-py3.9.egg\gopro2gpx\gpmf.py", line 43, in readFromMP4
File "C:\Python39\lib\site-packages\gopro2gpx-0.1-py3.9.egg\gopro2gpx\ffmpegtools.py", line 40, in getMetadataTrack
File "C:\Python39\lib\site-packages\gopro2gpx-0.1-py3.9.egg\gopro2gpx\ffmpegtools.py", line 18, in runCmd
File "C:\Python39\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Python39\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
PermissionError: [WinError 5] Toegang geweigerd

Thanks a lot in advance.

Thanks, FFMPEG and FFPROBE can be found independed from the directory where I am starting like PYTHON.
But I will look further.

Ffmpeg runs ok from the command line. Used your example to get a bin file from a mp4 file and this works ok. Something to do with the interfacing between Python an the Ffmpeg module I think.

I have the same issue with spotdl. When I run this command in admin commandline, it crashes: python -m spotdl https://open.spotify.com/track/254bXAqt3zP6P50BdQvEsq?si=e9a5afba89b347cc --format "mp3" --bitrate "128k" --ffmpeg c:/ffmpeg/bin
When I remove the "-ffmpeg" argument (and let spotdl install ffmpeg locally before that) The error PermissionError: [WinError 5] Access is denied is gone.

Hello, have you tried to run the script as administrator ? looks like the permission for ffmpeg are not setting right

I copied ffmpeg to windows folder and it worked. I don't know why.