Recherche avancée

Médias (1)

Mot : - Tags -/wave

Autres articles (59)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • 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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (12333)

  • How can I dynamically update metadata in audio output with libav so that updates appear in MPV ?

    9 mars, par Teddy

    My ultimate goal is to proxy an internet radio station and programmatically add metadata to it during the stream that can be displayed and updated in MPV, the media player playing the audio.

    


    The metadata I would like to add is primarily the song title, but ideally additional information including artist, composer, and album.

    


    I envision running the proxy program like this :

    


    $ curl https://example.com/stream.mp3 | ./proxy_add_metadata | mpv -


    


    or maybe this :

    


    $ ./proxy_add_metadata &amp;&#xA;#=> <output>&#xA;$ mpv <output>&#xA;</output></output>

    &#xA;

    How could I make song metadata updates dynamically over time using libav ?

    &#xA;

    I’m using FFmpeg version 7.1.

    &#xA;

    I first tried changing the metadata dictionary shortly before writing a frame with a few different container formats :

    &#xA;

    av_dict_set(&amp;output_ctx->metadata, "title", "Title 1", 0);&#xA;/* [...] */&#xA;av_interleaved_write_frame(output_ctx, packet);&#xA;

    &#xA;

    Setting metadata with av_dict_set(&amp;output_ctx->metadata, "title", "Title 1", 0); only appears to work when done before writing the output header.

    &#xA;

    My next idea was to try setting metadata in AVPacket side data, but I’m unclear which container formats support this for the kind of metadata I’m working with.

    &#xA;

    I’m open to any output media container format or FFmpeg-originated network stream.

    &#xA;

    It’s unclear to me whether the metadata should be written to a separate stream within the media container or whether it should be written as side data in the output packets.

    &#xA;

    If what I’m trying to do is impossible, please explain why.

    &#xA;

    What I have so far reads audio from standard input and writes it to standard output. The input audio can be assumed to be in MP3 format. Non-working sections for metadata updates are commented out.

    &#xA;

    /* proxy_add_metadata.c */&#xA;#include &#xA;&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;&#xA;int main() {&#xA;    int _err;&#xA;&#xA;    /* MP3 input */&#xA;    AVFormatContext *input_ctx = avformat_alloc_context();&#xA;    _err = avformat_open_input(&amp;input_ctx, "pipe:0", NULL, NULL);&#xA;    _err = avformat_find_stream_info(input_ctx, NULL);&#xA;&#xA;    AVFormatContext *output_ctx;&#xA;    _err = avformat_alloc_output_context2(&amp;output_ctx, NULL, "matroska", "pipe:1");&#xA;&#xA;    AVStream *input_stream = input_ctx->streams[0];&#xA;    AVStream *output_stream = avformat_new_stream(output_ctx, NULL);&#xA;&#xA;    _err = avcodec_parameters_copy(output_stream->codecpar, input_stream->codecpar);&#xA;    _err = avio_open(&amp;output_ctx->pb, "pipe:1", AVIO_FLAG_WRITE);&#xA;&#xA;    _err = avformat_write_header(output_ctx, NULL);&#xA;&#xA;    AVPacket *packet = av_packet_alloc();&#xA;&#xA;    /* Set up packet side data. */&#xA;    /*&#xA;    AVDictionary *packet_side_data_dict;&#xA;    av_dict_set(&amp;packet_side_data_dict, "title", "Title 1", 0);&#xA;&#xA;    size_t packet_side_data_size = 0;&#xA;    uint8_t *packet_side_data = av_packet_pack_dictionary(&#xA;        packet_side_data_dict,&#xA;        &amp;packet_side_data_size&#xA;    );&#xA;    av_dict_free(&amp;packet_side_data_dict);&#xA;    */&#xA;&#xA;    while (1) {&#xA;        _err = av_read_frame(input_ctx, packet);&#xA;        if (_err &lt; 0) {&#xA;            break;&#xA;        }&#xA;&#xA;        /* Can metadata updates be made here? */&#xA;&#xA;        /* Option 1: Attempt to write metadata to the container. */&#xA;        /*&#xA;        _err = av_dict_set(&amp;output_ctx->metadata, "title", "Title 1", 0);&#xA;        if (_err &lt; 0) {&#xA;            fprintf(stderr, "error: can&#x27;t set metadata title in stream: %s\n", av_err2str(_err));&#xA;            break;&#xA;        }&#xA;        */&#xA;&#xA;        /* Option 2: Attempt to write metadata to packet side data. */&#xA;        /*&#xA;        _err = av_packet_add_side_data(&#xA;            packet,&#xA;            AV_PKT_DATA_METADATA_UPDATE,&#xA;            packet_side_data,&#xA;            packet_side_data_size&#xA;        );&#xA;        if (_err &lt; 0) {&#xA;            fprintf(stderr, "error: can&#x27;t add side data to packet: %s\n", av_err2str(_err));&#xA;            break;&#xA;        }&#xA;        */&#xA;&#xA;        AVStream *input_stream = input_ctx->streams[packet->stream_index];&#xA;        AVStream *output_stream = output_ctx->streams[packet->stream_index];&#xA;&#xA;        av_packet_rescale_ts(packet, input_stream->time_base, output_stream->time_base);&#xA;        packet->pos = -1;&#xA;&#xA;        _err = av_interleaved_write_frame(output_ctx, packet);&#xA;        if (_err &lt; 0) {&#xA;            fprintf(stderr, "error: packet write: %s\n", av_err2str(_err));&#xA;            break;&#xA;        }&#xA;    }&#xA;&#xA;    av_write_trailer(output_ctx);&#xA;&#xA;    av_packet_free_side_data(packet);&#xA;    av_packet_free(&amp;packet);&#xA;&#xA;    avio_closep(&amp;output_ctx->pb);&#xA;    avformat_free_context(output_ctx);&#xA;&#xA;    avformat_close_input(&amp;input_ctx);&#xA;&#xA;    return 0;&#xA;}&#xA;

    &#xA;

    cc \&#xA;    -Wall \&#xA;    -g \&#xA;    -I/.../ffmpeg7/include \&#xA;    -o proxy_add_metadata \&#xA;    proxy_add_metadata.c \&#xA;    -L/.../ffmpeg7/lib -lavformat -lavcodec&#xA;

    &#xA;

    $ &lt; sample.mp3 ./proxy_add_metadata | mpv -&#xA;

    &#xA;

  • ffmpeg - MXF with 4-channel audio : how to create proxies (high quality / small file size) and preserve the audio mapping

    8 juillet 2018, par WhatsYourFunction

    We’ve got MXF sources (h.264 video at UHD (3840x2160) with 4-channels of (4 - PCM S24 mono sources)
    We want Proxies — smallest file size at highest picture quality
    The compression applied to the video and audio essences can be anything,
    And the wrapper can be either MXF or QuickTime
    but we need to preserve the audio mapping (i.e. the Proxy must be 4-channel audio)

    How to do that with ffmpeg ?

    • EDIT Adding ffprobe :

    Metadata :

    uid : ***

    generation_uid : ***

    company_name : CANON

    product_name : EOS C300 Mark II

    product_version : 1.00

    product_uid : ***

    modification_date : 2018-06-28T08:29:24.000000Z

    material_package_umid : ***

    timecode : 02:50:31:17

    Duration : 00:06:35.40, start : 0.000000, bitrate : 395842 kb/s

    Stream #0:0 : Video : h264 (High 4:2:2 Intra), yuv422p10le(tv, progressive), 3840x2160, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 23.98 tbn, 47.95 tbc

    Metadata :

    file_package_umid: ***

    Stream #0:1 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s

    Metadata :

    file_package_umid: ***

    Stream #0:2 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s

    Metadata :

    file_package_umid: ***

    Stream #0:3 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s

    Metadata :

    file_package_umid: ***

    Stream #0:4 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s

    Metadata :

    file_package_umid: ***
  • Cleaning up ffmpeg output ?

    29 août 2022, par Chris

    I am using ffmpeg to restream a stream.

    &#xA;

    ffmpeg -loglevel panic -hide_banner -http_proxy *proxy* -i *link* -vcodec copy -acodec copy -f mpegts pipe:&#xA;

    &#xA;

    The output is streamed using flask in python.

    &#xA;

    VLC never has a problem playing the streams, but some programs can fail.&#xA;TVHeadend sometimes reports things like...

    &#xA;

    libav: AVFormatContext: Could not find codec parameters for stream 0 (Video: h264, 1 reference frame ([27][0][0][0] / 0x001B), none(left)): unspecified size&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; and &#x27;probesize&#x27; options&#xA;libav: AVFormatContext: Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels): unspecified sample format&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; and &#x27;probesize&#x27; options&#xA;libav: AVFormatContext: sample rate not set&#xA;libav: Unable to write header&#xA;libav: AVCodecContext: mmco: unref short failure&#xA;libav: AVCodecContext: number of reference frames (0&#x2B;5) exceeds max (4; probably corrupt input), discarding one&#xA;

    &#xA;

    Its always at the start of the stream and it can take several retries before the stream starts playing. Each retry involves generating a fresh link and starting a stream over in my flask app... so it can feel like a long wait if it doesn't decide to work on the first (or fifth !) attempt.

    &#xA;

    Is there any way to ensure the stream is presented in a way which even the fussiest client will be happy ?

    &#xA;