Recherche avancée

Médias (1)

Mot : - Tags -/swfupload

Autres articles (111)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

Sur d’autres sites (13659)

  • C# - Discord.Net - Trying to read audio from soundcloud and transmit it to discord

    28 mars 2022, par Bruno Braga

    I am currently working on a discord bot that is able to play a song using soundcloud.
Unfortunately, I can't seem to figure out how to get it to read from the url and stream it !
The bot it made in C#, and uses Discord.net library and ffmpeg for the audio.
Would love to hear some suggestions !

    


    These are the three functions involved :

    


    [Command("teste", RunMode = RunMode.Async)]
public async Task Play(IVoiceChannel channel = null)
{
    var audioClient = await JoinChannel(channel);
    var url = "https://soundcloud.com/campatechlive/campatech-live-feat- 
        matheus-moussa-arabian-system-vol-2-psy-trance-150-original-mix";

    var ffmpeg = new Ffmpeg(audioClient);
    await ffmpeg.SendAsync(url);
}

public async Task SendAsync(string path)
{
    using (var ffmpeg = CreateStream(path))
    using (var output = ffmpeg.StandardOutput.BaseStream)
    using (var discord = _client.CreatePCMStream(AudioApplication.Mixed))
    {
        try { await output.CopyToAsync(discord); }
        finally { await discord.FlushAsync(); }
    }
}

private Process? CreateStream(string path)
{
    return Process.Start(new ProcessStartInfo
    {
        FileName = "ffmpeg",
        Arguments = $"-hide_banner -loglevel panic -i \"{path}\" -ac 2 -f 
        s16le -ar 48000 pipe:1",
        UseShellExecute = false,
        RedirectStandardOutput = true,
    });
}


    


    I'm guessing it's something on the ffmpeg arguments, but can't kind of figure out what.

    


    I've tried a bunch of different arguments on ffmpeg, but none of them worked.
Anyone can lend me a hand ?

    


  • Unknown issue with Discord.js and ytdl, completely skips playing audio

    21 novembre 2017, par Gman0064

    One of the commands I have for my Discord bot is to play a predefined music clip in the current user’s voice channel. The bot can connect, but rather than playing the song, it instantaneously leaves. I’ve tried using both connection.playStream as well as connection.playFile, and both seem to return the same (lack of) output. Am I missing some sort of dependency or is my code just written incorrectly ? Any help would be greatly appreciated !

    const Discord = require('discord.js');
    const ytdl = require('ytdl-core');
    const client = new Discord.Client();
    const streamOptions = { seek: 0, volume: 1};

    client.on('ready', () => {
     console.log('Login Success');
    });

    client.on('message', message => {
     if (message.content === '$vaporwave') {
       if (!message.guild) return;
       if(message.member.voiceChannel) {
         message.member.voiceChannel.join().then(connection => {
           console.log("joined channel");
           //const stream = ytdl('https://www.youtube.com/watch?v=cU8HrO7XuiE', { filter : 'audioonly' });
           const dispatcher = connection.playFile('./mcp420.mp3');
           //const dispatcher = connection.playStream(stream, streamOptions);
           dispatcher.on("end", end => {
             console.log("left channel");
             message.member.voiceChannel.leave();
           });
         }).catch(err => console.log(err));
       }
     }
    });
    • NPM v4.6.1
    • Node.js v8.9.1
    • FFMPEG v3.2.8-1
  • 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;