
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (101)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
Sur d’autres sites (10499)
-
Find the right path to my folder on server to execute cmd php
12 avril 2021, par Medsexec("ffmpeg -i $temp_name -r $FPS -vf scale='$resolutionWidth:$resolutionHeight' -b:v $bitrateVideo -bufsize $bitrateAudio videos/$videoURLnameTemp.mp4", $res);


This command works well locally, but once in production, the files are not stored in the video folder which is at the same level as the file in the server. Is there any way to get the output on the exec function to catch an error or something ? I tried the output by reference in the method but when I do a var_dump of the result, I get an array(0) {}.


I also tried to put the realpath in the path but it doesn't seem to work. ffmpeg is located at the same level as all files and the videos folder.


-
FFMPEG convert from .mov to .webm - "Unable to find suitable output for vp8"
21 juin 2018, par G. ThreepwoodI need a transparent video for unity and the only solution I found is with a .webm.
a couple of moths ago I used this :
ffmpeg -i input.mov -c:v libvpx -minrate 10M -maxrate 10M -b:v 10M -c:a -vcodec vp8 -pix_fmt yuva420p -metadata:s:v:0 alpha_mode="1" output.webm
but now it give me this error :
Unable to find suitable output for vp8
Vp8 invalid argument
I don’t know ffmpeg so I can’t change the command.
Are there errors or I miss some codec ? -
Can't find error in function for changing sampling rate
29 avril 2024, par kitty uwuI have function for changing sampling rate of audio (only one channel) :


int change_sampling_rate(float *audio_input, int input_sample_rate, int output_sample_rate, int input_num_of_samples, float **audio_output, int *result_num_of_samples) {
 AVChannelLayout src_ch_layout = AV_CHANNEL_LAYOUT_MONO;
 AVChannelLayout dst_ch_layout = AV_CHANNEL_LAYOUT_MONO;

 struct SwrContext *swr_ctx;
 swr_ctx = swr_alloc();
 int ret;
 if (!swr_ctx) {
 fprintf(stderr, "Could not allocate resampler context\n");
 ret = AVERROR(ENOMEM);
 }

 av_opt_set_chlayout(swr_ctx, "in_chlayout", &src_ch_layout, 0);
 av_opt_set_int(swr_ctx, "in_sample_rate", input_sample_rate, 0);
 av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_FLT, 0);

 av_opt_set_chlayout(swr_ctx, "out_chlayout", &dst_ch_layout, 0);
 av_opt_set_int(swr_ctx, "out_sample_rate", output_sample_rate, 0);
 av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", AV_SAMPLE_FMT_FLT, 0);

 if ((ret = swr_init(swr_ctx)) < 0) {
 fprintf(stderr, "Failed to initialize the resampling context\n");
 return -1;
 }

 int output_samples_count = av_rescale_rnd(swr_get_delay(swr_ctx, input_sample_rate) + input_num_of_samples, output_sample_rate, input_sample_rate, AV_ROUND_UP);
 uint8_t **resampled_data = NULL;
 if (av_samples_alloc_array_and_samples(&resampled_data, NULL, 1, output_samples_count, AV_SAMPLE_FMT_FLT, 0) < 0) {
 fprintf(stderr, "Could not allocate resampled data\n");
 swr_free(&swr_ctx);
 return -1;
 }

 const uint8_t *in_samples[1] = {(const uint8_t *)audio_input};
 int frame_count = swr_convert(swr_ctx, resampled_data, output_samples_count, in_samples, input_num_of_samples);

 if (frame_count < 0) {
 fprintf(stderr, "Error while resampling\n");
 av_freep(&resampled_data[0]);
 free(resampled_data);
 swr_free(&swr_ctx);
 return -1;
 }

 *audio_output = (float *) malloc(frame_count * sizeof(float));
 if (!*audio_output) {
 fprintf(stderr, "Could not allocate memory for output\n");
 av_freep(&resampled_data[0]);
 free(resampled_data);
 swr_free(&swr_ctx);
 return -1;
 }

 memcpy(*audio_output, resampled_data[0], frame_count * sizeof(float));

 *result_num_of_samples = frame_count;
 av_freep(&resampled_data[0]);
 swr_free(&swr_ctx);
 return SUCCESS;
}



When I run tests on time lag between two files (mp3) with different sampling rates, it gives answer that differs on about 15-20 ms with right answer. Can anybody, please, help me find mistakes in the code ?


For example, I have two audios : [audio_1] (https://jmp.sh/s/USFPaGnHXVuKFVYarYpm) and [audio_2] (https://jmp.sh/s/jbmWbPTwkdDujAocmi56) - second audio is just a sample of first. The answer should be
35264 ms
, but my function gives35249 ms
:(