zackees / zcmds

Swiss army knife of insanely productive CLI and AI tools. Cross platform.
MIT License
27 stars 5 forks source link

Unrecognized option 'cq' #10

Open sugizo opened 2 months ago

sugizo commented 2 months ago

execute !vid2mp4 --rencode --nvenc --preset 'medium' --crf 23 'ForBiggerBlazes.mp4'

result

Running:
  static_ffmpeg -hide_banner -i "ForBiggerBlazes.mp4"  -vcodec h264_nvenc -preset medium -cq 23 -c:a copy -y "ForBiggerBlazes_converted.mp4"
Unrecognized option 'cq'.
Error splitting the argument list: Option not found
Generated ForBiggerBlazes_converted.mp4
zackees commented 2 months ago

Can you please upload the mp4 and I'll try and fix this today.

sugizo commented 2 months ago

mp4 file wget -c http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4

info

zackees commented 2 months ago

notes from chat gpt 4

The error message "Unrecognized option 'cq'" indicates that the option you provided (-cq) is not recognized by ffmpeg. The correct option for setting the quality when using the nvenc codec for NVIDIA hardware encoding is -cq:v for setting the Constant Quality value for the video stream. However, since you're trying to use CRF-like behavior, you actually want to use -rc constqp -qp 23 instead.

Here is how you should modify your command:

static_ffmpeg -hide_banner -i "ForBiggerBlazes.mp4" -vcodec h264_nvenc -preset medium -rc constqp -qp 23 -c:a copy -y "ForBiggerBlazes_converted.mp4"

In this corrected command:

-rc constqp sets the rate control mode to constant quantization parameter. -qp 23 sets the quantization parameter for both I, P, and B frames to 23, which mimics the behavior of CRF in x264/265 but in a manner suitable for NVENC.