Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (78)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (8888)

  • How can I play libvorbis(ogg) streams using ffplay received with udp ?

    31 mars 2017, par crisman

    ffmpeg

    ffmpeg -f dshow -i audio="virtual-audio-capturer" -codec:a libvorbis -b:a 128k -ac 2 -ar 48000 -f mpegts udp://127.0.0.1:1111

    ffplay

    ffplay -codec:a libvorbis -b:a 128k -ar 48000 -ac 2 udp://127.0.0.1:1111

    not playing audio.


    Other codecs play back working, example below.

    aac working

    ffmpeg -f dshow -i audio="virtual-audio-capturer" -codec:a aac -b:a 128k -ac 2 -ar 48000 -f mpegts udp://127.0.0.1:1111
    ffplay -codec:a aac -b:a 128k -ar 48000 -ac 2 udp://127.0.0.1:1111

    opus codec working

    ffmpeg -f dshow -i audio="virtual-audio-capturer" -codec:a libopus -b:a 128k -ac 2 -ar 48000 -f mpegts udp://127.0.0.1:1111
    ffplay -codec:a libopus -b:a 128k -ar 48000 -ac 2 udp://127.0.0.1:1111

    mp3 working

    ffmpeg -f dshow -i audio="virtual-audio-capturer" -codec:a mp3 -b:a 128k -ac 2 -ar 48000 -f mpegts udp://127.0.0.1:1111
    ffplay -codec:a mp3 -b:a 128k -ar 48000 -ac 2 udp://127.0.0.1:1111

    why libvorbis not working ?

    transport success, but can not play, i think.

    // not woring ffplay displayed log
    ffplay.exe -loglevel debug -codec:a vorbis -b:a 128k -ar 48000 -ac 2 -sync audio -i udp://127.0.0.1:1111
    ffplay version N-83781-g3016e91 Copyright (c) 2003-2017 the FFmpeg developers
    built with gcc 6.3.0 (GCC)
    configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
    libavutil 55. 48.100 / 55. 48.100
    libavcodec 57. 82.102 / 57. 82.102
    libavformat 57. 66.103 / 57. 66.103
    libavdevice 57. 3.100 / 57. 3.100
    libavfilter 6. 74.100 / 6. 74.100
    libswscale 4. 3.101 / 4. 3.101
    libswresample 2. 4.100 / 2. 4.100
    libpostproc 54. 2.100 / 54. 2.100
    [udp @ 0000000000b68700] No default whitelist set sq= 0B f=0/0
    [udp @ 0000000000b68700] end receive buffer size reported is 65536
    [mpegts @ 0000000000b68ac0] Format mpegts probed with size=2048 and score=50
    [mpegts @ 0000000000b68ac0] stream=0 stream_type=6 pid=100 prog_reg_desc=
    [mpegts @ 0000000000b68ac0] Before avformat_find_stream_info() pos: 0 bytes read:8208 seeks:0 nb_streams:1
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2500
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2499
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2498
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2497
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2496
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2495
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2494= 0B f=0/0
    [mpegts @ 0000000000b68ac0] Probe with size=10038, packets=7 detected mp3 with score=1
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2493= 0B f=0/0
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2492= 0B f=0/0
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2491= 0B f=0/0
    [mpegts @ 0000000000b68ac0] Probe with size=18321, packets=10 detected mp3 with score=1
    [mpegts @ 0000000000b68ac0] probing stream 0 pp:2490= 0B f=0/0
  • ffprobe : fix printing packet side data information

    25 mars 2017, par James Almer
    ffprobe : fix printing packet side data information
    

    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] ffprobe.c
    • [DH] tests/ref/fate/mov-aac-2048-priming
  • Copying audio stream via ffmpeg c api

    28 mars 2017, par David Barishev

    I’m trying to replicate ffmpeg command ffmpeg -i <input /> -vn -acodec copy <output></output>,using the C api, in my c++ android project.

    There isn’t too much documentations on the subject, and some of the methods in the example are deprecated and i don’t know how to fix them.

    Here is the code i have worked on, and understood,i have highlited some parts in with the comments :

    extern "C"
    int extract_audio(const char *in_filename,const char *out_filename){

       // Library init
       SSL_load_error_strings();
       SSL_library_init();

       av_register_all ();
       avformat_network_init ();

       //Logging init
       av_log_set_callback(log_callback_android);


       //Variable init
       AVOutputFormat *ofmt = NULL;
       AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL;
       AVPacket pkt;
       int ret, i;

       int stream_index = 0;

       //Open input file
       if ((ret = avformat_open_input(&amp;ifmt_ctx, in_filename, 0, 0)) &lt; 0) {
           av_log(NULL,AV_LOG_FATAL, "Could not open input file '%s'", in_filename);
           goto end;
       }
       if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) &lt; 0) {
           av_log(NULL,AV_LOG_FATAL, "Failed to retrieve input stream information");
           goto end;
       }

       //Print input file stream info
       av_dump_format(ifmt_ctx, 0, in_filename, 0);

       //Allocate new context for output file
       avformat_alloc_output_context2(&amp;ofmt_ctx, NULL, NULL, out_filename);
       if (!ofmt_ctx) {
           av_log(NULL,AV_LOG_FATAL, "Could not create output context");
           ret = AVERROR_UNKNOWN;
           goto end;
       }

       ofmt = ofmt_ctx->oformat;

       // Iterate over all streams in input file
       for (i = 0; i &lt; ifmt_ctx->nb_streams; i++) {
           //Stream input
           AVStream *in_stream = ifmt_ctx->streams[i];

           //Filter non audio streams
           if(in_stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO){
               __android_log_print(ANDROID_LOG_INFO,APPNAME,"Audio stream found");

               AVStream *out_stream = avformat_new_stream(ofmt_ctx, NULL);
               if (!out_stream) {
                   __android_log_print(ANDROID_LOG_ERROR, APPNAME, "Failed allocating output stream\n");
                   ret = AVERROR_UNKNOWN;
                   goto end;
               }


               if ((ret = avcodec_parameters_copy(out_stream->codecpar, in_stream->codecpar)) &lt; 0) {
                   av_log(NULL, AV_LOG_ERROR, "Copying parameters for stream #%u failed\n", i);
                   return ret;
               }

               out_stream->time_base = in_stream->time_base;


           }

       }

       //Dump output format
       av_dump_format(ofmt_ctx, 0, out_filename, 1);

       //Open output file
       if (!(ofmt->flags &amp; AVFMT_NOFILE)) {
           ret = avio_open(&amp;ofmt_ctx->pb, out_filename, AVIO_FLAG_WRITE);
           if (ret &lt; 0) {
               av_log(NULL, AV_LOG_ERROR, "Could not open output file '%s'", out_filename);
               goto end;
           }
       }

       //Writing output header
       if ((ret = avformat_write_header(ofmt_ctx, NULL)) &lt; 0) {
           av_log(NULL, AV_LOG_ERROR, "Error occurred when opening output file");
           goto end;
       }

       while (1) {
           AVStream *in_stream, *out_stream;

           if ((ret = av_read_frame(ifmt_ctx, &amp;pkt)) &lt; 0)
               break;

           stream_index = pkt.stream_index;

           /* remux this frame without reencoding */
           av_packet_rescale_ts(&amp;pkt,
                                ifmt_ctx->streams[stream_index]->time_base,
                                ofmt_ctx->streams[stream_index]->time_base);

           if ((ret = ret = av_interleaved_write_frame(ofmt_ctx, &amp;pkt)) &lt; 0){
               av_log(NULL,AV_LOG_FATAL,"Error muxing packet");
               goto end;
           }


           av_packet_unref(&amp;pkt);
       }

       av_write_trailer(ofmt_ctx);

       end:
       avformat_close_input(&amp;ifmt_ctx);

       /* close output */
       if (ofmt_ctx &amp;&amp; !(ofmt->flags &amp; AVFMT_NOFILE))
           avio_closep(&amp;ofmt_ctx->pb);
       avformat_free_context(ofmt_ctx);


       if (ret &lt; 0 &amp;&amp; ret != AVERROR_EOF) {
           av_log(NULL,AV_LOG_FATAL, "Error: %s", av_err2str(ret));
       }

    }

    This code produces the following output :

    ===Input Information===

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '<input />':
     Metadata:
       major_brand     :
           isom
       minor_version   :
           512
       compatible_brands:
           isomiso2avc1mp41
       encoder         :
           Lavf57.25.100
       Duration:
           00:00:58.82
           , start:
           0.000000
           , bitrate:
       7369 kb/s
           Stream #0:0
               (eng)
                   Audio: aac (mp4a / 0x6134706D), 44100 Hz, 2 channels, 160 kb/s
               (default)
           Metadata:
           handler_name    :
               SoundHandler
           Stream #0:1
               (eng)
                   Video: h264 (avc1 / 0x31637661), none, 640x640, 7213 kb/s

               30 fps,
               30 tbr,
               15360 tbn,
               15360 tbc
               (default)
           Metadata:
           handler_name    :
           VideoHandler

    ===Ouput Information===

    Audio stream found
    Output #0, adts, to 'out.aac':
       Stream #0:0
    Audio: aac (mp4a / 0x6134706D), 44100 Hz, 2 channels, 160 kb/s

    ==Packet Logging==

    in: pts:-2048 pts_time:-0.0464399 dts:-2048 dts_time:-0.0464399 duration:1024 duration_time:0.02322 stream_index:0
    out: pts:-2048 pts_time:-0.0464399 dts:-2048 dts_time:-0.0464399 duration:1024 duration_time:0.02322 stream_index:0
    in: pts:-1024 pts_time:-0.02322 dts:-1024 dts_time:-0.02322 duration:1024 duration_time:0.02322 stream_index:0
    out: pts:-1024 pts_time:-0.02322 dts:-1024 dts_time:-0.02322 duration:1024 duration_time:0.02322 stream_index:0
    in: pts:0 pts_time:0 dts:0 dts_time:0 duration:1024 duration_time:0.02322 stream_index:0
    out: pts:0 pts_time:0 dts:0 dts_time:0 duration:1024 duration_time:0.02322 stream_index:0
    in: pts:0 pts_time:0 dts:0 dts_time:0 duration:512 duration_time:0.0333333 stream_index:1

    The snippit handlers file opening, context creation, stream codec copying fine, but crashes after a few loops in the packet muxing part, with signal error :

    Signal: SIGSEGV (signal SIGSEGV: invalid address (fault address: 0x28))

    What did i do wrong ? I wrote this code using some examples and got the code to the current state, but i’m lost now, any help would be greatly appreciated !