Closed bsyomov closed 1 year ago
i think you can pass that via the ffmpeg component? maybe "input_args" or "hwaccel_args"?
also here as well.
To change the codec used for the recorder you can set codec: h264_nvenc
under recorder
i think you can pass that via the ffmpeg component?maybe "input_args" or "hwaccel_args"
I tried using "hwaccel_args", it adds ffmpeg argument before -i. Seems like I can use "input_args" for decoder, but not for encoder in "recorder" section. @roflcoopter May be we need somthing like "output_args" in "recorder" map?
To change the codec used for the recorder you can set codec: h264_nvenc under recorder
Yes, i can, but i need to change encoder settings, not encoder itself(switch "-c:v h264_nvenc" to "-c:v h264_nvenc -preset medium"). Now i am use SW h264 encoder as workaround, But h264_nvenc must work too, If I explicitly specify the "preset" parameter.
P.S. Sorry for my english, maybe my explanations are not clear?
Ahh i see now what you mean. As you say a new config option is needed to support this, will get to it soon!
When does this issue occur, is it when segments are concatenated? Or is it when the camera starts?
Trying to figure out the best way to solve this.
When segments are concatenated (and stream re-encoded in my configuration).
recorder:
codec: h264_nvenc
video_filters:
- scale=1920x1080:flags=lanczos
Implemented in dev
tag now.
You should be able to use this config now:
recorder:
codec: h264_nvenc
video_filters:
- scale=1920x1080:flags=lanczos
output_args:
- -preset
- medium
After some debug, error is: "lossless encoding not supported" Seems like this ffmpeg bug: https://trac.ffmpeg.org/ticket/9165 - some trouble with presets.
This command works on my host(debian 10, quite old ffmpeg), but not in container:
ffmpeg -hide_banner -loglevel verbose -y -i /recordings/test.mp4 -c:v h264_nvenc -pix_fmt nv12 -movflags +faststart /recordings/test1.mp4
on host:
in container:
This one works in container too:
ffmpeg -hide_banner -loglevel verbose -y -i /recordings/test.mp4 -c:v h264_nvenc -preset medium -pix_fmt nv12 -movflags +faststart /recordings/test1.mp4
As workaround: How i can pass "preset" or other encoder parameters to recorder output from config?