Recherche avancée

Médias (1)

Mot : - Tags -/sintel

Autres articles (58)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

Sur d’autres sites (12035)

  • How to silent the MP3 decoding process

    3 août 2019, par Golu

    I am learning ffmpeg and I made a MP3 decoder but when I am executing it , some kind of information is printing on my terminal but I don’t want it. So how to silent it ?

    Here is code (full code)

    /* FFmpeg Usage Example
    * Date : 28 July 2019
    */
    #include
    #include <libavformat></libavformat>avformat.h>
    #include <libavcodec></libavcodec>avcodec.h>
    #include <libavutil></libavutil>avutil.h>
    #include

    int decode_packet(AVCodecContext*, AVPacket*, AVFrame*);

    int main(void) {
           AVFormatContext *pFormatContext = avformat_alloc_context();
           AVCodecParameters *pCodecParameters = NULL;
           if(avformat_open_input(&amp;pFormatContext,"song.mp3",NULL,NULL)!=0) {
                   fprintf(stderr,"Could not open file\n");
                   return -1;
           }
           if(avformat_find_stream_info(pFormatContext,NULL)&lt;0) {
                   fprintf(stderr,"Could not find stream\n");
                   return -1;
           }

           size_t stream_index = 0;
           for(;stream_indexnb_streams;stream_index++) {
                   if(pFormatContext->streams[stream_index]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
                           pCodecParameters = pFormatContext->streams[stream_index]->codecpar;
                   }
                           break;
           }

           if(stream_index == -1) {
                   fprintf(stderr,"could not retrive stream info from file\n");
                   return -1;
           }
           AVStream *stream = pFormatContext->streams[stream_index];
           pCodecParameters = stream->codecpar;
           AVCodec *cdc = avcodec_find_decoder(pCodecParameters->codec_id);
           AVCodecContext *cdc_ctx = avcodec_alloc_context3(cdc);
           assert(pCodecParameters);

           if(avcodec_parameters_to_context(cdc_ctx,pCodecParameters) &lt; 0) {
                   fprintf(stderr,"Can't copy params to codec context\n");
                   return -1;
           }

           if(avcodec_open2(cdc_ctx,cdc,NULL) &lt; 0) {
                   fprintf(stderr,"Failed to open decoder for stream\n");
                   return -1;
           }

           AVFrame *frame = av_frame_alloc();
           if(!frame) {
                   fprintf(stderr,"could not allocate memory for frame\n");
                   return -1;
           }

           AVPacket *packet = av_packet_alloc();
    //      av_init_packet(&amp;packet);
           if(!packet) {
                   fprintf(stderr,"could not allocate memory for packet");
                   return -1;
           }

           packet->data=NULL;
           packet->size=0;
           // lets read the packets
           while(av_read_frame(pFormatContext,packet) >= 0) {
                   if(packet->stream_index==stream_index) {
                           int response = 0 ;
               response = decode_packet(cdc_ctx,packet,frame);

                           if(response &lt; 0)
                                   continue;
                   }
           av_packet_unref(packet);
           }

           return 0;
    }

    int decode_packet(AVCodecContext *cdc_ctx , AVPacket *pkt, AVFrame *frm) {
       int response = avcodec_send_packet(cdc_ctx,pkt);
       if(response &lt; 0)
           return response;
       while(response >= 0) {
           response = avcodec_receive_frame(cdc_ctx,frm);
           if(response == AVERROR(EAGAIN) || response == AVERROR_EOF)
               return -1;
           else if(response &lt; 0)
               return response;
       }
       return 0;
    }

    Expected behaviour : nothing should be printed on screen

    Actual behaviour : some kind of logs are printing automatically

    Here is output logs ( some of them )

    [mp3float @ 0x75172e7400] overread, skip -6 enddists: -5 -5        
    [mp3float @ 0x75172e7400] overread, skip -7 enddists: -6 -6
    [mp3float @ 0x75172e7400] overread, skip -6 enddists: -5 -5
    [mp3float @ 0x75172e7400] overread, skip -6 enddists: -4 -4
  • passing script variable of filename with spaces in bash to external program (ffmpeg) fails

    13 janvier 2016, par BostonScott

    Short story : I’m trying to write a script that will use FFmpeg to convert the many files stored in one directory to a "standard" mp4 format and save the converted files in another directory. It’s been a learning experience (a fun one !) since I haven’t done any real coding since using Pascal and FORTRAN on an IBM 370 mainframe was in vogue.

    Essentially the script takes the filename, strips the path and extension off it, reassembles the filename with the path and an mp4 extension and calls FFmpeg with some set parameters to do the conversion. If the directory contains only video files with without spaces in the names, then everything works fine. If the filenames contain spaces, then FFmpeg is not able to process the file and moves on to the next one. The error indicates that FFMpeg is only seeing the filename up to the first space. I’ve included both the script and output below.

    Thanks for any help and suggestions you may have. If you think I should be doing this in another way, please by all means, give me your suggestions. As I said, it’s been a long time since I did anything like this. I’m enjoying it though.

    I’ve include the code first followed by example output.

    for file in ./TBC/*.mp4
       do

       echo "Start of iteration"
       echo "Full text of file name:" $file

       #Remove everything up to  "C/" (filename without path)
       fn_orig=${file#*C/}
       echo "Original file name:" $fn_orig

       #Length of file name
       fn_len=${#fn_orig}
       echo "Filename Length:" $fn_len

       #file name without path or extension
       fn_base=${fn_orig:0:$fn_len-4}
       echo "Base file name:" $fn_base

       #new filename suffix
       newsuffix=".conv.mp4"

       fn_out=./CONV/$fn_base$newsuffix
       echo "Converted file name:" $fn_out

       ffmpeg -i $file -metadata title="$fn_orig" -c:v libx264 -c:a libfdk_aac -b:a 128k $fn_out

       echo "End of iteration"
       echo
       done
    echo "Script completed"

    With the ffmpeg line commented out, and two files in the ./TBC directory, this is the output that I get

       Start of iteration
       Full text of file name: ./TBC/Test file with spaces.mp4
       Original filename: Test file with spaces.mp4
       Filename Length: 25
       Base filename: Test file with spaces
       Converted file name: ./CONV/Test file with spaces.conv.mp4
       End of iteration

       Start of iteration
       Full text of file name: ./TBC/Test_file_with_NO_spaces.mp4
       Original file name: Test_file_with_NO_spaces.mp4
       Filename Length: 28
       Base file name: Test_file_with_NO_spaces
       Converted file name: ./CONV/Test_file_with_NO_spaces.conv.mp4
       End of iteration

       Script completed

    I won’t bother to post the results when ffmpeg is uncommented, other than to state that it fails with the error :
    ./TBC/Test : No such file or directory

    The script then continues to the next file which completes successfully because it has no spaces in its name. The actual filename is "Test file with spaces.mp4" so you can see that ffmpeg stops after the word "Test" when it encounters a space.

    I hope this has been clear and concise and hopefully someone will be able to point me in the right direction. There is a lot more that I want to do with this script such as parsing subdirectories and ignoring non-video files, etc.

    I look forward to any insight you can give !

  • Saving frames as images using FFmpeg

    25 octobre 2014, par Mr Almighty

    There are some tutorials on the internet about it, most of them is using deprecated functions and unfortunately the API use to broke and it makes a mess and I’m really confused.

    I’m following tutorials, learning with the documentation and seeing the examples of the current version (even that way some examples does not work).

    What I’m trying to do is to save frames in .png, following the examples and reading I did this, but I’m confused about the conversion the frame to RBG and saving it :

    #include <iostream>

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

    int main(int argc, char ** argv)
    {
       if (argc &lt; 2)
       {
           av_log(0, AV_LOG_FATAL, "Usage: %s <input />", argv[0]);
           return -1;
       }

       const char * filename = argv[1];

       // register all codecs and formats
       av_register_all();

       // open input file, and allocate format context
       AVFormatContext *avFormatContext = avformat_alloc_context();

       if (avformat_open_input(&amp;avFormatContext, filename, 0, 0) &lt; 0)
       {
           av_log(0, AV_LOG_FATAL, "Could not open source file %s", filename);
           return -1;
       }

       // retrieve stream information
       if (avformat_find_stream_info(avFormatContext, 0) &lt; 0)
       {
           av_log(0, AV_LOG_FATAL, "Could not find stream information");
           return -1;
       }

       // dump information about file onto standard error
       av_dump_format(avFormatContext, 0, filename, 0);

       // find the "best" video stream in the file.
       int result = av_find_best_stream(avFormatContext, AVMEDIA_TYPE_VIDEO, -1, -1, 0, 0);

       if (result &lt; 0)
       {
           av_log(0, AV_LOG_FATAL, "Could not find %s stream in input file '%s'", av_get_media_type_string(AVMEDIA_TYPE_VIDEO), filename);
           return -1;
       }

       int stream = result;
       AVStream *avStream = avFormatContext->streams[stream];
       AVCodecContext *avCodecContext = avStream->codec;

       // find decoder for the stream
       AVCodec *avCodec = avcodec_find_decoder(avCodecContext->codec_id);

       if (! avCodec)
       {
           av_log(0, AV_LOG_FATAL, "Failed to find %s codec", av_get_media_type_string(AVMEDIA_TYPE_VIDEO));
           return -1;
       }

       // init the decoders, with reference counting
       AVDictionary *avDictionary = 0;
       av_dict_set(&amp;avDictionary, "refcounted_frames", "1", 0);

       if (result = avcodec_open2(avCodecContext, avCodec, &amp;avDictionary) &lt; 0)
       {
           av_log(0, AV_LOG_FATAL, "Failed to open %s codec", av_get_media_type_string(AVMEDIA_TYPE_VIDEO));
           return -1;
       }

       AVFrame *avFrame = av_frame_alloc();

       if (! avFrame)
       {
           av_log(0, AV_LOG_FATAL, "Could not allocate frame");
           return -1;
       }

       // initialize packet, set data to null, let the demuxer fill it
       AVPacket avPacket;
       av_init_packet(&amp;avPacket);
       avPacket.data = 0;
       avPacket.size = 0;

       while (av_read_frame(avFormatContext, &amp;avPacket) >= 0)
       {
           if (avPacket.stream_index == stream)
           {
               int success = avcodec_decode_video2(avCodecContext, avFrame, &amp;success, &amp;avPacket);

               if (success &lt;= 0)
               {
                   av_log(0, AV_LOG_FATAL, "Error decoding video frame");
                   return -1;
               }

               // ... saving...
           }
       }

       avcodec_close(avCodecContext);
       avformat_close_input(&amp;avFormatContext);
       av_frame_free(&amp;avFrame);

       return 0;
    }
    </iostream>