
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (52)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (6231)
-
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;
}



-
ffmpeg work after close the application JAVA
15 octobre 2014, par Muhamad BurhanudinI’m Burhan.
I try split video to frame with ffmpg but i got a problem. picture did’t show in folder before i closed my aplication. this is my code :public void SplitVideo(String lokasi) {
try {
//excecute cmd
String cmd = "c:\\ff\\bin\\ffmpeg.exe -i " + lokasi + " -y -f image2 c:\\vid\\img-%07d.jpg";
Process jalan = Runtime.getRuntime().exec(cmd);
// Get output stream to write from it
OutputStream keluaran = jalan.getOutputStream();
System.out.println(keluaran);
} catch (IOException e) {
System.out.println(e);
}}I’am using java.
Please can u tell me about my problem. -
Why review compositing work in MJPEG videos rather than (say) H.264 ?
6 juin 2016, par d3vidI have received a request to encode DPX files to MOV/MJPEG rather than MOV/H.264 (which ffmpeg picks by default if you convert to
output.mov
). These is to review compositing renders (in motion), so color accuracy is critical.Comparing a sample "ideal" MOV to the current (H.264) output I can see :
- resolution : the same
- ColorSpace/Primaries : Rec609 (SD) versus Rec709 (HD)
- YUV : 4:2:0 versus 4:4:4
- filesize : smaller
The ffmpeg default seems to be better quality and result in a smaller filesize. Is there something I’m missing ?