
Recherche avancée
Autres articles (112)
-
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)
Sur d’autres sites (10978)
-
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
-
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,




-
Right way to use vmaf with ffmpeg
14 juin, par dravitI am trying to calculate the VMAF score of a processed video wrt the original file.


Command I have used :


ffmpeg -y -loglevel info -stats -i original.mp4 -i processed.mp4 -lavfi "[0]null[refdeint];[refdeint]scale=1920:1080:flags=neighbor[ref];[1]setpts=PTS+0.0/TB[b];[b]scale=1920:1080:flags=neighbor[c];[c][ref]libvmaf=log_fmt=json:phone_model=1:model_path={model_path_here}/vmaf_v0.6.1.json:n_subsample=1:log_path=log.json" -f null -



Now as per the official documentation of
vmaf with ffmpeg
found here, it sayssource/reference
file followed by theencoded/distorted/processed
file.

But almost all of the blogs I came across, they are using the other way round order of the args, i.e.
processed
file followed by theoriginal
file.

Few examples :


- 

-
https://medium.com/@eyevinntechnology/keep-an-eye-on-the-video-quality-b9bcb58dd5a1 : search for "Using VMAF within FFMPEG" in it.


-
https://websites.fraunhofer.de/video-dev/calculating-vmaf-and-psnr-with-ffmpeg/ : search for "Metric Calculation with FFmpeg" in it.








EDIT


NOTE : Changing the order does change the VMAF score.


-