In the experiment of using gym environment to train the agent and save the video locally, an error was encountered when using monitor to save the video:
Unknown encoder 'libx264'
Considering that the video saved in gym is saved in ffmpeg, I reinstalled it, but still reported an error. Then yes
check the original codes ofwrappers.Monitor
Here we judge the selection method, so we can choose other encoders to save our video. We just need to install CONDA, uninstall ffmpeg, and then use other options
import pkgutil
import distutils.spawn
import imageio_ffmpeg
print(distutils.spawn.find_executable("avconv"))
print(distutils.spawn.find_executable("ffmpeg"))
print(pkgutil.find_loader("imageio_ffmpeg"))
print(imageio_ffmpeg.get_ffmpeg_exe())
In my case, after I uninstall ffmpeg in CONDA, what gym calls becomes ffmpeg installed in Ubuntu, and then it can run.
Read More:
- [Solved] ffmpeg error reporting: subprocess. Calledprocesserror: Command ‘ffmpeg, unknown encoder: “libx264″“
- Module not found: Error: Can‘t resolve ‘sass-loader‘
- Module not found: Error: Can‘t resolve ‘sass-loader‘ in…
- [Solved] OpenCV VideoWriter Error: FFMPEG: tag ‘MP4V‘ is not supported with codec id 12 and format mp4
- [Solved] Vue Install less Error: this.getOptions is not a function
- Syntax Error: TypeError: this.getOptions is not a function
- [Solved] CUDA error:-UserWarning: CUDA initialization: CUDA unknown error
- [environment] docker: error response from daemon: OCI runtime
- [Solved] RuntimeError: CUDA error: out of memory
- [Solved] UserWarning: CUDA initialization: CUDA unknown error
- When starting Vue project: cannot find module ‘webpack cli / bin / config yargs’ error resolution
- [Solved] Vue cli version is @ Vue/cli 4.5.13, and sass is used to report an error
- [Solved] PyMOL install caver3 error: Unable to initialize plugin ‘Caver3’ (pmg_tk.startup.Caver3).
- [Solved] npm Error: Error: Cannot find module ‘postcss-loader‘
- [Solved] Vue3 Error: export ‘createRouter‘ was not found in ‘vue-router‘
- Webpack packaging error TypeError: this.getOptions is not a function at Object.lessLoader
- [Solved] webpack.config.js configuration encountered Error: Cannot find module’@babel/core’&&Cannot find module’@babel/plugin-transform-react-jsx’
- [Solved] Tensorflow-gpu Error: self._traceback = tf_stack.extract_stack()
- How to Fix Webpack run error webpack dev server
- [Solved] VScode Error: undefined reference to ‘WinMain’ collect2.exe: error: ld returned 1 exit status