
Recherche avancée
Autres articles (52)
-
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (8493)
-
Playing RTSP in WPF application with low latency using FFMPEG / FFMediaElement (FFME)
22 mars 2019, par PabokaI’m trying to use FFMediaElement (FFME, WPF MediaElement replacement based on FFmpeg) component to play RSTP live video in my WPF application.
I have a good connection to my camera and I want to play it with minimum available latency.
I’ve reduced the latency by changing
ProbeSize
to its minimal value :private void Media_OnMediaInitializing(object Sender, MediaInitializingRoutedEventArgs e)
{
e.Configuration.GlobalOptions.ProbeSize = 32;
}But I still have about 1 second of latency since the very beginning of the stream. I mean, when I start playing, I have to wait for 1 second till the video appears and then I have 1s of latency.
I’ve also tried to change following parameters :
e.Configuration.GlobalOptions.EnableReducedBuffering = true;
e.Configuration.GlobalOptions.FlagNoBuffer = true;
e.Configuration.GlobalOptions.MaxAnalyzeDuration = TimeSpan.Zero;but it gave no result.
I measured time-interval between FFmpeg output lines (the number in the first column is the time, elapsed from the previous line, ms)
---- OpenCommand: Entered
39 FFInterop.Initialize: FFmpeg v4.0
0 EVENT START: MediaInitializing
0 EVENT DONE : MediaInitializing
379 EVENT START: MediaOpening
0 EVENT DONE : MediaOpening
0 COMP VIDEO: Start Offset: 0,000; Duration: N/A
41 SYNC-BUFFER: Started.
609 SYNC-BUFFER: Finished. Clock set to 1534932751,634
0 EVENT START: MediaOpened
0 EVENT DONE : MediaOpened
0 EVENT START: BufferingStarted
0 EVENT DONE : BufferingStarted
0 OpenCommand: Completed
0 V BLK: 1534932751,634 | CLK: 1534932751,634 | DFT: 0 | IX: 0 | PQ: 0,0k | TQ: 0,0k
0 Command Queue (1 commands): Before ProcessNext
0 Play - ID: 404 Canceled: False; Completed: False; Status: WaitingForActivation; State:
94 V BLK: 1534932751,675 | CLK: 1534932751,699 | DFT: 24 | IX: 1 | PQ: 0,0k | TQ: 0,0kSo, the most the process of "sync-buffering" takes the most of the time.
Is there any parameter of FFmpeg which allows reducing a size of the buffer ?
-
Extracting frames from a video does not work correctly [closed]
13 avril 2024, par Al TilmidhUsing the libraries (libav) and (ffmpeg), I try to extract frames as
.jpg
files from avideo.mp4
, the problem is that my program crashes when I use theCV_8UC3
parameter, but by changing this parameter toCV_8UC1
, the extracted images end up without color (grayscale), I don't really know what I missed, here is a minimal code to reproduce the two situations :

#include <opencv2></opencv2>opencv.hpp>

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

int main()
{
 AVFormatContext *formatContext = nullptr;

 if (avformat_open_input(&formatContext, "video.mp4", nullptr, nullptr) != 0)
 {
 return -1;
 }

 if (avformat_find_stream_info(formatContext, nullptr) < 0)
 {
 return -1;
 }

 AVPacket packet;
 const AVCodec *codec = nullptr;
 AVCodecContext *codecContext = nullptr;

 int videoStreamIndex = av_find_best_stream(formatContext, AVMEDIA_TYPE_VIDEO, -1, -1, &codec, 0);
 if (videoStreamIndex < 0)
 {
 return -1;
 }

 codecContext = avcodec_alloc_context3(codec);
 avcodec_parameters_to_context(codecContext, formatContext->streams[videoStreamIndex]->codecpar);

 if (avcodec_open2(codecContext, codec, nullptr) < 0)
 {
 return -1;
 }

 AVFrame *frame = av_frame_alloc();

 while (av_read_frame(formatContext, &packet) >= 0)
 {
 if (packet.stream_index == videoStreamIndex)
 {
 int response = avcodec_send_packet(codecContext, &packet);
 
 if (response < 0)
 {
 break;
 }

 while (response >= 0)
 {
 response = avcodec_receive_frame(codecContext, frame);
 if (response == AVERROR(EAGAIN))
 {
 // NO FRAMES
 break;
 }

 else if (response == AVERROR_EOF)
 {
 // END OF FILE
 break;
 }

 else if (response < 0)
 {
 break;
 }

 //cv::Mat frameMat(frame->height, frame->width, CV_8UC3, frame->data[0]); // CV_8UC3 → THE PROGRAM CRASHES
 cv::Mat frameMat(frame->height, frame->width, CV_8UC1, frame->data[0]); // CV_8UC1 → WORK BUT IMAGES ARE IN GRAYSCALE
 cv::imwrite("frame_" + std::to_string(frame->pts) + ".jpg", frameMat);
 }
 }

 av_packet_unref(&packet);
 }

 av_frame_free(&frame);
 avcodec_free_context(&codecContext);
 avformat_close_input(&formatContext);

 return 0;
}



-
Fast movie creation using MATLAB and ffmpeg
24 février 2018, par hyiltizI have some time series data that I would like to create into movies. The data could be 2D (about 500x10000) or 3D (500x500x10000). For 2D data, the movie frames are simply line plot using
plot
, and for 3D data, we can usesurf
,imagesc
,contour
etc. Then we create a video file using these frames in MATLAB, then compress the video file usingffmpeg
.To do it fast, one would try not to render all the images to display, nor save the data to disk then read it back again during the process. Usually, one would use
getframe
orVideoWriter
to create movie in MATLAB, but they seem to easily get tricky if one tries not to display the figures to screen. Some even suggest plotting in hidden figures, then saving them as images to disk as.png
files, then compress them usingffmpeg
(e.g. withx265
encoder into.mp4
). However, saving the output ofimagesc
in my iMac took 3.5s the first time, then 0.5s after. I also find it not fast enough to save so many files to disk only to askffmpeg
to read them again. One couldhardcopy
the data as this suggests, but I am not sure whether it works regardless of the plotting method (e.g.plot
,surf
etc.), and how one would transfer data over toffmpeg
with minimal disk access.This is similiar to this, but
immovie
is too slow. This post 3 is similar, but advocates writing images to disk then reading them (slow IO).