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);
(...)
22:22
i'm trying to merge video and audio from ytdl-core with ffmpeg and export it to user in mp4. The output video apears without time (inifit duration) and can not seek or navigate to another point of the video.
app.get('/downloadmp4', async (req, res)=>
let url = req.query.url;
if (!ytdl.validateURL(url))
return res.sendStatus(400);
let title = 'video';
let info = await ytdl.getInfo(url);
title = info.videoDetails.title.replace(/[^\\x00-\\x7F]/g, "");
res.header('Content-Disposition', `attachment; (...)