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″“
- [How to Solve] canvas.save(Canvas.ALL_SAVE_FLAG)
- How to Fix win10 video dxgkrnl fatal error
- Download and save uniapp pictures to Android error reporting app
- [Solved] (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk.
- [Solved] Tensorflow error or keras error and tf.keras error: oom video memory is insufficient
- Avpro Video Error: MediaPlayer.FileLocation [How to Solve]
- [Solved] Gitee generates public key error: Enter file in which to save the key…
- Opencv c++ Read Video Error: capture.isOpened() Return false
- [Solved] Redis—-(error) MISCONF Redis is configured to save RDB snapshots
- ValueError: Input 0 of node import/save/Assign was passed float from import/beta1_power:0 incompatib
- Laravel model save if the table has no ID field Error [How to Solve]
- [Solved] redis Error: Can‘t save in background fork Cannot allocate memory
- [Solved] Tsingsee green rhinoceros video pedestrian intelligence detection test error panic: runtime error
- [Solved] Rtthread DCM component dcm_cache_save interface Error: mkdir:/data failed
- [Solved] Win nvidia-smi Cann’t Use,Failed to initialize NVML: Unknown Error
- Unknown SSL protocol error in connection to xxx:443 [How to Solve]
- [Solved] unknown error: DevToolsActivePort file doesn‘t exis
- [Solved] UserWarning: CUDA initialization: CUDA unknown error
- ubuntu20.04——hdaudioC0D2: unable to bind the codec