Recherche avancée

Médias (1)

Mot : - Tags -/remix

Autres articles (94)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    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 (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (5445)

  • Decoding with FFMPEG on Visual Studio 2010

    6 juin 2013, par user2439801

    I just started using FFMPEG with C++ and try to code an audio decoder then write the decoded audio into a file.

    However i'm not sure about which data to write to the output file. As far as i know from looking at the sample codes it seems to be the AVFrame -> data[0].
    But when i try to print it on the consoles, i get some random numbers that are different each time i run the program. And when i try to write this AVFrame->data[0] into a file i keep getting an error.

    So my question is how can i write the decoded audio after i call the function av_codec_decode_audio4 ?

    Below i attached my code and i pass the argument "C :\02.mp3" which is a path for a valid mp3 file on my PC.

    Thank you for your help.

    // TestFFMPEG.cpp : Audio Decoder
    //

    #include "stdafx.h"

    #include <iostream>
    #include <fstream>
    #include <sstream>

    extern "C" {
       #include
       #include
       #include

    }

    using namespace std;


    int main(int argc, char* argv[])
    {
    int audioStream = -1;

    AVCodec         *aCodec;
    AVPacket        avPkt;
    AVFrame         *decode_frame = avcodec_alloc_frame();

    AVCodecContext  *aCodecCtxt;
    AVFormatContext *pFormatCtxt = NULL;

    if(argc != 2) {     // Checking  whether there is enough argument
       return -1;
    }

    av_register_all();  //Initialize CODEC
    avformat_network_init();
    av_init_packet (&amp;avPkt);


    if (avformat_open_input (&amp;pFormatCtxt, argv[1],NULL,NULL)!= 0 ){ //Opening File
        return -2;
    }

    if(avformat_find_stream_info (pFormatCtxt,NULL) &lt; 0){ //Get Streams Info
        return -3;
    }

    AVStream *stream = NULL;
    //av_read_play (pFormatCtxt); //open streams


    for (int i = 0;  i &lt; pFormatCtxt->nb_streams ; i++) { //Find Audio Stream
        if (pFormatCtxt->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO){
            audioStream =i;
        }
    }

    aCodecCtxt = pFormatCtxt ->streams [audioStream]->codec; // opening decoder  
    aCodec = avcodec_find_decoder( pFormatCtxt->streams [audioStream] ->codec->codec_id);

    if (!aCodec) {
        return -8;
    }

    if (avcodec_open2(aCodecCtxt,aCodec,NULL)!=0) {
        return -9;
    }

    int cnt = 0;

    while(av_read_frame(pFormatCtxt,&amp;avPkt) >= 0 ){

       if (avPkt.stream_index == audioStream){
           int check = 0;
           int result = avcodec_decode_audio4 (aCodecCtxt,decode_frame,&amp;check, &amp;avPkt);
           cout &lt;&lt; "Decoded : "&lt;&lt; (int) decode_frame->data[0] &lt;&lt;", "&lt;&lt; "Check : " &lt;&lt; check &lt;&lt; ", Format :" &lt;&lt; decode_frame->format &lt;&lt;" " &lt;&lt; decode_frame->linesize[0]&lt;&lt; " "&lt;<cnt return="return" acodec="acodec">id;  
    }
    </cnt></sstream></fstream></iostream>
  • ffmpeg Decoding Progress during Frame Extarction

    4 avril 2013, par Isantipov

    I scan input video to extract certain frames using ffmpeg's select filter. The selection is based on a complex creteria and the number of extracted frames can't be predicted (I'm doing scene detection, but this can be something different - e.g. selecting all the I frames, etc).

    What I need is to display the percentage of scanned (decoded) video (e.g. 10% or 90%).


    I tried several ways to do this parsing console output as people usually do when dealing with encoding, but it doesn't help with the progress of scanning (e.g. Can ffmpeg show a progress bar ? or ffmpeg Progress Bar - Encoding Percentage in PHP)

    ffmpeg -progress sceneProgr.txt -i input.wmv -vsync passthrough -an -vf select=&#39;gt(scene\,0.2)&#39;,showinfo scene%%05d.png

    The output this produces is as follows :

    &lt;..>    
    frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A    
    n:0 pts:16550 pts_time:16.55 pos:4205325 fmt:rgb24 sar:0/1 s:640x480 i:P iskey:1 type:I checksum:95895BC9 plane_checksum:[95895BC9]
    frame=    1 fps=0.7 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A    
    n:1 pts:24591 pts_time:24.591 pos:6685325 fmt:rgb24 sar:0/1 s:640x480 i:P iskey:0 type:P checksum:FF4CC015 plane_checksum:[FF4CC015]
    &#39;frame=...&#39; and &#39;n:...&#39; lines are repeated for each of the extracted frames.

    Both frame=... and n:... lines refer to the numbers in the output and therefore can't be used to calculate progress the way people usually do this (as I can't predict how many frames will be found beforehead and besides, they are not uniformly spread across the input video).


    If I specify -progress progress.txt parameter, the progress.txt file is as follows :

    frame=5
    fps=1.2
    stream_0_0_q=0.0
    total_size=N/A
    out_time_ms=43209833
    out_time=00:00:43.209833
    dup_frames=0
    drop_frames=0
    progress=continue


    frame=6
    fps=1.3
    stream_0_0_q=0.0
    total_size=N/A
    out_time_ms=52252200
    out_time=00:00:52.252200
    dup_frames=0
    drop_frames=0
    progress=continue

    frame=6
    fps=1.2
    stream_0_0_q=0.0
    total_size=N/A
    out_time_ms=52252200
    out_time=00:00:52.252200
    dup_frames=0
    drop_frames=0
    progress=continue

    New portion is written approximately every second and refers to the last extracted frame.
    Which is somewhat helpful as out_time refers to the last extracted frames' position in the input video, so I can calculate the progress of the scan from it as

    progress = out_time_ms/total_input_time

    But this is not ideal as it will be updated only when the new frame which matches the select criteria is extracted. So, If I have a large portion of video with no matching frames, the progress won't change for a lot of time.


    Wrapping-up :

    I am looking for a way to calculate the progress of video scanning when using select filter.

    Any ideas are strongly appreciated.

  • Error in ffmpeg when reading from UDP stream

    24 juillet 2013, par six6and1one

    I'm trying to process frames from a UDP stream using ffmpeg. Everything will run fine for a while but av_read_frame() will always eventually return either AVERROR_EXIT (Immeditate exit requested) or -5 (Error number -5 occurred) while the stream should still be running fine. Right before the error it always prints the following message to the console

    [mpeg2video @ 0caf6600] ac-tex damaged at 14 10
    [mpeg2video @ 0caf6600] Warning MVs not available
    [mpeg2video @ 0caf6600] concealing 800 DC, 800 AC, 800 MV errors in I frame

    (the numbers in the message vary from run to run)

    I have a suspicion that the error is related to calling av_read_frame too quickly. If I have it run as fast as possible, I usually get an error within 10-20 frames, but if I put a sleep before reading it will run fine for a minute or so and then exit with an error. I realize this is hacky and assume there is a better solution. Bottom line : is there a way to dynamically check if 'av_read_frame()' is ready to be called ? or a way to supress the error ?

    Psuedo code of what I'm doing below. Thanks in advance for the help !

    void getFrame()
    {
       //wait here?? seems hacky...
       //boost::this_thread::sleep(boost::posix_time::milliseconds(25));  

       int av_read_frame_error = av_read_frame(m_input_format_context, &amp;m_input_packet);          
       if(av_read_frame_error == 0){      
           //DO STUFF - this all works fine when it gets here
       }
       else{              
           //error
           char errorBuf[AV_ERROR_MAX_STRING_SIZE];
           av_make_error_string(errorBuf, AV_ERROR_MAX_STRING_SIZE, av_read_frame_error);
           cout &lt;&lt; "FFMPEG Input Stream Exit Code: " &lt;&lt; av_read_frame_error &lt;&lt; "   Message: " &lt;&lt; errorBuf &lt;&lt; endl;            
       }
    }