Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (52)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications 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, par

    Certains 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, par

    Pré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 Tilmidh

    Using the libraries (libav) and (ffmpeg), I try to extract frames as .jpg files from a video.mp4, the problem is that my program crashes when I use the CV_8UC3 parameter, but by changing this parameter to CV_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>&#xA;&#xA;extern "C"&#xA;{&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;}&#xA;&#xA;int main()&#xA;{&#xA;    AVFormatContext *formatContext = nullptr;&#xA;&#xA;    if (avformat_open_input(&amp;formatContext, "video.mp4", nullptr, nullptr) != 0)&#xA;    {&#xA;        return -1;&#xA;    }&#xA;&#xA;    if (avformat_find_stream_info(formatContext, nullptr) &lt; 0)&#xA;    {&#xA;        return -1;&#xA;    }&#xA;&#xA;    AVPacket packet;&#xA;    const AVCodec *codec = nullptr;&#xA;    AVCodecContext *codecContext = nullptr;&#xA;&#xA;    int videoStreamIndex = av_find_best_stream(formatContext, AVMEDIA_TYPE_VIDEO, -1, -1, &amp;codec, 0);&#xA;    if (videoStreamIndex &lt; 0)&#xA;    {&#xA;        return -1;&#xA;    }&#xA;&#xA;    codecContext = avcodec_alloc_context3(codec);&#xA;    avcodec_parameters_to_context(codecContext, formatContext->streams[videoStreamIndex]->codecpar);&#xA;&#xA;    if (avcodec_open2(codecContext, codec, nullptr) &lt; 0)&#xA;    {&#xA;        return -1;&#xA;    }&#xA;&#xA;    AVFrame *frame = av_frame_alloc();&#xA;&#xA;    while (av_read_frame(formatContext, &amp;packet) >= 0)&#xA;    {&#xA;        if (packet.stream_index == videoStreamIndex)&#xA;        {&#xA;            int response = avcodec_send_packet(codecContext, &amp;packet);&#xA;            &#xA;            if (response &lt; 0)&#xA;            {&#xA;                break;&#xA;            }&#xA;&#xA;            while (response >= 0)&#xA;            {&#xA;                response = avcodec_receive_frame(codecContext, frame);&#xA;                if (response == AVERROR(EAGAIN))&#xA;                {&#xA;                    // NO FRAMES&#xA;                    break;&#xA;                }&#xA;&#xA;                else if (response == AVERROR_EOF)&#xA;                {&#xA;                    // END OF FILE&#xA;                    break;&#xA;                }&#xA;&#xA;                else if (response &lt; 0)&#xA;                {&#xA;                    break;&#xA;                }&#xA;&#xA;                //cv::Mat frameMat(frame->height, frame->width, CV_8UC3, frame->data[0]); // CV_8UC3 → THE PROGRAM CRASHES&#xA;                cv::Mat frameMat(frame->height, frame->width, CV_8UC1, frame->data[0]); // CV_8UC1 → WORK BUT IMAGES ARE IN GRAYSCALE&#xA;                cv::imwrite("frame_" &#x2B; std::to_string(frame->pts) &#x2B; ".jpg", frameMat);&#xA;            }&#xA;        }&#xA;&#xA;        av_packet_unref(&amp;packet);&#xA;    }&#xA;&#xA;    av_frame_free(&amp;frame);&#xA;    avcodec_free_context(&amp;codecContext);&#xA;    avformat_close_input(&amp;formatContext);&#xA;&#xA;    return 0;&#xA;}&#xA;

    &#xA;

  • ffmpeg work after close the application JAVA

    15 octobre 2014, par Muhamad Burhanudin

    I’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 d3vid

    I 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 ?