Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask for support to create a obs encoder #148

Open
PMGZED opened this issue Dec 21, 2024 · 5 comments
Open

Ask for support to create a obs encoder #148

PMGZED opened this issue Dec 21, 2024 · 5 comments
Labels
question Further information is requested

Comments

@PMGZED
Copy link

PMGZED commented Dec 21, 2024

Hi, you helped me to got running this ffmpeg on my radxa zero 3w
now i try to create a obs encoder. Obs work fine with the panfrost driver for send the stream obs need a encoder

i have copy the nvenc encode and change to use the rkmpp eincoder but if the stream try to init the encoder it failed.

the cops ffmpeg-video-encoder calls the avcodec_open2 function. this function return -542398533 but i don know why.
maybe you have a idea?
i have already start a thread in obs forum and discord https://obsproject.com/forum/threads/is-there-a-esay-way-to-add-ffmpeg-with-a-videocodec-as-a-streaming-encoder.182707/

the call of avcidec_open2 are in https://github.com/obsproject/obs-studio/blob/master/plugins/obs-ffmpeg/obs-ffmpeg-video-encoders.c line 13

the value of the settings

	info("settings:\n"
	     "\tencoder:      %s\n"
	     "\trate_control: %s\n"
	     "\tbitrate:      %d\n"
	     "\tcqp:          %d\n"
	     "\tkeyint:       %d\n"
	     "\tprofile:      %s\n"
	     "\twidth:        %d\n"
	     "\theight:       %d\n"
	     "\tb-frames:     %d\n",
	     enc->ffve.enc_name, rc, bitrate, cqp, enc->ffve.context->gop_size, profile,
	     enc->ffve.context->width, enc->ffve.height, enc->ffve.context->max_b_frames);

	return ffmpeg_video_encoder_init_codec(&enc->ffve);

WIN_20241221_15_44_05_Pro

@PMGZED
Copy link
Author

PMGZED commented Dec 21, 2024

i think the parameter are wrong. can u tell me what the minimum parameter require the encoder need?

@PMGZED
Copy link
Author

PMGZED commented Dec 21, 2024

Ok i had not permissions vor the rkmpp devices. (how can i set the device rights permanent after every restart i need to change with chmod ? )
WIN_20241221_20_02_50_Pro
so now it dont got a error but the fps brake down to 1 fps but dont know why.
cpu usage is about 25%

is it possible thats the dual use with panfrost for obs and mpp not work well?

@PMGZED PMGZED changed the title Ask for support to create a obs ecndoer Ask for support to create a obs encoder Dec 21, 2024
@nyanmisaka nyanmisaka added the question Further information is requested label Dec 22, 2024
@nyanmisaka
Copy link
Owner

set the device rights permanent

https://jellyfin.org/docs/general/administration/hardware-acceleration/rockchip/#configure-on-linux-host

but the fps brake down to 1 fps but dont know why

I also have no experience with ffmpeg-rockchip in obs-studio. You can turn on ffmpeg logging and track what is causing the 1fps.

@PMGZED
Copy link
Author

PMGZED commented Dec 24, 2024

i have switch to the rock 5b with more power.
if i use the record it works but not if i want to use my stream encoder
WIN_20241224_10_06_09_Pro
WIN_20241224_10_08_42_Pro
ignore the settings on the right side i overwrite them to test in my code

maybe i forgot to set some information?
int profile =0;
int bitrate = 5000;
int keyint_sec = 250;
enc->ffve.context->height = 1080;
enc->ffve.context->width = 1920;
enc->ffve.context->framerate.num = 30;
enc->ffve.context->time_base.num = 1;
enc->ffve.context->pix_fmt = AV_PIX_FMT_NV12;
info("settings:\n"
"\tencoder: %s\n"
"\trate_control: %i\n"
"\tbitrate: %d\n"
"\tkeyint: %d\n"
"\tprofile: %i\n"
"\twidth: %d\n"
"\theight: %d\n"
"\tb-frames: %d\n"
"\tFramerate: %d\n"
"\tTimebase: %d\n"
"\tFormat: %d\n",
enc->ffve.enc_name, rcmode, bitrate, enc->ffve.context->gop_size, profile, enc->ffve.context->width,
enc->ffve.context->height, enc->ffve.context->max_b_frames, enc->ffve.context->framerate.num,
enc->ffve.context->time_base.num, enc->ffve.context->pix_fmt);

@nyanmisaka
Copy link
Owner

There are no special parameters that need to be set. Therefore I think the error is in obs-ffmpeg rather than ffmpeg-rockchip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants