Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (47)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

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

Sur d’autres sites (7523)

  • Converting 3gp (amr) to mp3 using ffmpeg api calls

    13 mars 2012, par Sebastian L.

    Converting 3gp (amr) to mp3 using ffmpeg api calls

    I try to use libavformat (ffmpeg) to build my own function that converts 3gp audio files (recorded with an android mobile device) into mp3 files.

    I use av_read_frame() to read a frame from the input file and use avcodec_decode_audio3() to decode the data
    into a buffer and use this buffer to encode the data into mp3 with avcodec_encode_audio.
    This seems to give me a correct result for converting wav to mp3 and mp3 to wav (Or decode one mp3 and encode to another mp3) but not for amr to mp3.
    My resulting mp3 file seems to has the right length but only consists of noise.

    In another post I read that amr-decoder does not use the same sample format than mp3 does.
    AMR uses FLT and mp3 S16 or S32 und that I have to do resampling.
    So I call av_audio_resample_init() and audio_resample for each frame that has been decoded.
    But that does not solve my problem completely. Now I can hear my recorded voice and unsterstand what I was saying, but the quality is very low and there is still a lot of noise.
    I am not sure if I set the parameters of av_audio_resample correctly, especially the last 4 parameters (I think not) or if I miss something else.

    ReSampleContext* reSampleContext = av_audio_resample_init(1, 1, 44100, 8000, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT, 0, 0, 0, 0.0);

    while(1)
    {
       if(av_read_frame(ic, &avpkt) < 0)
       {
           break;
       }

       out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
       int count;

       count = avcodec_decode_audio3(audio_stream->codec, (short *)decodedBuffer, &out_size, &avpkt);

       if(count < 0)
       {
           break;
       }

       if((audio_resample(reSampleContext, (short *)resampledBuffer, (short *)decodedBuffer, out_size / 4)) < 0)
       {
           fprintf(stderr, "Error\n");
           exit(1);
       }

       out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;

       pktOut.size = avcodec_encode_audio(c, outbuf, out_size, (short *)resampledBuffer);

       if(c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE)
       {
           pktOut.pts = av_rescale_q(c->coded_frame->pts, c->time_base, outStream->time_base);
           //av_res
       }

       pktOut.pts = AV_NOPTS_VALUE;
       pktOut.dts = AV_NOPTS_VALUE;

       pktOut.flags |= AV_PKT_FLAG_KEY;
       pktOut.stream_index = audio_stream->index;
       pktOut.data = outbuf;

       if(av_write_frame(oc, &pktOut) != 0)
       {
           fprintf(stderr, "Error while writing audio frame\n");
           exit(1);
       }
    }
  • TLS issue with ffmpeg

    22 mai 2017, par true_gler

    I try to use TLS to verify a stream... (ffmpeg.org/ffmpeg-protocols.html#tls)

    ca_file, cafile=filename
    A file containing certificate authority (CA) root certificates to treat as trusted. If the linked TLS library contains a default this might not need to be specified for verification to work, but not all libraries and setups have defaults built in. The file must be in OpenSSL PEM format.

    tls_verify=1|0
    If enabled, try to verify the peer that we are communicating with. Note, if using OpenSSL, this currently only makes sure that the peer certificate is signed by one of the root certificates in the CA database, but it does not validate that the certificate actually matches the host name we are trying to connect to. (With GnuTLS, the host name is validated as well.)

    This is disabled by default since it requires a CA database to be provided by the caller in many cases.

    cert_file, cert=filename
    A file containing a certificate to use in the handshake with the peer. (When operating as server, in listen mode, this is more often required by the peer, while client certificates only are mandated in certain setups.)

    key_file, key=filename
    A file containing the private key for the certificate.

    listen=1|0
    If enabled, listen for connections on the provided port, and assume the server role in the handshake instead of the client role.

    Generally, i try to grab the screen at my client, send the captured via live stream to the server and display it there (with e.g. ffplay).
    All this happens in a LAN.

    I am a little bit confused...

    • What are the parameters at the client side (ffmpeg) ?
    • What are the parameters at the server side for display (ffplay) ? (Don’t i need here the ca_file specification ??)

    My commands I used so far, I am pretty sure I miss something ?!

    sudo ffmpeg -r 60 -f x11grab -s 1920x1080 -i :0.0 -c:v libx264 -b:v 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k -pix_fmt yuv420p -preset ultrafast -tune zerolatency -bsf:v h264_mp4toannexb -f mpegts "tls://localhost:8888?listen&cert=server-cert.pem&key=server-privatekey.pem"


    sudo ffplay -f mpegts "tls://localhost:8888"
  • Join us for the Piwik Community Meetup 2015 !

    25 juin 2015, par Piwik Core Team — Community, Meta

    We’re excited to announce that our third Piwik Community Meetup will be held in Berlin on Tuesday, the 4th of August, 2015. Don’t miss this great opportunity to connect with other users and meet the core team behind Piwik. It’s free, so REGISTER TODAY ! And maybe you would like to share your Piwik use case ? We’re also waiting for your presentation ideas.

    We will cover some of the upcoming features, discuss the future of Piwik, share tricks and hacks to help you get the most out of your Piwik platform, and socialise. If you use Piwik to improve your websites and apps, or are just generally curious about digital analytics and marketing – this event is not to be missed. As our core team is scattered all over the world, this will be a rare opportunity for you to meet and talk to us all at once – especially for those of you interested in the platform, integrating your app with Piwik, and building plugins.

    After the official part, we would like to enjoy drinks with all the participants in the nearby bars. We hope you will be able to join us !

    All Piwik community members are warmly invited to take part in the meetup !

    Piwik Community Meetup 2015

    When ?

    Tuesday, the 4th of August, from 5-9pm

    Where ?

    Kulturbrauerei
    Schönhauser Allee
    Prenzlauer Berg area
    Berlin, Germany
    exact directions tbc.

    Languages :

    English and German

    Book tickets :

    BOOK YOUR FREE INVITATION HERE

    Open call for YOUR presentation ideas

    We would also like to hear how you use Piwik – we’ll be delighted if you’d share your interesting use case during the Meetup. Please send your presentation ideas (speaking time : 5 to 7 minutes) to : meetup@piwik.pro ! Deadline : 20th of July 2015.

    Contact the organisers :

    meetup@piwik.pro