Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (104)

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

  • Monitoring de fermes de MediaSPIP (et de SPIP tant qu’à faire)

    31 mai 2013, par

    Lorsque l’on gère plusieurs (voir plusieurs dizaines) de MediaSPIP sur la même installation, il peut être très pratique d’obtenir d’un coup d’oeil certaines informations.
    Cet article a pour but de documenter les scripts de monitoring Munin développés avec l’aide d’Infini.
    Ces scripts sont installés automatiquement par le script d’installation automatique si une installation de munin est détectée.
    Description des scripts
    Trois scripts Munin ont été développés :
    1. mediaspip_medias
    Un script de (...)

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

Sur d’autres sites (10528)

  • Right way to use vmaf with ffmpeg

    14 juin, par dravit

    I am trying to calculate the VMAF score of a processed video wrt the original file.

    


    Command I have used :

    


    ffmpeg -y -loglevel info -stats -i original.mp4 -i processed.mp4 -lavfi "[0]null[refdeint];[refdeint]scale=1920:1080:flags=neighbor[ref];[1]setpts=PTS+0.0/TB[b];[b]scale=1920:1080:flags=neighbor[c];[c][ref]libvmaf=log_fmt=json:phone_model=1:model_path={model_path_here}/vmaf_v0.6.1.json:n_subsample=1:log_path=log.json" -f null -


    


    Now as per the official documentation of vmaf with ffmpeg found here, it says source/reference file followed by the encoded/distorted/processed file.

    


    But almost all of the blogs I came across, they are using the other way round order of the args, i.e. processed file followed by the original file.

    


    Few examples :

    


      

    1. https://medium.com/@eyevinntechnology/keep-an-eye-on-the-video-quality-b9bcb58dd5a1 : search for "Using VMAF within FFMPEG" in it.

      


    2. 


    3. https://websites.fraunhofer.de/video-dev/calculating-vmaf-and-psnr-with-ffmpeg/ : search for "Metric Calculation with FFmpeg" in it.

      


    4. 


    


    EDIT

    


    NOTE : Changing the order does change the VMAF score.

    


  • FFmpeg decode OGG Vorbis audio as float, how to get float data from decoder

    19 novembre 2020, par cs guy

    I am trying to decode a OGG Vorbis audio file with the following :

    


    // if opening input failed
    if (avformat_open_input(&pFormatContext, filePath.c_str(), av_find_input_format("ogg"),
                            nullptr) != 0) {
        
        LOGE("FFmpegExtractor can not open the file! %s", filePath.c_str());
        return FAILED_TO_LOAD;
    }

    durationInMillis = pFormatContext->duration / AV_TIME_BASE * secondsToMilli;
    LOGD("FFmpegExtractor opened the file, Duration: %llu", durationInMillis);

    avformat_find_stream_info(pFormatContext, nullptr);

    LOGD("pFormatContext streams num: %ui", pFormatContext->nb_streams);

    int sendPacketResult = 0;
    int receiveFrameResult = 0;

    for (int i = 0; i < pFormatContext->nb_streams; i++) {
        AVCodecParameters *pLocalCodecParameters = pFormatContext->streams[i]->codecpar;

        if (pLocalCodecParameters->codec_type == AVMEDIA_TYPE_AUDIO) {
            avCodecContext = avcodec_alloc_context3(avCodec);
            if (!avCodecContext) {
                
                LOGE("FFmpegExtractor avcodec_alloc_context3 failed!");
                return FAILED_TO_LOAD;
            }

            if (avcodec_parameters_to_context(avCodecContext, pLocalCodecParameters) < 0) {
                
                LOGE("FFmpegExtractor avcodec_parameters_to_context failed!");
                return FAILED_TO_LOAD;
            }

            if (avcodec_open2(avCodecContext, avCodec, nullptr) < 0) {
                
                LOGE("FFmpegExtractor avcodec_open2 failed!");
                return FAILED_TO_LOAD;
            }
        }

        while (av_read_frame(pFormatContext, avPacket) >= 0) {
            
            sendPacketResult = avcodec_send_packet(avCodecContext, avPacket);

            
            receiveFrameResult = avcodec_receive_frame(avCodecContext, avFrame);

            // TODO: Get frames PCM data from the decoder, 
        }
    }


    


    I am stuck on the last part. I want to get the decoded data of the current frame as a float between -1 to +1 for all the channels the audio has but I have no idea how to. I looked at the official documents but I could not understand them. How can I get the data from the decoder on the line

    


    


    // TODO : Get frames PCM data from the decoder,

    


    


  • Concatenate multiple video php ffmpeg

    3 mai 2017, par Angus Simons

    I have multiple files that are already been encoded (they have the same format and size) I would like to concatenate on a single video (that already exist and has to be overwritten).

    Following the official FAQ Documentation I should use demuxer

    FFmpeg has a concat demuxer which you can use when you want to avoid a
    re-encode and your format doesn’t support file level concatenation.

    The problem is that I should use a .txt file with a list of files using this command line

    ffmpeg -f concat -safe 0 -i mylist.txt -c copy output

    where mylist.txt should be :

    file '/path/to/file1'
    file '/path/to/file2'
    file '/path/to/file3'

    How can I do with PHP ?


    Also tried with concat protocol

    I tried using also the concat protocol that re-encode videos with these lines of code :

    $cli = FFMPEG.' -y -i \'concat:';

    foreach ($data as $key => $media) {
     $tmpFilename = $media['id'];
     $tmpPath = $storePath.'/tmp/'.$tmpFilename.'.mp4';

     if ($key != ($dataLenght - 1)) {
       $cli .= $tmpPath.'|';
     } else {
       $cli .= $tmpPath.'\'';
     }
    }

    $cli .= ' -c copy '.$export;
    exec($cli);

    that generate this command line :

    /usr/local/bin/ffmpeg -i 'concat:/USER/storage/app/public/video/sessions/590916f0d122b/tmp/1493768472144.mp4|/USER/storage/app/public/video/sessions/590916f0d122b/tmp/1493767926114.mp4|/USER/storage/app/public/video/sessions/590916f0d122b/tmp/1493771107551.mp4|/USER/storage/app/public/video/sessions/590916f0d122b/tmp/1493771114598.mp4' -c:v libx264  /USER/storage/app/public/video/sessions/590916f0d122b/tmp_video_session.mp4

    but I got this error :

    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc8aa800000] Found duplicated MOOV Atom. Skipped it