22:14
I have function for resampling one channel of audio (as a float array):
int resample_and_save(float *audio_input, int input_sample_rate, int output_sample_rate, int input_num_of_samples, const char *output_file)
AVChannelLayout ch_layout = AV_CHANNEL_LAYOUT_MONO;
SwrContext *swr_ctx = swr_alloc();
uint8_t* resampled_data = NULL;
float *audio_output = NULL;
int ret = 0;
if (!swr_ctx)
fprintf(stderr, "Could not allocate resampler context\\n");
return -1;
av_opt_set_chlayout(swr_ctx, "in_chlayout", &ch_layout, 0);
(...)
12:04
I was using video_player to do the rest of the metadata extraction I need but I didn't find a way to get the resolution with this package.
11:11
I am building a project that uses the ffmpeg libav libraries and I can't seem to get meson to compile with them.
I have tried including just the headers but then definitions can't be found. I then compiled all of the source files I needed, and that didn't work either.
I have compiled the whole thing into objects and plan to link them but I feel there should be an easier way.
09:13
I have several mp4 video files and want to concat there video streams into a new mp4 file. The command I used shows below:
ffmpeg -f concat -safe 0 -i concat.txt -an -c:v copy -y out.mp4
The fps of result does not meet expectations.
For example, there are two input wrote in concat.txt:
file temp_result_0.mp4
file temp_result_1.mp4
file
duration
number of frames
fps
tbr
temp_result_0.mp4
60.0
1200
20
20
temp_result_0.mp4
0.1
2
20
20
out.mp4
6