
Recherche avancée
Autres articles (58)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.
Sur d’autres sites (11615)
-
FFmpeg decode OGG Vorbis audio as float, how to get float data from decoder
19 novembre 2020, par cs guyI am trying to decode a OGG Vorbis audio file with the following :


// if opening input failed
 if (avformat_open_input(&pFormatContext, filePath.c_str(), av_find_input_format("ogg"),
 nullptr) != 0) {
 
 LOGE("FFmpegExtractor can not open the file! %s", filePath.c_str());
 return FAILED_TO_LOAD;
 }

 durationInMillis = pFormatContext->duration / AV_TIME_BASE * secondsToMilli;
 LOGD("FFmpegExtractor opened the file, Duration: %llu", durationInMillis);

 avformat_find_stream_info(pFormatContext, nullptr);

 LOGD("pFormatContext streams num: %ui", pFormatContext->nb_streams);

 int sendPacketResult = 0;
 int receiveFrameResult = 0;

 for (int i = 0; i < pFormatContext->nb_streams; i++) {
 AVCodecParameters *pLocalCodecParameters = pFormatContext->streams[i]->codecpar;

 if (pLocalCodecParameters->codec_type == AVMEDIA_TYPE_AUDIO) {
 avCodecContext = avcodec_alloc_context3(avCodec);
 if (!avCodecContext) {
 
 LOGE("FFmpegExtractor avcodec_alloc_context3 failed!");
 return FAILED_TO_LOAD;
 }

 if (avcodec_parameters_to_context(avCodecContext, pLocalCodecParameters) < 0) {
 
 LOGE("FFmpegExtractor avcodec_parameters_to_context failed!");
 return FAILED_TO_LOAD;
 }

 if (avcodec_open2(avCodecContext, avCodec, nullptr) < 0) {
 
 LOGE("FFmpegExtractor avcodec_open2 failed!");
 return FAILED_TO_LOAD;
 }
 }

 while (av_read_frame(pFormatContext, avPacket) >= 0) {
 
 sendPacketResult = avcodec_send_packet(avCodecContext, avPacket);

 
 receiveFrameResult = avcodec_receive_frame(avCodecContext, avFrame);

 // TODO: Get frames PCM data from the decoder, 
 }
 }



I am stuck on the last part. I want to get the decoded data of the current frame as a float between -1 to +1 for all the channels the audio has but I have no idea how to. I looked at the official documents but I could not understand them. How can I get the data from the decoder on the line




// TODO : Get frames PCM data from the decoder,




-
Concatenate multiple video php ffmpeg
3 mai 2017, par Angus SimonsI have multiple files that are already been encoded (they have the same format and size) I would like to concatenate on a single video (that already exist and has to be overwritten).
Following the official FAQ Documentation I should use demuxer
FFmpeg has a concat demuxer which you can use when you want to avoid a
re-encode and your format doesn’t support file level concatenation.The problem is that I should use a
.txt
file with a list of files using this command lineffmpeg -f concat -safe 0 -i mylist.txt -c copy output
where
mylist.txt
should be :file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'How can I do with PHP ?
Also tried with concat protocol
I tried using also the
concat protocol
that re-encode videos with these lines of code :$cli = FFMPEG.' -y -i \'concat:';
foreach ($data as $key => $media) {
$tmpFilename = $media['id'];
$tmpPath = $storePath.'/tmp/'.$tmpFilename.'.mp4';
if ($key != ($dataLenght - 1)) {
$cli .= $tmpPath.'|';
} else {
$cli .= $tmpPath.'\'';
}
}
$cli .= ' -c copy '.$export;
exec($cli);that generate this command line :
/usr/local/bin/ffmpeg -i 'concat:/USER/storage/app/public/video/sessions/590916f0d122b/tmp/1493768472144.mp4|/USER/storage/app/public/video/sessions/590916f0d122b/tmp/1493767926114.mp4|/USER/storage/app/public/video/sessions/590916f0d122b/tmp/1493771107551.mp4|/USER/storage/app/public/video/sessions/590916f0d122b/tmp/1493771114598.mp4' -c:v libx264 /USER/storage/app/public/video/sessions/590916f0d122b/tmp_video_session.mp4
but I got this error :
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc8aa800000] Found duplicated MOOV Atom. Skipped it
-
fate/webp : add test for lossy compression.
26 juin 2016, par Martin Vignali