12:35
I'm converting MKV files and hardcoding subtitles into MP4 format. I have over 100 files and want to speed the process up by enabling hardware encoding. I am able to hardware encode without hardcoding the subtitles via --filter_complex but as soon as I apply the filter it errors out.
Here is my command line that works perfectly fine.
ffmpeg -i input.mkv -filter_complex "[0:v:0]subtitles='input.mkv':si=0[v]" -map "[v]" -map 0:a:1 -c:a copy -map_chapters -1 "output.mp4"
Here is my command line that works with hardware encoding without --filter_complex
(...)
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);
(...)