chenxinfeng4 / ffmpegcv

The ffmpegcv is a ffmpeg backbone for open-cv like Video Reader and Writer
166 stars 25 forks source link

preset default set 'p2' when use nvenc_hevc encoder will get error #47

Closed Yshelgi closed 2 months ago

Yshelgi commented 3 months ago

When i use hevc as videowrite encoder and not set preset,i get error as pic image

from this error, i track the code and find the default preset = p2 in ffmpeg_writer.py image

I use ffmpeg -h encoder=nvenc_hevc to check preset,but 'p2' is not in options image

In order to solve this problem, either force the preset parameter to be set, or modify the default value setting here in the source code.

chenxinfeng4 commented 3 months ago

I see, and I will figure it out

---- Replied Message ---- | From | @.> | | Date | 07/12/2024 14:36 | | To | @.> | | Cc | @.***> | | Subject | [chenxinfeng4/ffmpegcv] preset default set 'p2' when use nvenc_hevc encoder will get error (Issue #47) |

When i use hevc as videowrite encoder and not set preset,i get error as pic image.png (view on web)

from this error, i track the code and find the default preset = p2 in ffmpeg_writer.py image.png (view on web)

I use ffmpeg -h encoder=nvenc_hevc to check preset,but 'p2' is not in options image.png (view on web)

In order to solve this problem, either force the preset parameter to be set, or modify the default value setting here in the source code.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Yshelgi commented 3 months ago

I see, and I will figure it out ---- Replied Message ---- | From | @.> | | Date | 07/12/2024 14:36 | | To | @.> | | Cc | @.> | | Subject | [chenxinfeng4/ffmpegcv] preset default set 'p2' when use nvenc_hevc encoder will get error (Issue #47) | When i use hevc as videowrite encoder and not set preset,i get error as pic image.png (view on web) from this error, i track the code and find the default preset = p2 in ffmpeg_writer.py image.png (view on web) I use ffmpeg -h encoder=nvenc_hevc to check preset,but 'p2' is not in options image.png (view on web) In order to solve this problem, either force the preset parameter to be set, or modify the default value setting here in the source code. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>

Thank you for your prompt reply, this is probably a small bug. In addition, I would like to ask if there are any good asynchronous reading and writing strategies? I notice noblock for capture,but for writer may need use Queue to speed up.

chenxinfeng4 commented 3 months ago

You probabily get other ffmpeg version installed. The ffmpeg has compatibility issues from v4 to v6.

You can follow this to reinstall the ffmpeg

 #1A. LINUX: sudo apt install ffmpeg
 #1B. MAC (No NVIDIA GPU): brew install ffmpeg
 #1C. WINDOWS: download ffmpeg and add to the path
 #1D. CONDA: conda install ffmpeg=6.0.0     #don't use the default 4.x.x version

which ffmpeg #or `where ffmpeg`
ffmpeg -version
chenxinfeng4 commented 3 months ago

Yes, noblock also support writer.

ffmpegcv.noblock(ffmpegcv.VideoWriter, *args)

chenxinfeng4 commented 2 months ago

Since no more question, this issue will be closed.