Realtime encoding

This forum is about all development around libVLC.
WorldMaster
New Cone
New Cone
Posts: 5
Joined: 30 Mar 2018 23:02

Realtime encoding

Postby WorldMaster » 30 Mar 2018 23:18

Hello.
It is necessary to develop software using Videolan library for encoding video data. The main requirement is real-time encoding with good quality.
I used the library https://sourceforge.net/projects/x264vfw/ but on Windows 10 when I close the stream I get an error that can not be fixed.

So. I downloaded the source. collected everything for Visual Studio 2017 C ++.

Running the code from the example, I can not open the encoder.
When I open, I get an error: "x264 [error]: invalid level_idc: 8"

Tell me please, what does this error mean and what is required to start coding in real time?

Code: Select all

int main() { int width, height; x264_param_t param; x264_picture_t pic; x264_picture_t pic_out; x264_t *h; int i_frame = 0; int i_frame_size; x264_nal_t *nal; int i_nal; // тут с параметров задаются высота и ширинакадра //FAIL_IF_ERROR(!(argc > 1), "Example usage: example 352x288 <input.yuv >output.h264\n"); //FAIL_IF_ERROR(2 != sscanf(argv[1], "%dx%d", &width, &height), "resolution not specified or incorrect\n"); width = 352; height = 288; /* Get default params for preset/tuning */ if (x264_param_default_preset(&param, "medium", NULL) < 0) goto fail; /* Configure non-default params */ param.i_bitdepth = 8; param.i_csp = X264_CSP_I420; param.i_width = width; param.i_height = height; param.b_vfr_input = 0; param.b_repeat_headers = 1; param.b_annexb = 1; /* Apply profile restrictions. */ if (x264_param_apply_profile(&param, "high") < 0) goto fail; if (x264_picture_alloc(&pic, param.i_csp, param.i_width, param.i_height) < 0) goto fail; #undef fail #define fail fail2 h = x264_encoder_open(&param); if (!h) goto fail; #undef fail #define fail fail2 h = x264_encoder_open(&param); <--- Here im getting zero in h and error in console if (!h) goto fail; #undef fail #define fail fail3 int fgop = 1; #undef fail fail3 : x264_encoder_close(h); fail2: x264_picture_clean(&pic); fail: return -1; }

Sorry for the code. I do not understand why it is displayed without the newline characters.

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Realtime encoding

Postby mfkl » 16 Apr 2018 09:47

Hi,

Can you post a github gist link (or something else) to make this readable please?

Cheers.
https://mfkl.github.io


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 22 guests