Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (97)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (6966)

  • Adding slides of a pdf presentation to the audio file of the same presentation with ffmpeg

    27 mars 2024, par revher

    I want to add slides of a pdf presentation to the audio file of the same presentation with ffmpeg (or whatever).

    


    I split the pdf presentations using pdftoppm into numbered png images and tried to use ffmpeg to sync the audio file with the images. But I am wondering if the output file could be smaller.
Example, the following command will split file 'foo.pdf' into file 'output-01.png', 'output-02.png' etc :

    


    $ pdftoppm foo.pdf -png output


    


    Then I listen to the audio file 'foo-audio.mp3' and noted the end of each slide in minutes and second. Using a spreadsheet you have to calculate the exact (in seconds) timing of each slide, which can be expressed as 40 for 40 seconds for the program of the conference or 00:01:37 for 1 minute and 37 seconds for your first slide etc and paste it into a text file 'foo-images.txt' which will look like :

    


    file ./program.png
duration 40 
file ./output-01.png
duration 00:01:37


    


    Then the video can be built with the command :

    


    $ ffmpeg -safe 0 -f concat -i foo-images.txt -fps_mode vfr -pix_fmt yuv420p  output.mp4
 height not divisible by 2 (1500x1125)type here


    


    but I got the above error that the height was not divisible by 2.
Then I found (on a the ffmpeg mailing list) that I could use the '-vf scale=1680 :-2' option and the following command was successful :

    


    $ ffmpeg -safe 0 -f concat -i foo-images.txt -vf scale=1680:-2  -pix_fmt yuv420p  output.mp4



    


    and in order to sync the audio with the images and get the final video 'foo-video.mp4' :

    


    $ ffmpeg -safe 0 -f concat -i foo-images.txt -i foo-audio.mp3 -vf scale=1680:-2  -pix_fmt yuv420p  foo-video.mp4      



    


    It worked, but the video is about 60Mb for 30 slides and 30 minutes presentation. Is is a correct ratio ? Although the video can be viewed by an Apple viewer. But is there a benefit to use ffmpeg and command lines compared to the use of softwares like imovie or acrobat to get the same result ?
Also I am confused with the scale 1680 (which is fine) and the 420p of pix_fmt.

    


  • How to optimize recording feature with mediasoup ?

    4 décembre 2024, par hu7sy

    I am using Mediasoup for video conference call and now i have add ffmpeg for recording feature.

    


    Ffmpeg code below

    


    get _commandArgs() {
    let commandArgs = [
        '-loglevel', 'debug',
        '-report',
        '-protocol_whitelist', 'file,pipe,udp,rtp',
        '-fflags', '+genpts',
        '-flags', 'low_delay',
        '-f', 'sdp',
        '-i', 'pipe:0',
        '-rtbufsize', '256M',
        '-muxdelay', '2.0',
        '-max_delay', '12000000',
        '-reorder_queue_size', '200',
        '-flush_packets', '1',
        '-vsync', '2',
        '-threads', '12'
    ];

    // Add video and audio arguments
    commandArgs = commandArgs.concat(this._videoArgs);
    commandArgs = commandArgs.concat(this._audioArgs);

    // Add output file path
    commandArgs.push(`${this._path}/${this._fileName}`);

    return commandArgs;
}

get _videoArgs() {
    return [
        '-map', '0:v:0',
        '-c:v', 'libx264',
        '-preset', 'veryfast',
        '-crf', '23',
        '-pix_fmt', 'yuv420p',
        '-r', '30',
        '-b:v', '1M',
        '-filter:v', 'fps=fps=30',
    ];
}

get _audioArgs() {
    return [
        '-map', '0:a:0',
        '-c:a', 'aac',
        '-b:a', '128k',
        '-ar', '48000',
        '-ac', '2',
    ];
}


    


    with current code recording works fine, lets suppose 10 users in call but with some user recording get stuck after some time .

    


    I have seen call record report for every users the users who's video get stuck got below an error.

    


    


    dropping old packet received too late

    


    Delay between the first packet and last packet in the muxing queue is
10016000 > 10000000 : forcing output

    


    


    One more question just for sake of information does this way to record video is scale-able ?

    


  • Why does every encoded frame's size increase after I had use to set one frame to be key in intel qsv of ffmpeg

    22 avril 2021, par TONY

    I used intel's qsv to encode h264 video in ffmpeg. My av codec context settings is like as below :

    


     m_ctx->width = m_width;
    m_ctx->height = m_height;
    m_ctx->time_base = { 1, (int)fps };
    m_ctx->qmin = 10;
    m_ctx->qmax = 35;
    m_ctx->gop_size = 3000;
    m_ctx->max_b_frames = 0;
    m_ctx->has_b_frames = false;
    m_ctx->refs = 2;
    m_ctx->slices = 0;
    m_ctx->codec_id = m_encoder->id;
    m_ctx->codec_type = AVMEDIA_TYPE_VIDEO;
    m_ctx->pix_fmt = m_h264InputFormat;
    m_ctx->compression_level = 4;
    m_ctx->flags &= ~AV_CODEC_FLAG_CLOSED_GOP;
    AVDictionary *param = nullptr;
    av_dict_set(&param, "idr_interval", "0", 0);
    av_dict_set(&param, "async_depth", "1", 0);
    av_dict_set(&param, "forced_idr", "1", 0);


    


    and in the encoding, I set the AVFrame to be AV_PICTURE_TYPE_I when key frame is needed :

    


      if(key_frame){
        encodeFrame->pict_type = AV_PICTURE_TYPE_I;
    }else{
        encodeFrame->pict_type = AV_PICTURE_TYPE_NONE;
    }
    avcodec_send_frame(m_ctx, encodeFrame);
    avcodec_receive_packet(m_ctx, m_packet);
   std::cerr<<"packet size is "<size<<",is key frame "<code>

    


    The strange phenomenon is that if I had set one frame to AV_PICTURE_TYPE_I, then every encoded frame's size after the key frame would increase. If I change the h264 encoder to x264, then it's ok.

    


    The packet size is as below before I call "encodeFrame->pict_type = AV_PICTURE_TYPE_I" :

    


    packet size is 26839
packet size is 2766
packet size is 2794
packet size is 2193
packet size is 1820
packet size is 2542
packet size is 2024
packet size is 1692
packet size is 2095
packet size is 2550
packet size is 1685
packet size is 1800
packet size is 2276
packet size is 1813
packet size is 2206
packet size is 2745
packet size is 2334
packet size is 2623
packet size is 2055


    


    If I call "encodeFrame->pict_type = AV_PICTURE_TYPE_I", then the packet size is as below :

    


    packet size is 23720,is key frame 1
packet size is 23771,is key frame 0
packet size is 23738,is key frame 0
packet size is 23752,is key frame 0
packet size is 23771,is key frame 0
packet size is 23763,is key frame 0
packet size is 23715,is key frame 0
packet size is 23686,is key frame 0
packet size is 23829,is key frame 0
packet size is 23774,is key frame 0
packet size is 23850,is key frame 0