
Recherche avancée
Autres articles (90)
-
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 is the first MediaSPIP stable release.
Its official release date is June 21, 2013 and is announced here.
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 (...)
Sur d’autres sites (4956)
-
AVCodecContex returns zero for width and height in android
7 mars 2014, par WhoamiNot sure what was my mistake in the below code. I m trying with ffmpeg 0.11 and SDL2.0 in android.
QUESTION :
Why Width and Height of the CodecContext gives me always zero ?..int main(int argc, char *argv[])
{
int flags;
flags = SDL_INIT_VIDEO | SDL_INIT_TIMER;
if (SDL_Init (flags)) {
LOGD ("Could not intialize Video for SDL: %s \n", SDL_GetError());
}
else
LOGD (" SUCCESS: SDL_Init ");
// ffmpeg Register all services..
ffmpeg_register_all ();
pFrame = avcodec_alloc_frame ();
context = avformat_alloc_context();
err = avformat_open_input (&context, "rtsp:ip:port", NULL, NULL);
if ( err < 0) {
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Unable to open rtsp... ");
return -1;
}
for (i = 0; i < context->nb_streams; i++)
{
// Find the Decoder.
codec = avcodec_find_decoder(context->streams[i]->codec->codec_id);
if (codec->type == AVMEDIA_TYPE_VIDEO ) {
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Found Video Streaming.. ");
videoStreamIndex = i;
}
}
// Play RTSP
av_read_play(context);
// Get Codec Context.
pCodecCtx = context->streams[videoStreamIndex]->codec;
if ( pCodecCtx == NULL )
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "CodecCtx is NULL>>> ");
else
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "CodecCtx is <<<ok>>> ");
//Find the Decoder.
pCodec = avcodec_find_decoder (pCodecCtx->codec_id);
avcodec_open2 (pCodecCtx, pCodec, NULL);
int w = pCodecCtx->width; // Why me getting 0 ?
int h = pCodecCtx->height;
window = SDL_CreateWindow ("Test ffmpeg",SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, SDL_WINDOW_SHOWN|SDL_WINDOW_ALLOW_HIGHDPI);
// What this HIGHDPI Means ??
if ( window != NULL )
{
LOGD (" WINDOW CREATED.. , create Renderer ..");
renderer = SDL_CreateRenderer (window, -1, 0);
}
else
{
LOGD (" Invalid SDL Window ");
}
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Width and Height of PCodeccCtx.. %d .. %d " , w, h);
return 0;
}
</ok> -
FFMPEG screen recording by gdigrab "can't find input device." on Windows 10
7 juillet 2021, par Mateusz BugajI need to implement screen recording in my software but I have a problem with getting gdigrab in windows 10. This code return




"can't find input device." (av_find_input_format("gdigrab") return NULL).




If I try to record desktop by ffmpeg.exe using
ffmpeg -f gdigrab -i desktop out.avi
, the desktop is recording correctly.

#define _CRT_SECURE_NO_WARNINGS
#include 

extern "C"
{
#include "ffmpeg-x86-4.4/include/libavcodec/avcodec.h" 
#include "ffmpeg-x86-4.4/include/libavformat/avformat.h"
#include "ffmpeg-x86-4.4/include/libswscale/swscale.h"
#include "ffmpeg-x86-4.4/include/libavdevice/avdevice.h"
#include "ffmpeg-x86-4.4/include/libavutil/imgutils.h"
#include "ffmpeg-x86-4.4/include/libavutil/dict.h"
#include "SDL2/include/SDL.h"
}


#define OUTPUT_YUV420P 1
#define OUTPUT_H264 1

int main(int argc, char* argv[])
{
 AVFormatContext* pFormatCtx;
 AVStream* videoStream;
 AVCodecContext* pCodecCtx;
 AVCodec* pCodec;
 AVFrame* pFrame, * pFrameYUV;
 AVPacket* pPacket;
 SwsContext* pImgConvertCtx;

 int videoIndex = -1;
 unsigned int i = 0;

 SDL_Window* screen;
 SDL_Renderer* sdlRenderer;
 SDL_Texture* sdlTexture;
 SDL_Rect sdlRect;

 int screen_w = 0;
 int screen_h = 0;

 printf("Starting...\n");



 //AVInputFormat* p = NULL;

 //register device
 avdevice_register_all();
 
 //use gdigrab
 AVInputFormat* ifmt = av_find_input_format("gdigrab");

 if (!ifmt)
 {
 printf("can't find input device.\n");
 return -1;
 }

 AVDictionary* options = NULL;
 if (avformat_open_input(&pFormatCtx, "desktop", ifmt, &options) != 0)
 {
 printf("can't open input stream.\n");
 return -1;
 }

 if (avformat_find_stream_info(pFormatCtx, NULL) < 0)
 {
 printf("can't find stream information.\n");
 return -1;
 }



-
FFMPEG Can't Display The Duration Of a Video
30 août 2021, par MalkavianI'm trying to use ffmpeg to capture frames from a video file, but I can't even get the duration of a video. everytime when I try to access it with
pFormatCtx->duration
I'm getting 0. I know the pointer initialized and contains the correct duration because if I useav_dump_format(pFormatCtx, 0, videoName, 0);
then I actually get the duration data along with other information about the video.
This is what I get when I useav_dump_format(pFormatCtx, 0, videoName, 0);
:

Input #0, avi, from 'futurama.avi':
Duration: 00:21:36.28, start: 0.000000, bitrate: 1135 kb/s
Stream #0.0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 512x384
[PAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s 



I don't understand why
av_dump_format
can display duration and I can't. I checked the function definition, to display the duration, the function also usespFormatCtx->duration
. It's not just the duration other member variables also don't display the proper data when I call them inmain.cpp


Here's my code :


extern "C" {
 #include<libavcodec></libavcodec>avcodec.h>
 #include<libavformat></libavformat>avformat.h>
 #include<libswscale></libswscale>swscale.h>
}

int main(int argc, char *argv[]) {
 AVFormatContext *pFormatCtx = NULL;

 const char videoName[] = "futurama.avi";

 // Register all formats and codecs.
 av_register_all();
 cout << "Opening the video file";
 // Open video file
 int ret = avformat_open_input(&pFormatCtx, videoName, NULL, NULL) != 0;
 if (ret != 0) {
 cout << "Couldn't open the video file." << ret ;
 return -1;
 }
 if(avformat_find_stream_info(pFormatCtx, 0) < 0) {
 cout << "problem with stream info";
 return -1;
 }

 av_dump_format(pFormatCtx, 0, videoName, 0);
 cout << pFormatCtx->bit_rate << endl; // different value each time, not initialized properly.
 cout << pFormatCtx->duration << endl; // 0
 return 0;
}



I don't know if it helps but, I use QtCreator on Ubuntu and linked the libraries statically.