Recherche avancée

Médias (0)

Mot : - Tags -/content

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

Autres articles (39)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

Sur d’autres sites (5720)

  • RTSP to HLS conversion with error on some devices

    2 septembre 2024, par Wallace Ketler

    I'm trying to convert, on a node server, RTSP IP camera devices to HLS to run livestreams on the web. The following code works well for some RTSP devices, but for others I encounter problems.

    


       function startLive(rtspUrl, outputDir, id_local, id_camera) {
        return new Promise((resolve, reject) => {
            const processKey = `${id_local}_${id_camera}`;
            if (ffmpegProcesses[processKey]) {
                return reject(new Error('Conversão já está em andamento para esta câmera'));
            }
        
            const process = ffmpeg(rtspUrl)
                .inputOptions([
                    '-rtsp_transport', 'tcp',
                    '-fflags', 'nobuffer',
                    '-max_delay', '1000000',
                    '-analyzeduration', '1000000',
                    '-probesize', '1000000',
                    '-flush_packets', '1',
                    '-avioflags', 'direct'
                ])
                .outputOptions([
                    '-c:v', 'libx264',
                    '-preset', 'ultrafast',
                    '-tune', 'zerolatency',
                    '-c:a', 'aac',
                    '-hls_time', '10',
                    '-hls_flags', 'delete_segments',
                    '-hls_list_size', '5',
                    '-hls_wrap', '5',
                    '-strict', '-2'
                ])
                .output(path.join(outputDir, 'stream.m3u8'))
                .on('start', (commandLine) => {
                    console.log('Spawned FFmpeg with command: ' + commandLine);
                })
                .on('stderr', (stderrLine) => {
                    console.log('FFmpeg stderr: ' + stderrLine);
                })
                .on('end', () => {
                    console.log('Conversão concluída');
                    delete ffmpegProcesses[processKey]; 
                    resolve();
                })
                .on('error', (err, stdout, stderr) => {
                    console.error('Erro na conversão', err);
                    console.error('FFmpeg stdout:', stdout);
                    console.error('FFmpeg stderr:', stderr);
                    delete ffmpegProcesses[processKey]; 
                    reject(err);
                })
                .run();
    
            ffmpegProcesses[processKey] = process; 
        });
    }


    


    When the conversion succeeds, it continues indefinitely with the logs :

    


    FFmpeg stderr: frame=   61 fps= 48 q=13.0 size=N/A time=00:00:02.03 bitrate=N/A dup=60 drop=0 speed= 1.6x    
FFmpeg stderr: frame=   75 fps= 42 q=17.0 size=N/A time=00:00:02.52 bitrate=N/A dup=62 drop=0 speed=1.41x    
FFmpeg stderr: frame=   91 fps= 39 q=16.0 size=N/A time=00:00:03.04 bitrate=N/A dup=65 drop=0 speed=1.31x    
FFmpeg stderr: frame=  108 fps= 38 q=15.0 size=N/A time=00:00:03.60 bitrate=N/A dup=68 drop=0 speed=1.27x    
FFmpeg stderr: frame=  121 fps= 36 q=24.0 size=N/A time=00:00:04.03 bitrate=N/A dup=70 drop=0 speed=1.21x    
FFmpeg stderr: frame=  138 fps= 36 q=16.0 size=N/A time=00:00:04.60 bitrate=N/A dup=73 drop=0 speed= 1.2x    
FFmpeg stderr: frame=  152 fps= 35 q=17.0 size=N/A time=00:00:05.08 bitrate=N/A dup=75 drop=0 speed=1.17x    
FFmpeg stderr: frame=  168 fps= 35 q=16.0 size=N/A time=00:00:05.60 bitrate=N/A dup=78 drop=0 speed=1.15x    
FFmpeg stderr: frame=  183 fps= 34 q=21.0 size=N/A time=00:00:06.11 bitrate=N/A dup=80 drop=0 speed=1.13x    
FFmpeg stderr: frame=  198 fps= 34 q=16.0 size=N/A time=00:00:06.60 bitrate=N/A dup=83 drop=0 speed=1.12x    
FFmpeg stderr: frame=  215 fps= 33 q=16.0 size=N/A time=00:00:07.16 bitrate=N/A dup=86 drop=0 speed=1.11x    
FFmpeg stderr: frame=  230 fps= 33 q=16.0 size=N/A time=00:00:07.66 bitrate=N/A dup=88 drop=0 speed= 1.1x    
FFmpeg stderr: frame=  246 fps= 33 q=19.0 size=N/A time=00:00:08.20 bitrate=N/A dup=91 drop=0 speed= 1.1x    


    


    And with the segments saved in the folder configured as output. But for certain devices, after creating the stream.m3u8 file and saving the first segment, the conversion is considered finished and falls into .on('end') . The error log is as follows :

    


    FFmpeg stderr: frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:01.12 bitrate=N/A speed=2.08x    
FFmpeg stderr: [hls @ 0x55e00dfc4380] Opening 'my_path/stream0.ts' for writing
FFmpeg stderr: [hls @ 0x55e00dfc4380] Opening 'my_path/stream.m3u8.tmp' for writing
FFmpeg stderr: frame=    0 fps=0.0 q=0.0 Lsize=N/A time=00:00:01.37 bitrate=N/A speed= 2.5x    
FFmpeg stderr: video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
FFmpeg stderr: [aac @ 0x55e00dfff840] Qavg: 65536.000
FFmpeg stderr: 
Conversão concluída


    


    The muxing overhead: unknown only appears when the error occurs and the conversion is complete.

    


    I've already tried changing the video and audio encoders, as well as the various input and output parameters of the conversion. I also tried updating ffmpeg (it's already on the latest version, using fluent-ffmpeg, "fluent-ffmpeg": "^2.1.3",)

    


    I would like to understand why this happens on some devices and how to fix it. Thanks.

    


  • Remove audio from specific audio track

    9 août 2024, par Ronaldo Júdice

    I have this code, and i would like to remove audio from tracks 5 and 6. I had tried everything but is not working, I can mute the audio tracks but on edition program i can see the waves, can you help me ?

    


    if (conv.format === 'mxf') {
        // Add 8 audio tracks
        ffmpeg(inputFile)
            .audioCodec('pcm_s16le') // Codec de áudio para MXF
            .outputOptions([
                '-c:v mpeg2video', // Codec de vídeo para MXF
                '-q:v 2', // Qa  vídeo
                '-map 0:v:0', 
                '-map 0:a:0', 
                '-map 0:a:0',
                '-map 0:a:0', 
                '-map 0:a:0', 
                '-map 0:a:0', // this track i want to remove the audio but keep the track
                '-map 0:a:0', //this track i want to remove the audio but keep the track
                '-map 0:a:0', 
                '-map 0:a:0', 
                '-disposition:a:0 default' // Marcar trilha 1 como padrão
            ])
            .save(outputFile)
            .on('start', commandLine => console.log(`FFmpeg comando iniciado: ${commandLine}`))
            .on('progress', progress => console.log(`Progresso: ${progress.percent}%`))
            .on('end', () => console.log(`Conversão concluída: ${outputFile}`))
            .on('error', err => console.error(`Erro na conversão de ${inputFile} para ${outputFile}: ${err.message}`));
    } else {
        // Outras conversões
        ffmpeg(inputFile)
            .outputOptions(conv.options)
            .save(outputFile)
            .on('start', commandLine => console.log(`FFmpeg comando iniciado: ${commandLine}`))
            .on('progress', progress => console.log(`Progresso: ${progress.percent}%`))
            .on('end', () => console.log(`Conversão concluída: ${outputFile}`))
            .on('error', err => console.error(`Erro na conversão de ${inputFile} para ${outputFile}: ${err.message}`));
    }


    


    I tried to use ffmpeg comands to remove audio from track.

    


  • Command raised an exception : NameError : name 'player' is not defined

    20 mars 2023, par baartys

    I finally got myself a hosting for my project, but got into an error and I don't know how to resolve it.
I ran command !play to start streaming in vc, but I got this error :

    


    2023-03-19 18:36:04 INFO     discord.client logging in using static token
2023-03-19 18:36:04 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: f983009c9f2881b87ee119278692efc9).
Eurobeat Radio is running!
2023-03-19 18:36:10 ERROR    discord.ext.commands.bot Ignoring exception in command play
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 229, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/container/radio.py", line 44, in play
    player.play(FFmpegPCMAudio('http://stream.eurobeat.xyz'))
NameError: name 'player' is not defined
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
    await ctx.command.invoke(ctx)
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 1023, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 238, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'player' is not defined


    


    I tried running it on my pc and that was without error, but once it was on the hosting it ran in to the error up the page.

    


    Here is the code :

    


    import discord
import urllib.request, json 
from discord import FFmpegPCMAudio
from discord.ext import commands
from discord.ext import tasks
client= commands.Bot(command_prefix="er!", intents=discord.Intents.all(), help_command=None)

@tasks.loop(seconds=10.0)
async def my_background_task():
    """Will loop every 60 seconds and change the bots presence"""
    with urllib.request.urlopen('https://api.laut.fm/station/eurobeat/current_song') as url:
        data = json.load(url)
        global namestatus
        global artiststatus
        namestatus = data['title']
        artiststatus = data['artist']['name']
    await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="Eurobeat FM"))
    await client.change_presence(activity=discord.Game(name="Para para dancing ~"))
    await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name=f"{namestatus} by {artiststatus}"))


@client.event
async def on_ready():
    print('Eurobeat Radio is running!')
    await client.wait_until_ready()
    my_background_task.start()


@client.event
async def on_voice_state_update(member, prev, cur):
    if client.user in prev.channel.members and len([m for m in prev.channel.members if not m.bot]) == 0:
        channel = discord.utils.get(client.voice_clients, channel=prev.channel)
        await channel.disconnect()

@client.command(aliases=['p', 'pla', 'join', 'j'])
async def play(ctx, url: str = 'http://stream.eurobeat.xyz'): 
    channel = ctx.message.author.voice.channel
    global player
    try:
        player = await channel.connect()
    except:
        pass
    player.play(FFmpegPCMAudio('http://stream.eurobeat.xyz'))
    embedVar = discord.Embed(title="Started Playing!", color=discord.Color.random())
    await ctx.send(embed=embedVar)


    


    Would be very grateful for your help !