
Recherche avancée
Autres articles (90)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...) -
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.
Sur d’autres sites (7939)
-
Decoding with FFMPEG on Visual Studio 2010
6 juin 2013, par user2439801I just started using FFMPEG with C++ and try to code an audio decoder then write the decoded audio into a file.
However i'm not sure about which data to write to the output file. As far as i know from looking at the sample codes it seems to be the AVFrame -> data[0].
But when i try to print it on the consoles, i get some random numbers that are different each time i run the program. And when i try to write this AVFrame->data[0] into a file i keep getting an error.So my question is how can i write the decoded audio after i call the function av_codec_decode_audio4 ?
Below i attached my code and i pass the argument "C :\02.mp3" which is a path for a valid mp3 file on my PC.
Thank you for your help.
// TestFFMPEG.cpp : Audio Decoder
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <sstream>
extern "C" {
#include
#include
#include
}
using namespace std;
int main(int argc, char* argv[])
{
int audioStream = -1;
AVCodec *aCodec;
AVPacket avPkt;
AVFrame *decode_frame = avcodec_alloc_frame();
AVCodecContext *aCodecCtxt;
AVFormatContext *pFormatCtxt = NULL;
if(argc != 2) { // Checking whether there is enough argument
return -1;
}
av_register_all(); //Initialize CODEC
avformat_network_init();
av_init_packet (&avPkt);
if (avformat_open_input (&pFormatCtxt, argv[1],NULL,NULL)!= 0 ){ //Opening File
return -2;
}
if(avformat_find_stream_info (pFormatCtxt,NULL) < 0){ //Get Streams Info
return -3;
}
AVStream *stream = NULL;
//av_read_play (pFormatCtxt); //open streams
for (int i = 0; i < pFormatCtxt->nb_streams ; i++) { //Find Audio Stream
if (pFormatCtxt->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO){
audioStream =i;
}
}
aCodecCtxt = pFormatCtxt ->streams [audioStream]->codec; // opening decoder
aCodec = avcodec_find_decoder( pFormatCtxt->streams [audioStream] ->codec->codec_id);
if (!aCodec) {
return -8;
}
if (avcodec_open2(aCodecCtxt,aCodec,NULL)!=0) {
return -9;
}
int cnt = 0;
while(av_read_frame(pFormatCtxt,&avPkt) >= 0 ){
if (avPkt.stream_index == audioStream){
int check = 0;
int result = avcodec_decode_audio4 (aCodecCtxt,decode_frame,&check, &avPkt);
cout << "Decoded : "<< (int) decode_frame->data[0] <<", "<< "Check : " << check << ", Format :" << decode_frame->format <<" " << decode_frame->linesize[0]<< " "<<cnt return="return" acodec="acodec">id;
}
</cnt></sstream></fstream></iostream> -
Batch Programming Looping ?
13 mai 2013, par Michael BarthI'm not an expert in batch programming, my only skill is in C\C++. I'm not even sure how to go about this really.
I've got a bunch of videos like Video1.mp4, Video2.mp4 (that's not their actual names, but they do have numbers indicating beginning and end)
Basically I have this
FFMPEG
command that I can use to convert all of these to an aspect ratio of 16:10 that looks something like this :"ffmpeg -i "Section 1 Video 1.mp4" -aspect 16:10 OutSection 1 Video 1.mp4"
"ffmpeg -i "Section 1 Video 2.mp4" -aspect 16:10 OutSection 1 Video 2.mp4"
"ffmpeg -i "Section 2 Video 1.mp4" -aspect 16:10 OutSection 2 Video 1.mp4"Now instead of writing this command over and over again, is there anyway for me to substitute the numbers for actual variables ? I know that Section 1 ends at Video 27 and Section 2 ends at Video 26 and so on. Basically I need the loop to run 165 times so I don't need to write the command 165 times.
Or is this beyond the scope of capability of a mere batch program ?
-
ffmpeg Video Scan Progress during Frame Extarction
5 avril 2013, par IsantipovI scan input video to extract certain frames using
ffmpeg
's select filter. The selection is based on a complex creteria and the number of extracted frames can't be predicted (I'm doing scene detection, but this can be something different - e.g. selecting all the I frames, etc).What I need is to display the percentage of scanned (decoded) video (e.g. 10% or 90%).
I tried several ways to do this parsing console output as people usually do when dealing with encoding, but it doesn't help with the progress of scanning (e.g. Can ffmpeg show a progress bar ? or ffmpeg Progress Bar - Encoding Percentage in PHP)
ffmpeg -progress sceneProgr.txt -i input.wmv -vsync passthrough -an -vf select='gt(scene\,0.2)',showinfo scene%%05d.png
The output this produces is as follows :
<..>
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A
n:0 pts:16550 pts_time:16.55 pos:4205325 fmt:rgb24 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:95895BC9 plane_checksum:[95895BC9]
frame= 1 fps=0.7 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A
n:1 pts:24591 pts_time:24.591 pos:6685325 fmt:rgb24 sar:0/1 s:640x480 i:P iskey:0 type:P checksum:FF4CC015 plane_checksum:[FF4CC015]
'frame=...' and 'n:...' lines are repeated for each of the extracted frames.Both
frame=...
andn:...
lines refer to the numbers in the output and therefore can't be used to calculate progress the way people usually do this (as I can't predict how many frames will be found beforehead and besides, they are not uniformly spread across the input video).
If I specify
-progress progress.txt
parameter, the progress.txt file is as follows :frame=5
fps=1.2
stream_0_0_q=0.0
total_size=N/A
out_time_ms=43209833
out_time=00:00:43.209833
dup_frames=0
drop_frames=0
progress=continue
frame=6
fps=1.3
stream_0_0_q=0.0
total_size=N/A
out_time_ms=52252200
out_time=00:00:52.252200
dup_frames=0
drop_frames=0
progress=continue
frame=6
fps=1.2
stream_0_0_q=0.0
total_size=N/A
out_time_ms=52252200
out_time=00:00:52.252200
dup_frames=0
drop_frames=0
progress=continueNew portion is written approximately every second and refers to the last extracted frame.
Which is somewhat helpful asout_time
refers to the last extracted frames' position in the input video, so I can calculate the progress of the scan from it asprogress = out_time_ms/total_input_time
But this is not ideal as it will be updated only when the new frame which matches the
select
criteria is extracted. So, If I have a large portion of video with no matching frames, the progress won't change for a lot of time.
Wrapping-up :
I am looking for a way to calculate the progress of video scanning when using select filter.
Any ideas are strongly appreciated.