def _try_imageio_ffmpeg(): imageio_ffmpeg_binary = ffmpeg.get_exe() if is_command_available(imageio_ffmpeg_binary): return imageio_ffmpeg_binary return None
def InitRun(self, session_file=None): """Performs the first tasks after the publication starts - start autosaving - check for updates - download ffmpeg """ # Check if we have an autosaved session that we did not delete recover = autosave.check_recover(self) # Load session file if provided if session_file is not None and not recover: self.OnMenuLoad(session_file=session_file) if self.config.get_bool("check update"): # Search for updates update.Update(self) if self.config.get_bool("autosave session"): # Start autosaving autosave.autosave_run(self) # download ffmpeg for imageio try: imioff.get_exe() except imioff.NeedDownloadError: # Tell the user that we will download ffmpeg now! msg = "ShapeOut needs to download `FFMPEG` in order " \ +"to display and export video data. Please make " \ +"sure you are connected to the internet and " \ +"click OK. Depending on your connection, this " \ +"may take a while. Please be patient. There " \ +"is no progress dialog." dlg = wx.MessageDialog(parent=None, message=msg, caption="FFMPEG download", style=wx.OK | wx.CANCEL | wx.ICON_QUESTION) if dlg.ShowModal() == wx.ID_OK: imioff.download()
def get_ffmpeg_path(): """Test and find the correct ffmpeg binary file. Modified from moviepy. """ ffmpeg_binary = os.getenv('FFMPEG_BINARY', 'ffmpeg-imageio') if ffmpeg_binary == 'ffmpeg-imageio': from imageio.plugins.ffmpeg import get_exe ffmpeg_binary = get_exe() elif ffmpeg_binary == 'auto-detect': if test_cmd(['ffmpeg'])[0]: ffmpeg_binary = 'ffmpeg' elif test_cmd(['ffmpeg.exe'])[0]: ffmpeg_binary = 'ffmpeg.exe' else: ffmpeg_binary = 'unset' else: success, err = test_cmd([ffmpeg_binary]) if not success: raise IOError( str(err) + " - The path specified for the ffmpeg binary might be wrong") return ffmpeg_binary
# This was added so that no extra unwanted window opens on windows # when the child process is created if os.name == "nt": popen_params["creationflags"] = 0x08000000 proc = sp.Popen(cmd, **popen_params) proc.communicate() except Exception as err: return False, err else: return True, None if FFMPEG_BINARY == 'ffmpeg-imageio': from imageio.plugins.ffmpeg import get_exe FFMPEG_BINARY = get_exe() elif FFMPEG_BINARY == 'auto-detect': if try_cmd(['ffmpeg'])[0]: FFMPEG_BINARY = 'ffmpeg' elif try_cmd(['ffmpeg.exe'])[0]: FFMPEG_BINARY = 'ffmpeg.exe' else: FFMPEG_BINARY = 'unset' else: success, err = try_cmd([FFMPEG_BINARY]) if not success: raise IOError( str(err) + " - The path specified for the ffmpeg binary might be wrong")
# This was added so that no extra unwanted window opens on windows # when the child process is created if os.name == "nt": popen_params["creationflags"] = 0x08000000 proc = sp.Popen(cmd, **popen_params) proc.communicate() except Exception as err: return False, err else: return True, None if FFMPEG_BINARY=='ffmpeg-imageio': from imageio.plugins.ffmpeg import get_exe FFMPEG_BINARY = get_exe() elif FFMPEG_BINARY=='auto-detect': if try_cmd(['ffmpeg'])[0]: FFMPEG_BINARY = 'ffmpeg' elif try_cmd(['ffmpeg.exe'])[0]: FFMPEG_BINARY = 'ffmpeg.exe' else: FFMPEG_BINARY = 'unset' else: success, err = try_cmd([FFMPEG_BINARY]) if not success: raise IOError(err.message + "The path specified for the ffmpeg binary might be wrong")