Recherche avancée

Médias (0)

Mot : - Tags -/signalement

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (20)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP 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 (...)

Sur d’autres sites (3252)

  • Use fluent-ffmpeg to tell if a file is a video or audio

    8 mai 2021, par afterglowlee

    I am using node-fluent-ffmpeg module in NodeJS. It is very good that fluent-ffmpeg provides functions to get the metadata of a video and audio file.

    



    https://github.com/schaermu/node-fluent-ffmpeg#reading-video-metadata

    



    I have tried on Mac OS to use the "resolution" attribute in the metadata to tell if a file is audio only or video, i.e. if both resolution.w and resolution.h are 0, then this file is an audio. This work fine on Mac OS. But some strange things happened that this doesn't work on Windows platform (I have tried Windows 7 64bit and Windows 2008) using the latest ffmpeg. Even though I put a .mp3 file through fluent-ffmpeg,the result looks something like this :

    



    video:
{
  container:'mp3',
  ...
  resolution: {w:300,h:300},
  resolutionSquare: {w:300,h:300},
  aspectString: '1:1',
  ...
}
audio:
{
  codec:'mp3',
  bitrate:64,
  sample_rate:44100,
  stream:0,
  channels:1
}


    



    I am not why there is a "resolution" since it is a pure audio file. So is there any solid way to find out if the file is audio only or video from the metadata ? Or should I use ffmpeg commandline to find it out ?

    


  • How to download a part of mp3 from server ?

    20 août 2020, par Sharukh Mohammed

    Use Case

    


    My use case is roughly equal to, adding a 15-second mp3 file to a 1 min video. All transcoding merging part will be done by FFmpeg-android so that's not the concern right now.

    


    The flow is as follows

    


      

    • User can select any 15 seconds (ExoPlayer-streaming) of an mp3 (considering 192Kbps/44.1KHz of 3mins = up to 7MB)
    • 


    • Then download ONLY the 15 second part and add it to the video's audio stream. (using FFmpeg)
    • 


    • Use the obtained output
    • 


    


    Tried solutions

    


      

    • Extracting fragment of audio from a url

      


      RANGE_REQUEST - I have replicated the exact same algorithm/formula in Kotlin using the exact sample file provided. But the output is not accurate (± 1.5 secs * c) where c is proportional to startTime

      


    • 


    • How to crop a mp3 from x to x+n using ffmpeg ?

      


      FFMPEG_SS - This works flawlessly with remote URLs as input, but there are two downsides,

      


        

      1. as startTime increases, the size of downloaded bytes are closer to the actual size of the mp3.
      2. 


      3. ffmpeg-android does not support network requests module (at least the way we complied)
      4. 


      


    • 


    


    So above two solutions have not been fruitful and currently, I am downloading the whole file and trimming it locally, which is definitely a bad UX.
I wonder how Instagram's music addition to story feature works because that's close to what I wanted to implement.

    


  • FFMpeg, libav, Problem with sws_scale and yuv to rgb conversion - colors are not correct

    7 juillet 2022, par Milika

    I've been trying to create my own video player in Delphi, and ffmpeg works great, until i hit a snag with color spaces, or color conversion.

    


    Been trying everything for a couple of days, but can't figure it out.
I'm using AV_PIX_FMT_RGB48LE as output...

    


    Old context creation :

    


          videoConvContext := sws_getContext(AVStreamInit.codec.width, AVStreamInit.codec.height, AVStreamInit.codec.pix_fmt, AVStreamInit.codec.width, AVStreamInit.codec.height, AV_PIX_FMT_RGB48LE, SWS_POINT, nil, nil, nil);


    


    New context creation :

    


        dstRange := 1;
    srcRange := 1;
    if AVStreamInit.codec.color_range = AVCOL_RANGE_MPEG then
      srcRange := 0;

    videoConvContext := sws_alloc_context();

    av_opt_set_int(videoConvContext, 'sws_flags', SWS_POINT or SWS_PRINT_INFO, 0);

    av_opt_set_int(videoConvContext, 'srcw', AVStreamInit.codec.width, 0);
    av_opt_set_int(videoConvContext, 'srch', AVStreamInit.codec.height, 0);
    av_opt_set_int(videoConvContext, 'src_format', Integer(AVStreamInit.codec.pix_fmt), 0);

    av_opt_set_int(videoConvContext, 'dstw', AVStreamInit.codec.width, 0);
    av_opt_set_int(videoConvContext, 'dsth', AVStreamInit.codec.height, 0);
    av_opt_set_int(videoConvContext, 'dst_format', Integer(AV_PIX_FMT_RGB48LE), 0);

    i1 := sws_getCoefficients2(Integer(AVStreamInit.codec.colorspace));
    i2 := sws_getCoefficients2(SWS_CS_ITU709);

    ret := sws_setColorspaceDetails2(videoConvContext, i1, srcRange, i2, dstRange, 0, 1 shl 16, 1 shl 16);

    sws_init_context(videoConvContext, nil, nil);


    


    Results are exactly the same....

    


    Output from sws_scale does not have correct colors, here are 2 screenshot

    


    ok - from mpc-hc
ok

    


    not ok - from my player via sws_scale (direct raw extract so no color processing done)
not ok

    


    This video has pix_fmt AV_PIX_FMT_YUV420P10LE, but it happens on other YUV inputs, but not so obvious. Also on other RGB outputs(8bit etc)...
Here the Netflix logo is pure red, but sws_scale output gives orange-ish...

    


    Sws_scale code just for reference :

    


    sws_scale(videoConvContext, @AVPacketBuffer.AVFrameCopy.Data, @AVPacketBuffer.AVFrameCopy.linesize, 0, AVStream.codec.height, @BitmapXBuffer.data, @linesize);


    


    BitmapXBuffer.data is a signle buffer of correct size...

    


    AVFrameCopy - is a copy of original frame done with :

    


      if Assigned(AVPacketBuffer.AVFrameCopy) then
      av_frame_free(@AVPacketBuffer.AVFrameCopy);

    AVPacketBuffer.AVFrameCopy := av_frame_alloc();
    AVPacketBuffer.AVFrameCopy.format := AVPacketBuffer.AVFrame.format;
    AVPacketBuffer.AVFrameCopy.width := AVPacketBuffer.AVFrame.width;
    AVPacketBuffer.AVFrameCopy.height := AVPacketBuffer.AVFrame.height;
    AVPacketBuffer.AVFrameCopy.channels := AVPacketBuffer.AVFrame.channels;
    AVPacketBuffer.AVFrameCopy.channel_layout := AVPacketBuffer.AVFrame.channel_layout;
    AVPacketBuffer.AVFrameCopy.nb_samples := AVPacketBuffer.AVFrame.nb_samples;
    av_frame_get_buffer(AVPacketBuffer.AVFrameCopy, 32);
    av_frame_copy(AVPacketBuffer.AVFrameCopy, AVPacketBuffer.AVFrame);
    av_frame_copy_props(AVPacketBuffer.AVFrameCopy, AVPacketBuffer.AVFrame);


    


    Thanks !