Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (110)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (8538)

  • Decode opus audio using ffmpeg lib not giving proper audio

    31 octobre 2018, par Harshpal Gosavi

    This is my code in this code all data is printing correct and there is no error but its not playing correctly. I am getting audio like radio voice. Human voice is not audible as it is continuosly playing radio like sound. I am not sure whether all values are correct or not. But if I change it then it wont work. Please help me how can I get proper audio voice.

    Opus.cpp

    {   void Opus::Decode1_working(int8_t *inBuf, int inLen , int16_t *outBuf, int *decodedLen)
    {


    AVPacket avpkt;
    AVFrame *decoded_frame = NULL;

    av_init_packet(&avpkt);
    avpkt.data = (uint8_t*)inBuf;
    avpkt.size = inLen;


    decoded_frame = av_frame_alloc();
    av_frame_unref(decoded_frame);
    int len = avcodec_send_packet(c, &avpkt);
    if (len < 0)
    {
         //Error
         return;
    }
    else
    {
        int retval = avcodec_receive_frame(c, decoded_frame);
        if(retval >= 0)
        {
            const AVCodecDescriptor *codesc = avcodec_descriptor_get(c->codec_id);

            int planeSize;
            int data_size = av_samples_get_buffer_size
                            (&planeSize,
                             c->channels,
                             decoded_frame->nb_samples,
                             c->sample_fmt,
                             1);

            if(data_size < AUDIO_MAXBUF_SIZE)
            {
                memcpy(outBuf, decoded_frame->data[0], (data_size));// * sizeof(uint8_t)));
                *decodedLen = data_size;
            }
            else
            {
               //Not copied
           }

        }

    }
    av_frame_free(&decoded_frame);
    }

    int Opus::init(void *args) {

    i_sampleRate = 0;
    i_channels = 0;

    avcodec_register_all();
    codec = avcodec_find_decoder(AV_CODEC_ID_OPUS);
    if(codec ==NULL)
    {
       //Codec not open
    }

    c= avcodec_alloc_context3(codec);

    c->sample_rate = 48000;
    c->channels = 1;
    c->bit_rate = 48000;


       av_opt_set_int(c, "refcounted_frames", 1, 0);
       int codecOpen = 0;
        codecOpen = avcodec_open2(c, codec,NULL);//,&audioOptionsDict) ;
        if (codecOpen < 0)
        {
            //return error;
        }

    return 0;
    }

    int Opus::decode(Packet *packet) {

    int8_t *data = new int8_t[packet->size];
    memcpy(data, packet->data, (packet->size * sizeof(int8_t)));

    long length = packet->size;

    int16_t *pcmdata = new int16_t[AUDIO_MAXBUF_SIZE];//[outLen];

    i_sampleRate = 48000;
    i_channels = 1;

    int decodedLen = 0;
    Decode1_working(data,length,pcmdata, &decodedLen);

    if (p_callback)
    {
       ++i_framesDecoded;
       p_callback->AfterAudioDecode((u8*)pcmdata,
                                    //length * sizeof(u8),
                                     decodedLen,//* sizeof(u8),
                                    packet->pts);
    }
    return 1;
    }

    }
  • How do I add a queue to my music bot using Discrod.py FFmpeg and youtube_dl ?

    28 septembre 2022, par Виктор Лисичкин

    I'm writing my bot for discord, I can't figure out how to track the end of a song to lose the next one. I sort of figured out the piece of music, but I don't fully understand what to do next. Here is my code for main.py

    


    from discord.ext import commands, tasks
from config import settings
from music_cog import music_cog
bot = commands.Bot(command_prefix='!',intents = discord.Intents.all())

@bot.event
async def on_ready():
    print(f'We have logged in as {bot.user}')
    await bot.add_cog(music_cog(bot))

bot.run(settings['token'])


    


    and And this is for cog with music

    


    from discord.ext import commands
from youtube_dl import YoutubeDL
YDL_OPTIONS = {'format': 'worstaudio/best', 'noplaylist': 'False', 'simulate': 'True',
               'preferredquality': '192', 'preferredcodec': 'mp3', 'key': 'FFmpegExtractAudio'}
FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
queue = []
class music_cog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
    @commands.command(pass_context=True)
    async def play(self,ctx, *, arg):
        global queue
        queue.append(arg)
        def playing():
            for song in queue:
                with YoutubeDL(YDL_OPTIONS) as ydl:
                    if 'https://' in song:
                        info = ydl.extract_info(song, download=False)
                    else:
                        info = ydl.extract_info(f"ytsearch:{song}", download=False)['entries'][0]

                    url = info['formats'][0]['url']
                    queue.pop(0)
                    vc.play(discord.FFmpegPCMAudio(executable="ffmpeg", source=url, **FFMPEG_OPTIONS))
        voice_client = discord.utils.get(self.bot.voice_clients, guild=ctx.guild)
        if not ctx.message.author.voice:
            await ctx.send("You are not connected to voice chanel")
        elif voice_client:
            queue.append(arg)
        else:
            vc = await ctx.message.author.voice.channel.connect()
            playing()
    @commands.command(pass_context = True)
    async def disconect(self, ctx):
        server = ctx.message.guild.voice_client
        if ctx.message.guild.voice_client:
            await server.disconnect()
        else:
            await ctx.send("I am not connected")

    @commands.command(pass_context=True)
    async def stop(self, ctx):
        server = ctx.message.guild
        voice_channel = server.voice_client
        voice_channel.pause()

    @commands.command(pass_context=True)
    async def resumue(self, ctx):
        server = ctx.message.guild
        voice_channel = server.voice_client
        voice_channel.resume()


    


  • Change Audio Pitch with Audio Speed Ffmpeg

    22 juin 2021, par Vivek Thummar

    i'm using Ffmpeg to change Audio Pitch and Speed and here's some command i'm trying :

    


      

    1. ffmpeg -i audioPath -filter:a atempo=audioSpeed,asetrate=audioPitch -ar sampleRate -b:a xValue(k) output.mp3

      


    2. 


    3. ffmpeg -i audioPath -filter:a atempo=(audioSpeed / audioPitch),asetrate=(sampleRate * audioPitch),aresample=sampleRate

      


    4. 


    


    and i tried some more commands also with little bit of changes.

    


    (here audioSpeed and audioPitch are in range of 0.5 to 2.0, sampleRate is between 8000 to 48000 and bitRate is between range of 96k to 320k)

    


    Now let's talk about the problem, if we only use atempo, it will change audio speed and if we use asetrate, it will change audio pitch along with speed and looks like it will ignore audioPitch value if we do something like - samplerate * audioPitch (if i use sampleRate = 8000 audio speed will decrease with thick voice and if sampleRate = 48000 audio speed will increase with thin voice(with means audioPitch will adjust according to sampleRate, as of i experienced from output audios))

    


    What i want is if i change audioSpeed to 0.5 and audioPitch to 2.0, then in output file speed will decrease and pitch will be also applied plus i have to change frequency(sample rate) and bitrate..

    


    Any help will be appreciated, Thank you..