Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (111)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

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

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (7993)

  • (ffmpeg.autogen)How can i Play RTSP Stream Audio With Video

    1er octobre 2018, par newbie

    I am making rtsp stream player to use opencv..

    The example Project is wonderful.

    But that is with not Sound

    I Added thid Code and I think I found Audio Stream Number, but I don’t know next step

       private readonly AVCodecContext* _aCodecContext;
       private readonly AVFormatContext* _aFormatContext;
       private readonly int _a_streamIndex;

       public VideoStreamDecoder(string url)
       {
           _vFormatContext = ffmpeg.avformat_alloc_context();

           var pFormatContext = _vFormatContext;
           ffmpeg.avformat_open_input(&pFormatContext, url, null, null).ThrowExceptionIfError();

           ffmpeg.avformat_find_stream_info(_vFormatContext, null).ThrowExceptionIfError();

           // find the first video stream
           AVStream* vStream = null;
           for (var i = 0; i < _vFormatContext->nb_streams; i++)
               if (_vFormatContext->streams[i]->codec->codec_type == AVMediaType.AVMEDIA_TYPE_VIDEO)
               {
                   vStream = _vFormatContext->streams[i];
                   break;
               }

           // find Audio stream
           AVStream* aStream = null;
           for (var i = 0; i < _vFormatContext->nb_streams; i++)
               if (_vFormatContext->streams[i]->codec->codec_type == AVMediaType.AVMEDIA_TYPE_AUDIO)
               {
                   aStream = _vFormatContext->streams[i];
                   break;
               }

           if (vStream == null) throw new InvalidOperationException("Could not found video stream.");

           _v_streamIndex = vStream->index;
           _vCodecContext = vStream->codec;

           _a_streamIndex = aStream->index;
           _aCodecContext = aStream->codec;

           var vcodecId = _vCodecContext->codec_id;
           var vCodec = ffmpeg.avcodec_find_decoder(vcodecId);

           var acodecId = _aCodecContext->codec_id;
           var aCodec = ffmpeg.avcodec_find_decoder(acodecId);

           if (vCodec == null) throw new InvalidOperationException("Unsupported codec.");

           ffmpeg.avcodec_open2(_vCodecContext, vCodec, null).ThrowExceptionIfError();
           ffmpeg.avcodec_open2(_aCodecContext, aCodec, null).ThrowExceptionIfError();

           vCodecName = ffmpeg.avcodec_get_name(vcodecId);
           aCodecName = ffmpeg.avcodec_get_name(acodecId);
           FrameSize = new Size(_vCodecContext->width, _vCodecContext->height);
           PixelFormat = _vCodecContext->pix_fmt;

           _pPacket = ffmpeg.av_packet_alloc();
           _pFrame = ffmpeg.av_frame_alloc();
       }
  • on('progress') not working - node.js ytdl-core fluent-ffmpeg

    9 juillet 2018, par TheBandolero

    So i’m playing with this libraries ytdl-core and fluent-ffmpeg, and basically i got to this function by modifying some examples to fit what i wanted.

    everything works fine except for the second on('progress', progress => ....) call. The first one works as expected, but the second one looks like it isn’t even reached, since Console.log() inside the second on('progress'....) isn’t logging anything at all.

    Also console doesn’t show any errors throughout the whole function, and the outcome is the expected without any problem, except for the second on('progress') issue.

    I can’t figure out what the problem is, so I hope somebody with more experience can point the problem out to me, since it’s getting quite frustrating now...

    function descargarVideoHD(link) {
           ytdl.getInfo(link, (err, info) => {
               if (err) throw err;

               $('li:contains(' + link + ') .progress').css("visibility", "visible");

               var longitudEnTiempo = parseInt(info.length_seconds);
               let id = ytdl.getURLVideoID(link);
               var titulo = limpiarTituloDelVideo(info.title);

               let stream = ytdl(id, {
                   quality: 'highestaudio',
                   //filter: 'audioonly',
               });

               //var audioOutput = path.resolve(__dirname, 'audio_' + titulo + '.mp4');
               var mainOutput = path.resolve(__dirname, titulo + '.mp4');
               var renameFileName = titulo + '.mp4';

               var audioOutput = path.resolve(__dirname, titulo + '.mp3');

               ffmpeg(stream)
                   //.audioBitrate(128)
                   .audioBitrate(256)
                   .save(`${__dirname}/${titulo}.mp3`)
                   .on('progress', (p) => {
                       //readline.cursorTo(process.stdout, 0);
                       //process.stdout.write(`${p.targetSize}kb downloaded`);
                       var hmsA = p.timemark;
                       var aA = hmsA.split(':');
                       var secondsA = parseInt((+aA[0]) * 60 * 60 + (+aA[1]) * 60 + (+aA[2]));
                       var porcentageA = (((secondsA / longitudEnTiempo) * 100) / 2).toFixed(2);
                       $('li:contains(' + link + ') .progress .determinate').css("width", porcentageA + "%");
                       //console.log(titulo + ' procesado al ' + porcentage + '%');
                   })
                   .on('end', () => {
                       ffmpeg()
                           .input(ytdl(link, {
                               filter: format => {
                                   return format.container === 'mp4' && !format.audioEncoding;
                               }
                           }))
                           .videoCodec('copy')
                           .input(audioOutput)
                           .audioCodec('copy')
                           .save(mainOutput)
                           .on('error', console.error)
                           .on('progress', progress => {
                               console.log('Dentro de OnProgress...');
                               var hms = progress.timemark;
                               console.log('Timemark: ' + hms);
                               var a = hms.split(':');
                               var seconds = parseInt((+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]));
                               console.log('Segundos: ' + seconds);
                               var porcentage = ((((seconds / longitudEnTiempo) * 100) / 2) + 50).toFixed(2);
                               console.log('Procesado al ' + porcentage + '%');
                               $('li:contains(' + link + ') .progress .determinate').css("width", porcentage + "%");
                           }).on('end', () => {
                               fs.unlink(audioOutput, err => {
                                   if (err) {
                                       console.error(err);
                                   }
                                   else {
                                       $('li:contains(' + link + ') .progress .determinate').css("width", "100%");
                                       $('li:contains(' + link + ') .secondary-content.material-icons').text('done');
                                       $('li:contains(' + link + ') .secondary-content.material-icons').addClass('text-green');
                                       /* $('li:contains(' + link + ')').remove();
                                       var indexItem = listaEnlacesYoutube.indexOf(link);
                                       listaEnlacesYoutube.splice(indexItem, 1); */
                                   }
                               });
                           });
                   });
           });
       }
  • libmp3lame ignore ffmpeg options, and can not change audio bitrate

    27 août 2018, par Ahmed

    i have java application to encode audio and send it via socket to server, i use ffmpeg to get compressed avpacket then send this packet via socket , the problem is the bandwidth is large than what is want, and can not control it, i try to set bitrate option to encoder (libmp3lame) but it’s ignore it completely, and i don not know is the problem from code or because i did not use ffmpeg libformat to send the packet to socket ?

    this how i open a codec

          codec = avcodec_find_encoder_by_name("libmp3lame");
           //codec = avcodec_find_encoder(AV_CODEC_ID_MP3);

           if(codec == null)
               throw new Exception("Codec not found");

           context = avcodec_alloc_context3(codec);

           if(context == null)
               throw new Exception("Could not allocate audio codec context");

           context.codec_tag(0);
           context.codec_id(AV_CODEC_ID_MP3);
           context.codec_type(AVMEDIA_TYPE_AUDIO);

           // set sample parameter
           context.bit_rate(audio_bitrate);
           context.sample_rate(samples_rate);
           context.channels(samples_channels);
           context.channel_layout(av_get_default_channel_layout(samples_channels));
           context.time_base().num(1).den(samples_rate);

           context.sample_fmt(AV_SAMPLE_FMT_S16);
           context.bits_per_raw_sample(16);        

           context.flags(context.flags() | AV_CODEC_FLAG_QSCALE);
           context.global_quality((int)Math.round(FF_QP2LAMBDA * audioQuality));

           if ((codec.capabilities() & AV_CODEC_CAP_EXPERIMENTAL) != 0) {
               context.strict_std_compliance(AVCodecContext.FF_COMPLIANCE_EXPERIMENTAL);
           }

           // priv_data()
           av_opt_set(context.priv_data() , "crf" , audioQuality + "" , 0);
           av_opt_set(context.priv_data() , "b" , "85" , 0);
           //av_opt_set(context.priv_data() , "V" , "2" , 0);
           //av_opt_set(context.priv_data() , "lowpass" , "120" , 0);
           av_opt_set(context.priv_data() , "abr" , "1" , 0);

           AVDictionary options = new AVDictionary(null);
           //av_dict_set(options, "crf", ""+audioQuality , 0);
           av_dict_set(options, "b:a", "8k" , 0);
           av_dict_set(options , "q:a" , "8" , 0);
           //av_dict_set(options , "lowpass" , "19.5" , 0);
           //av_dict_set(options, "b" , "8K" , 0);


           // open codec
           if (avcodec_open2(context, codec, (PointerPointer)null ) < 0)
               throw new Exception("Could not open codec");
    ....