Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (59)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • 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

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (7928)

  • how do i create a stereo mp3 file with latest version of ffmpeg ?

    17 juin 2016, par Sean

    I’m updating my code from the older version of ffmpeg (53) to the newer (54/55). Code that did work has now been deprecated or removed so i’m having problems updating it.

    Previously I could create a stereo MP3 file using a sample format called :

    SAMPLE_FMT_S16

    That matched up perfectly with my source stream. This has now been replace with

    AV_SAMPLE_FMT_S16

    Which works fine for mono recordings but when I try to create a stereo MP3 file it bugs out at avcodec_open2 with :

    "Specified sample_fmt is not supported."

    Through trial and error I’ve found that using

    AV_SAMPLE_FMT_S16P

    ...is accepted by avcodec_open2 but when I get through and create the MP3 file the sound is very distorted - it sounds about 2 octaves lower than usual with a massive hum in the background - here’s an example recording :

    http://hosting.ispyconnect.com/example.mp3

    I’ve been told by the ffmpeg guys that this is because I now need to manually deinterleave my byte stream before calling :

    avcodec_fill_audio_frame

    How do I do that ? I’ve tried using the swrescale library without success and i’ve tried manually feeding in L/R data into avcodec_fill_audio_frame but the results i’m getting are sounding exactly the same as without interleaving.

    Here is my code for encoding :

    void add_audio_sample( AudioWriterPrivateData^ data, BYTE* soundBuffer, int soundBufferSize)
    {
       libffmpeg::AVCodecContext* c = data->AudioStream->codec;
       memcpy(data->AudioBuffer + data->AudioBufferSizeCurrent,  soundBuffer, soundBufferSize);
       data->AudioBufferSizeCurrent += soundBufferSize;
       uint8_t* pSoundBuffer = (uint8_t *)data->AudioBuffer;
       DWORD nCurrentSize    = data->AudioBufferSizeCurrent;

       libffmpeg::AVFrame *frame;

       int got_packet;
       int ret;
       int size = libffmpeg::av_samples_get_buffer_size(NULL, c->channels,
                                                 data->AudioInputSampleSize,
                                                 c->sample_fmt, 1);

       while( nCurrentSize >= size)    {

           frame=libffmpeg::avcodec_alloc_frame();
           libffmpeg::avcodec_get_frame_defaults(frame);

           frame->nb_samples = data->AudioInputSampleSize;

           ret = libffmpeg::avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt, pSoundBuffer, size, 1);
           if (ret<0)
           {
               throw gcnew System::IO::IOException("error filling audio");
           }
           //audio_pts = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;

           libffmpeg::AVPacket pkt = { 0 };
           libffmpeg::av_init_packet(&pkt);

           ret = libffmpeg::avcodec_encode_audio2(c, &pkt, frame, &got_packet);

           if (ret<0)
                   throw gcnew System::IO::IOException("error encoding audio");
           if (got_packet) {
               pkt.stream_index = data->AudioStream->index;

               if (pkt.pts != AV_NOPTS_VALUE)
                   pkt.pts = libffmpeg::av_rescale_q(pkt.pts, c->time_base, c->time_base);
               if (pkt.duration > 0)
                   pkt.duration = av_rescale_q(pkt.duration, c->time_base, c->time_base);

               pkt.flags |= AV_PKT_FLAG_KEY;

               if (libffmpeg::av_interleaved_write_frame(data->FormatContext, &pkt) != 0)
                       throw gcnew System::IO::IOException("unable to write audio frame.");


           }
           nCurrentSize -= size;  
           pSoundBuffer += size;  
       }
       memcpy(data->AudioBuffer, data->AudioBuffer + data->AudioBufferSizeCurrent - nCurrentSize, nCurrentSize);
       data->AudioBufferSizeCurrent = nCurrentSize;

    }

    Would love to hear any ideas - I’ve been trying to get this working for 3 days now :(

  • No accelerated colorspace conversion found from yuv420p to argb

    13 mars, par Zac Chan

    I am a novice at ffmpeg and have recently taken over a code base built by a previous engineer. The FFmpeg code is on an app engine that will edit the videos when they are uploaded.

    


    This code generated a title animation that will later be used as an overlay.

    


    exports.generateTitleAnimation = function(metadata, destPath, options = {}) {
const peeqLogoPath = "/app/assets/peeq-logo.png";
const whiteBarMovPath = "/app/assets/whiteBar.mov";
const titleFontPath = "/app/assets/Sofia-Pro-Black.otf";
const dateStrFontPath = "/app/assets/Sofia-Pro-Medium.otf";
const outputDuration = 5.52;
const src01 = "color=c=white:s=1920x1080:duration=" + outputDuration;
const src02 = "color=c=white@0.0:s=1920x1080:r=120:duration=" + outputDuration;

var dateStrXOffset = "(92";
var filterComplexStr = "[1]";

if (metadata.title) {
    const title = metadata.title.toUpperCase();
    filterComplexStr += "drawtext=fontfile=" + titleFontPath + ":text='" + title + "':x='floor(92*(min((t-1.75)^29,0)+max((t-3.75)^29,0)+1))':y=622+30+2:fontsize=70:fontcolor=black:ft_load_flags=render,";
}
if (metadata.subTitle) {
    const subTitle = metadata.subTitle.toUpperCase();
    filterComplexStr += "drawtext=fontfile=" + titleFontPath + ":text='" + subTitle + "':x='floor(92*(min((t-2.0)^29,0.0)+max((t-3.8)^29,0.0)+1.0))':y=622+184-20-60+9:fontsize=46:fontcolor=black:ft_load_flags=render,";

    dateStrXOffset += "+30*" + (subTitle.length + 1);
}
if (metadata.dateStr) {
    filterComplexStr += "drawtext=fontfile=" + dateStrFontPath + ":text='" + metadata.dateStr + "':x='floor(" + dateStrXOffset + ")*(min((t-2.0)^29,0.0)+max((t-3.8)^29,0.0)+1.0))':y=622+184-20-60+9:fontsize=46:fontcolor=black:ft_load_flags=render,";
}
console.log("generateTitleAnimation generating")
filterComplexStr += "split=10[t01][t02][t03][t04][t05][t06][t07][t08][t09][t10];[t02]setpts=PTS+0.0166/TB[d02];[t03]setpts=PTS+0.033/TB[d03];[t04]setpts=PTS+0.05/TB[d04];[t05]setpts=PTS+0.0666/TB[d05];[t06]setpts=PTS+0.083/TB[d06];[t07]setpts=PTS+0.1/TB[d07];[t08]setpts=PTS+0.1166/TB[d08];[t09]setpts=PTS+0.133/TB[d09];[t10]setpts=PTS+0.15/TB[d10];[d10][d09]blend=average,[d08]blend=darken,[d07]blend=average,[d06]blend=darken,[d05]blend=average,[d04]blend=darken,[d03]blend= average,[d02]blend=darken,[t01]blend=average,colorkey=white:0.2:0.0,perspective=y1=W*0.176327:y3=H+W*0.176327[text01];[2][3]overlay=x=(W-w)*0.5:y=(H-h)*0.5:enable='between(t,0,3.0)'[logo01];[logo01][text01]overlay[outv]";

var args = ["-y", "-f", "lavfi", "-i", src01, "-f", "lavfi", "-i", src02, "-i", whiteBarMovPath, "-i", peeqLogoPath, "-filter_complex", filterComplexStr, "-vcodec", "qtrle", "-crf:v", "28", "-codec:a", "aac", "-ac", "2", "-ar", "44100", "-ab", "128k", "-map", "[outv]", destPath];

//console.log("args", args);
return childProcess.spawn('ffmpeg', args).then((ffResult) => {
    return destPath;
}, (err) => {
    //console.error(new Error("generateTitleAnimation:" + err));
    console.error(err);
    return Promise.reject(err);
});};


    


    destPath is a .mov file

    


    Up till a few days ago, the backend started throwing up this error

    


    stderr: 'ffmpeg version 3.4.2-1~16.04.york0.2 Copyright (c) 2000-2018
 the FFmpeg developers\n built with gcc 5.4.0 (Ubuntu 5.4.0-
6ubuntu1~16.04.9) 20160609\n configuration: --prefix=/usr --extra-
version=\'1~16.04.york0.2\' --toolchain=hardened --
libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --
enable-gpl --disable-stripping --enable-avresample --enable-avisynth --
enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --
enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --
enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-
libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-
libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --
enable-librubberband --enable-librsvg --enable-libshine --enable-
libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-
libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --
enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 -
-enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-
openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --
enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-
libopencv --enable-libx264 --enable-shared\n libavutil 55. 78.100 / 55.
 78.100\n libavcodec 57.107.100 / 57.107.100\n libavformat 57. 83.100 /
 57. 83.100\n libavdevice 57. 10.100 / 57. 10.100\n libavfilter 
6.107.100 / 6.107.100\n libavresample 3. 7. 0 / 3. 7. 0\n libswscale 4.
 8.100 / 4. 8.100\n libswresample 2. 9.100 / 2. 9.100\n libpostproc 54.
 7.100 / 54. 7.100\nInput #0, lavfi, from 
\'color=c=white:s=1920x1080:duration=5.52\':\n Duration: N/A, start: 
0.000000, bitrate: N/A\n Stream #0:0: Video: rawvideo (I420 / 
0x30323449), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25
 tbc\nInput #1, lavfi, from 
\'color=c=white@0.0:s=1920x1080:r=120:duration=5.52\':\n Duration: N/A,
 start: 0.000000, bitrate: N/A\n Stream #1:0: Video: rawvideo (I420 /
 0x30323449), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 120 fps, 120 tbr,
 120 tbn, 120 tbc\nInput #2, mov,mp4,m4a,3gp,3g2,mj2, from 
\'/app/assets/whiteBar.mov\':\n Metadata:\n major_brand : qt \n 
minor_version : 537199360\n compatible_brands: qt \n creation_time : 
2018-04-27T15:55:18.000000Z\n Duration: 00:00:05.52, start: 0.000000, 
bitrate: 54847 kb/s\n Stream #2:0(eng): Video: qtrle (rle / 
0x20656C72), bgra(progressive), 1920x1080, 53326 kb/s, SAR 1:1 DAR 16:9, 60 
fps, 60 tbr, 60 tbn, 60 tbc (default)\n Metadata:\n creation_time : 
2018-04-27T15:55:18.000000Z\n handler_name : Apple Alias Data Handler\n
 encoder : Animation\n timecode : 00:00:00:00\n Stream #2:1(eng): Data:
 none (tmcd / 0x64636D74), 0 kb/s (default)\n Metadata:\n creation_time
 : 2018-04-27T15:55:18.000000Z\n handler_name : Apple Alias Data
 Handler\n timecode : 00:00:00:00\nInput #3, png_pipe, from 
\'/app/assets/peeq-logo.png\':\n Duration: N/A, bitrate: N/A\n Stream 
#3:0: Video: png, rgba(pc), 452x207 [SAR 2834:2834 DAR 452:207], 25 
tbr, 25 tbn, 25 tbc\nCodec AVOption crf (Select the quality for 
constant quality mode) specified for output file #0 (/tmp/972967.mov) 
has not been used for any stream. The most likely reason is either 
wrong type (e.g. a video option with no video streams) or that it is a 
private option of some encoder which was not actually used for any 
stream.\nCodec AVOption b (set bitrate (in bits/s)) specified for 
output file #0 (/tmp/972967.mov) has not been used for any stream. The 
most likely reason is either wrong type (e.g. a video option with no 
video streams) or that it is a private option of some encoder which was 
not actually used for any stream.\nStream mapping:\n Stream #1:0 
(rawvideo) -> drawtext\n Stream #2:0 (qtrle) -> overlay:main\n Stream 
#3:0 (png) -> overlay:overlay\n overlay -> Stream #0:0 (qtrle)\nPress 
[q] to stop, [?] for help\n[swscaler @ 0x56080b828180] No accelerated 
colorspace conversion found from yuv420p to argb.\n[swscaler @ 
0x56080b8b5f40] No accelerated colorspace conversion found from yuva420p to argb.\n',


    


    However, this error only occurs on the app engine. Running nom test on my Mac generates the title perfectly.

    


  • FFmpeg error : Output file is empty, nothing was encoded

    25 mai 2018, par Morteza M

    I am using the following command ffmpeg command and execute it in Python. It used to work for at least a month finely. However, its two days it stopped working and generates different errors. The most important one is "Output file is empty, nothing was encoded"

    PS : I checked the connectivity to Camera and is healthy. I am able to see the Camera output on my screen using its software.

    The Command :

    ffmpeg -i rtsp ://username:pass@ip_add:port/videoMain -b 1920k -f image2 -r fps -strftime 1 %Y-%m-%d_%H-%M-%S.jpg

    PS : fps is taken from input. I mainly used 1 for that.

    I would be gratfful if anyone can help with this. Thank you.