
Recherche avancée
Autres articles (72)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...)
Sur d’autres sites (10392)
-
How to save image from the middle of a video ?
29 octobre 2017, par puppon -suI need to make a thumbnail for a video, to seek to the 25% of a video and save the image. Here is what I’m doing right now, but it only saves black image.
#include
#include <libavformat></libavformat>avformat.h>
#include <libavutil></libavutil>dict.h>
int main (int argc, char **argv)
{
av_register_all();
AVFormatContext *pFormatCtx = avformat_alloc_context();
int res;
res = avformat_open_input(&pFormatCtx, "test.mp4", NULL, NULL);
if (res) {
return res;
}
avformat_find_stream_info(pFormatCtx, NULL);
int64_t duration = pFormatCtx->duration;
// Find the first video stream
int videoStream=-1;
for(int i=0; inb_streams; i++) {
if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
videoStream=i;
break;
}
}
if(videoStream==-1) {
return -1;
}
AVCodecContext *pCodecCtxOrig = NULL;
// Get a pointer to the codec context for the video stream
pCodecCtxOrig=pFormatCtx->streams[videoStream]->codec;
AVCodec *pCodec = NULL;
// Find the decoder for the video stream
pCodec=avcodec_find_decoder(pCodecCtxOrig->codec_id);
if(pCodec==NULL) {
fprintf(stderr, "Unsupported codec!\n");
return -1; // Codec not found
}
AVCodecContext *pCodecCtx = NULL;
// Copy context
pCodecCtx = avcodec_alloc_context3(pCodec);
if(avcodec_copy_context(pCodecCtx, pCodecCtxOrig) != 0) {
fprintf(stderr, "Couldn't copy codec context");
return -1; // Error copying codec context
}
// Open codec
if(avcodec_open2(pCodecCtx, pCodec, NULL)<0) {
return -1; // Could not open codec
}
AVFrame *pFrame = NULL;
pFrame=av_frame_alloc();
AVFrame *pFrameRGB = NULL;
pFrameRGB=av_frame_alloc();
// Determine required buffer size and allocate buffer
int numBytes=avpicture_get_size(AV_PIX_FMT_RGB24, pCodecCtx->width,
pCodecCtx->height);
uint8_t *buffer = NULL;
buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
// Assign appropriate parts of buffer to image planes in pFrameRGB
// Note that pFrameRGB is an AVFrame, but AVFrame is a superset
// of AVPicture
res = avpicture_fill((AVPicture *)pFrameRGB, buffer, AV_PIX_FMT_RGB24,
pCodecCtx->width, pCodecCtx->height);
if (res<0) {
return;
}
// I've set this number randomly
res = av_seek_frame(pFormatCtx, videoStream, 20.0, AVSEEK_FLAG_FRAME);
if (res<0) {
return;
}
AVPacket packet;
while(1) {
av_read_frame(pFormatCtx, &packet);
if(packet.stream_index==videoStream) {
int frameFinished;
avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
if(frameFinished) {
SaveFrame(pFrameRGB, pCodecCtx->width,
pCodecCtx->height);
break;
}
}
}
avformat_close_input(&pFormatCtx);
return 0;
}
void SaveFrame(AVFrame *pFrame, int width, int height) {
FILE *pFile;
char szFilename[] = "frame.ppm";
int y;
// Open file
pFile=fopen(szFilename, "wb");
if(pFile==NULL)
return;
// Write header
fprintf(pFile, "P6\n%d %d\n255\n", width, height);
// Write pixel data
for(y=0; ydata[0]+y*pFrame->linesize[0], 1, width*3, pFile);
// Close file
fclose(pFile);
}I was following this tutorial http://dranger.com/ffmpeg/tutorial01.html http://dranger.com/ffmpeg/tutorial07.html . It says that it was updated in 2015, but there already are some warnings about deprecated code, for example here :
pFormatCtx->streams[i]->codec
.I got video duration (in microseconds), but I don’t understand what I should send to
av_seek_frame
. Can I somehow use frame number for both duration and seeking, instead of time ? -
mov : Save number of stsd elements after stream extradata allocation
29 juin 2016, par Vittorio Giovara -
Adjust MP3 Files Volume and save it to new file [duplicate]
5 mai 2017, par Gio VannoThis question already has an answer here :
I’m trying to make an audio-editing app here
This program can adjust(increase and decrease) the mp3 file volume at the specific time(adjust start time and finish time, example : from 00:10 to 00:20) and we can save it to a new mp3 file.my questions is :
-Does ffmpeg work for it ?
-is there any alternative besides ffmpeg ?
Thank you