05:05
FFmpeg.AutoGen version: 7.0
Following is similar with Program.cs in "FFmpeg.AutoGen.Example" directory.
var sourceSize = vsd.FrameSize;
var sourcePixelFormat = AVPixelFormat.AV_PIX_FMT_CUDA;
var destinationSize = sourceSize;
var destinationPixelFormat = AVPixelFormat.AV_PIX_FMT_BGRA;
VideoFrameConverter vfc = new VideoFrameConverter(sourceSize, sourcePixelFormat, destinationSize, destinationPixelFormat);
However, when 'ffmpeg.sws_getContext' is called, ffmpeg shows below error message.
ffmpeg error message: [swscaler ⓐ 000001b7af30aa00] (...)
00:47
I need to write function in C that changes sample rate of one audio channel (float linear array).
I have this now:
int resample_audio(float *audio_input, int input_sample_rate, int output_sample_rate, int input_num_of_samples, float *audio_output, int *result_num_of_samples)
SwrContext* swr_ctx = swr_alloc();
if (!swr_ctx)
fprintf(stderr, "Could not allocate SwrContext\\n");
return -1;
av_opt_set_int(swr_ctx, "in_channel_layout", AV_CH_LAYOUT_MONO, 0);
av_opt_set_int(swr_ctx, "out_channel_layout", AV_CH_LAYOUT_MONO, 0);
(...)