Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (78)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • 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

Sur d’autres sites (8418)

  • ffmpeg taking too much time to compress videos in a nest Js project [closed]

    30 août 2023, par Sheeraz

    I am trying to read a video as a stream from firebase and compress it using ffmpeg an it is too much time for the job to complete such that my call breaks before its done and I am getting socket hangup error. I have tried to increase the timeout of the call to 540s but it is still not enought for the job to be done. The framework I am using is nestJs with react as front-end. This is a web-app and the feature I am working on is a video recording functionality.

    


    Here is the code I am trying to run. The library I am using is "fluent-ffmpeg" : "^2.1.2", and
"ffmpeg" : "^0.0.4",

    


    const bucket = storage.bucket('my-bucket.appspot.com');
      const filePath = 'videos/video.mp4'; // Replace with the full path to your file
      const videoFile = bucket.file(filePath);
      const readStream = videoFile.createReadStream();
const ffmpegCommand = ffmpeg();
      ffmpegCommand.input(readStream);
      ffmpegCommand
        .outputOptions([
          '-preset ultrafast',
          '-c:v libx264',
          '-c:a aac',
          '-vf scale=640:480',
        ])
        .format('wav');
const outputStream = await ffmpegCommand.pipe();


    


  • Why does the PyAV-encoded video have a different total time in seconds than the original file

    13 octobre 2023, par Diego Medeiros

    I'm taking a mp4 file, decoding it frame by frame and reencoding it. I'm using PyAV and the reencoding is running on h265.
When the code is running, it seems that all frames are passed from the decoder to the encoder, but at the end I have a file with 3 seconds less. For longer videos I'll have bigger differences.

    


    I have already checked the fps, it comes out with a very small variation, even if I use the Fraction type to avoid decimal differences.

    


    I'd like to know if it's some parametrization error, or if this is something to do with the encoder itself like keyframes and all those sort of things. Is there a way to fix it ?

    


    import av


container = av.open('input.mp4')

# create an output container to receive the transcoded video packets
output_container = av.open('output.mp4', 'w', format='mp4')
# add a stream to output container with same fps as input and h265 codec
output_stream = output_container.add_stream(
    'libx265', rate=container.streams.video[0].average_rate)
# set the output stream size
output_stream.width = 640
output_stream.height = 480

print('Starting transcoding...')

actual_frame = 0
container_total_frames = container.streams.video[0].frames

# start decoding packets and reading frames from the container
try:
    for packet_input in container.demux():
        if packet_input.dts is None:
            break
        for frame in packet_input.decode():

            try:
                actual_frame += 1
                # convert the frame to a numpy array
                img = frame.to_ndarray(format='bgr24')

                # prepare the ndarray frame and encode it
                frame_nd = av.VideoFrame.from_ndarray(img, format='bgr24')
                packet_output = output_stream.encode(frame_nd)
                output_container.mux(packet_output)
                print('Frame: {}/{}'.format(actual_frame, container_total_frames))
            except Exception as e:
                print("Error writing frame: ", e)
                break
except Exception as e:
    print('Finished transcoding')

output_container.close()

print('Finished transcoding')



    


  • I need my music bot to play on multiple servers at the same time

    12 mars 2024, par Ondosh

    I'm writing my music bot in Python and I want it to be able to play music on multiple servers at once. Now the attempt to play on several servers looks like this : I start music on the first server, go to the second and start other music there, but the one that was requested on the first one is playing.
Know my code is :

    


    from nextcord.ext import commands
import nextcord, random
import yt_dlp
import datetime
import lazy_queue as lq

FFMPEG_OPTIONS = {
    "before_options": "-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5",
    'options': '-vn'}

YDL_OPTIONS = {
    'format': 'bestaudio/best',
    'extractaudio': True,
    'noplaylist': True,
    'keepvideo': False,
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '320'
    }]
}

bot.remove_command("help")
songs_queue = lq.Queue()
loop_flag = False

@bot.command()
async def add(ctx, *url):
    url = ' '.join(url)
    with yt_dlp.YoutubeDL(YDL_OPTIONS) as ydl:
        try:
            info = ydl.extract_info(url, download=False)
        except:
            info = ydl.extract_info(f"ytsearch:{url}",
                                    download=False)['entries'][0]
    URL = info['url']
    name = info['title']
    time = str(datetime.timedelta(seconds=info['duration']))
    songs_queue.q_add([name, time, URL])
    embed = nextcord.Embed(description=f'Записываю [{name}]({url}) в очередь 📝',
                           colour=nextcord.Colour.red())
    await ctx.message.reply(embed=embed)


def step_and_remove(voice_client):
    if loop_flag:
        songs_queue.q_add(songs_queue.get_value()[0])
    songs_queue.q_remove()
    audio_player_task(voice_client)


def audio_player_task(voice_client):
    if not voice_client.is_playing() and songs_queue.get_value():
        voice_client.play(nextcord.FFmpegPCMAudio(
            executable="ffmpeg\\bin\\ffmpeg.exe",
            source=songs_queue.get_value()[0][2],
            **FFMPEG_OPTIONS),
            after=lambda e: step_and_remove(voice_client))


@bot.command()
async def play(ctx, *url):
    await join(ctx)
    await add(ctx, ' '.join(url))
    await ctx.message.add_reaction(emoji='🎸')
    voice_client = ctx.guild.voice_client
    audio_player_task(voice_client)
async def queue(ctx):
    if len(songs_queue.get_value()) > 0:
        only_names_and_time_queue = []
        for i in songs_queue.get_value():
            name = i[0]
            if len(i[0]) > 30:
                name = i[0][:30] + '...'
            only_names_and_time_queue.append(f'📀 `{name:<33}   {i[1]:>20}`\n')
        c = 0
        queue_of_queues = []
        while c < len(only_names_and_time_queue):
            queue_of_queues.append(only_names_and_time_queue[c:c + 10])
            c += 10
        embed = nextcord.Embed(title=f'ОЧЕРЕДЬ [LOOP: {loop_flag}]',
                               description=''.join(queue_of_queues[0]),
                               colour=nextcord.Colour.red())
        await ctx.send(embed=embed)
        for i in range(1, len(queue_of_queues)):
            embed = nextcord.Embed(description=''.join(queue_of_queues[i]),
                                   colour=nextcord.Colour.red())
            await ctx.send(embed=embed)
    else:
        await ctx.send('Очередь пуста')


    


    As far as I understand, I need to create variables that will be associated with the server ID, but I do not know how to do this.