
Recherche avancée
Médias (91)
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Lights in the Sky
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Head Down
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Echoplex
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Discipline
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Letting You
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (97)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Installation en mode standalone
4 février 2011, parL’installation de la distribution MediaSPIP se fait en plusieurs étapes : la récupération des fichiers nécessaires. À ce moment là deux méthodes sont possibles : en installant l’archive ZIP contenant l’ensemble de la distribution ; via SVN en récupérant les sources de chaque modules séparément ; la préconfiguration ; l’installation définitive ;
[mediaspip_zip]Installation de l’archive ZIP de MediaSPIP
Ce mode d’installation est la méthode la plus simple afin d’installer l’ensemble de la distribution (...)
Sur d’autres sites (7756)
-
libavfilter : vf_scale : Properly take in->color_range into account
23 février 2022, par Martin Storsjölibavfilter : vf_scale : Properly take in->color_range into account
While swscale can be reconfigured with sws_setColorspaceDetails,
the in/out ranges also need to be set before calling
sws_init_context, otherwise the initialization might choose
fastpaths that don't take the ranges into account.Therefore, look at in->color_range too, when deciding on whether
the scaler needs to be reconfigured.Add a new member variable for keeping track of this, for being
able to differentiate between whether the scale filter parameter
"in_range" has been set (which should override whatever the input
frame has set) or whether it has been configured based on the
latest frame (which should trigger reconfiguring the scaler if
the input frame ranges change).Fixes : Ticket #9576
Signed-off-by : Martin Storsjö <martin@martin.st>
-
In ffmpeg command-line, how to show all filter settings and their parameters before encoding ?
7 décembre 2023, par F.X.Is there a way to force the
ffmpeg
command-line to display a comprehensive list of all filters and their parameters, even those that are applied automatically like-vf scale
?

(EDIT : To clarify, I do not mean filter documentation, but rather displaying filters that are instantiated at runtime for a particular command-line, just before transcoding starts. The goal of this is mostly checking that ffmpeg is indeed doing the right thing and not inserting/changing filters when I do not intend it to.)


There are a few options available, but none are comprehensive enough. For example :


- 

- The
lavfi
module has adumpgraph
option (here) but only if you're usinglavfi
. - The
-sws_flags print_info
option (here) can be used to determine if-vf scale
is applied automatically and shows a subset of its parameters, but not all of them.






Additionally, this question appears related the answer doesn't answer what I'm looking for.


Are there better ways to achieve that ?


- The
-
Problems to read frame using FFMPEG to OpenCV Mat
28 décembre 2022, par AlexI'm trying to read all frames from a video using FFMPEG library in C++, but I have got this exception :


Assertion desc failed at libswscale/swscale_internal.h:727



The code that I'm using is follow :


#include <iostream>
#include <string>
#include <vector>

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


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

// helper function to check for FFmpeg errors
inline void checkError(int error, const std::string &message) {
 if (error < 0) {
 std::cerr << message << ": " << av_err2str(error) << std::endl;
 exit(EXIT_FAILURE);
 }
}

int main() {
 // initialize FFmpeg
 av_log_set_level(AV_LOG_ERROR);
 avformat_network_init();

 // open the input file
 std::string fileName = "input.mp4";
 AVFormatContext *formatContext = nullptr;
 int error = avformat_open_input(&formatContext, fileName.c_str(), nullptr, nullptr);
 checkError(error, "Error opening input file");

 // find the video stream
 AVStream *videoStream = nullptr;
 for (unsigned int i = 0; i < formatContext->nb_streams; i++) {
 if (formatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && !videoStream) {
 videoStream = formatContext->streams[i];
 }
 }
 if (!videoStream) {
 std::cerr << "Error: input file does not contain a video stream" << std::endl;
 exit(EXIT_FAILURE);
 }

 // create the video codec context
 const AVCodec *videoCodec = avcodec_find_decoder(videoStream->codecpar->codec_id);
 AVCodecContext *videoCodecContext = avcodec_alloc_context3(videoCodec);
 if (!videoCodecContext) {
 std::cerr << "Error allocating video codec context" << std::endl;
 exit(EXIT_FAILURE);
 }
 error = avcodec_parameters_to_context(videoCodecContext, videoStream->codecpar);
 checkError(error, "Error setting video codec context parameters");
 error = avcodec_open2(videoCodecContext, videoCodec, nullptr);
 checkError(error, "Error opening video codec");

 // create the frame scaler
 int width = videoCodecContext->width;
 int height = videoCodecContext->height;
 struct SwsContext *frameScaler = sws_getContext(width, height, videoCodecContext->pix_fmt, width, height, AV_PIX_FMT_BGR24, SWS_BICUBIC, nullptr, nullptr, nullptr);

 // read the packets and decode the video frames
 std::vector videoFrames;
 AVPacket packet;
 while (av_read_frame(formatContext, &packet) == 0) {
 if (packet.stream_index == videoStream->index) {
 // decode the video frame
 AVFrame *frame = av_frame_alloc();
 int gotFrame = 0;
 error = avcodec_send_packet(videoCodecContext, &packet);
 checkError(error, "Error sending packet to video codec");
 error = avcodec_receive_frame(videoCodecContext, frame);
 checkError(error, "Error receiving frame from video codec");
 if (error == 0) {
 gotFrame = 1;
 }
 if (gotFrame) {
 // scale the frame to the desired format
 AVFrame *scaledFrame = av_frame_alloc();
 av_image_alloc(scaledFrame->data, scaledFrame->linesize, width, height, AV_PIX_FMT_BGR24, 32);
 sws_scale(frameScaler, frame->data, frame->linesize, 0, height, scaledFrame->data, scaledFrame->linesize);

 // copy the frame data to a cv::Mat object
 cv::Mat mat(height, width, CV_8UC3, scaledFrame->data[0], scaledFrame->linesize[0]);
 videoFrames.push_back(mat.clone());

 // clean up
 av_freep(&scaledFrame->data[0]);
 av_frame_free(&scaledFrame);
 }
 av_frame_free(&frame);
 }
 av_packet_unref(&packet);
 }

 // clean up
 sws_freeContext(frameScaler);
 avcodec_free_context(&videoCodecContext);
 avformat_close_input(&formatContext);

 return 0;
}
</vector></string></iostream>


The line that GDB says that occur the exception is this :


struct SwsContext *frameScaler = sws_getContext(width, height, videoCodecContext->pix_fmt, width, height, AV_PIX_FMT_BGR24, SWS_BICUBIC, nullptr, nullptr, nullptr);