Recherche avancée

Médias (91)

Autres articles (20)

  • D’autres logiciels intéressants

    12 avril 2011, par

    On ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
    La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
    On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
    Videopress
    Site Internet : (...)

  • 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 (...)

  • 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" ;

Sur d’autres sites (4423)

  • FFMPEG Chapter Metadata added to a song file is sometimes off by 1 second

    6 février 2021, par Elthfa

    I attempted to add chapter metadata to a .opus file, but afterward, the file metadata showed timestamps different than the ones I attempted to add.
It seems to be adding an extra second to the timestamps under certain conditions.
I'm not sure if this is a bug, or if maybe I am just using the command wrong.

    


    Here are the commands I performed :

    


    First I removed all existing metadata from the file. I did this using a command I found on stack overflow :

    


    ffmpeg -i test_song.opus -c copy -map_metadata -1 -fflags +bitexact -flags:a +bitexact no_metadata.opus


    


    Then I added the new metadata from an external file I had written :

    


    ffmpeg -i no_metadata.opus -f ffmetadata -i metadata.txt -c copy -map_metadata 1 out.opus


    


    The file 'metadata.txt' looks like :

    


    ;FFMETADATA1
[CHAPTER]
TIMEBASE=1/1000
START=0
END=400
title=400 ms
[CHAPTER]
TIMEBASE=1/1000
START=400
END=500
title=100 ms
[CHAPTER]
TIMEBASE=1/1000
START=500
END=2000s
title=1500 ms
[CHAPTER]
TIMEBASE=1/1000
START=2000
END=97000
title=The Rest


    


    When I print out the basic data from the file, not all the timestamps shown match the ones I had in the metadata file.

    


    > ffmpeg -i out.opus
...
Input #0, ogg, from 'out.opus':
  Duration: 00:01:37.00, start: 0.000000, bitrate: 147 kb/s

    Chapter #0:0: start 0.000000, end 0.400000
    Metadata:
      title           : 400 ms

    Chapter #0:1: start 0.400000, end 1.500000
    Metadata:
      title           : 100 ms
    
    Chapter #0:2: start 1.500000, end 2.000000
    Metadata:
      title           : 1500 ms
    
    Chapter #0:3: start 2.000000, end 97.000000
    Metadata:
      title           : The Rest
...


    


    You can see the issues for chapters 0:1 and 0:2, which show a start and end time of 1.5 seconds respectively, when it should be 0.5 seconds for each.
I tried several combinations for this, and it seems that if the digit in the hundreds of milliseconds place is between 5 and 9 inclusive, it adds and extra second to the timestamp it saves in the metadata.

    


    Is this due to me using the command wrong ? Or formatting the metadata file wrong ? Or is there an issue in the code with rounding timestamps ?

    


    Thanks !

    


  • FFMPEG audio streaming to icecast lets media players stop after each song

    21 décembre 2020, par ILoveCake

    I have set up FFMPEG audio streaming to an icecast2 server.
It works, but when I use a loop to stream different songs, media players stop after each song. In detail :

    


    for i in 1 2 3
do
  ffmpeg -loglevel quiet -hide_banner -re -i test$i.mp3 \
  -c:a libvorbis -ac 1 -b:a 96K -content_type audio/webm -f webm \
  icecast://source:password@localhost:8000/stream
done


    


    Media players (vlc, mpv, mplayer) would stop after each of the 3 test files. I have to press play again and again. For icecast2 I use the default settings (queue-size 524288, burst-size 65535).

    


    How can I have a continuous flow so players don't have to be restarted ?

    


  • discord.py music bot can't play next song

    6 décembre 2020, par bork

    I'm making a discord music bot using ffmpeg and youtube-dl. I have a premade playlist of urls that would play the list of songs once a user chooses it.
    
this is my code for playing the audio

    


    ydl_opts = {
            'format': 'bestaudio', 
            'noplaylist':'True',
            'youtube_include_dash_manifest': False
            }
FFMPEG_OPTIONS = {
            'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
            'options': '-vn'
            }

songs = url[playlist]
dur_min = 0
pre_dur_sec = 0
with YoutubeDL(ydl_opts) as ydl:
    for i in songs:
        info = ydl.extract_info(i, download = False)
        dur = info['duration']
        playlist_songs.append(info)

playlist_songs_copy = playlist_songs.copy()
for i in playlist_songs_copy:
    info = playlist_songs.pop(0)
    URL = info['formats'][0]['url']
    player = FFmpegPCMAudio(URL, **FFMPEG_OPTIONS)
    q.append(player)
    q_playlist.append(playlist)

if not voice.is_playing():
    source = q.pop(0)  
    playlist = q_playlist.pop(0)
    dur_min = duration_min.pop(0)
    dur_sec = duration_sec.pop(0)  
    voice.play(source, after = lambda e: play_next(ctx, source))      
    voice.is_playing()
    await ctx.send(f'```nim\n*Now Playing:*\nplaylist {playlist}: {name[playlist]}\n\n{content[playlist]}\n\ntotal duration: {dur_min}:{dur_sec}```')


    


    and this is my code for playing the next song

    


    def play_next(ctx, source):
    voice = get(client.voice_clients, guild = ctx.guild)
    if len(q) >= 1:
        try:
            del combine_q[0]
            source = q.pop(0)
            playlist = q_playlist.pop(0)
            dur_min = duration_min.pop(0)
            dur_sec = duration_sec.pop(0)

        except:
            pass

        voice.play(source, after = lambda e: play_next(ctx, source))
        try:
            asyncio.run_coroutine_threadsafe(ctx.send(f'```nim\n*Now Playing:*\nplaylist {playlist}: {name[playlist]}\n\n{content[playlist]}\n\ntotal duration: {dur_min}:{dur_sec}```'), client.loop)
        
        except:
            asyncio.run_coroutine_threadsafe(ctx.send('```nim\nPlaying the next song...```'), client.loop)
        
    else:
        time.sleep(30) 
        if not voice.is_playing():
            asyncio.run_coroutine_threadsafe(voice.disconnect(), client.loop)
            asyncio.run_coroutine_threadsafe(ctx.send("```nim\nNo more songs in queue.```"),client.loop)
            voice.is_paused()


    


    Up till today, it's been working fine. But I was using the bot just now and instead of playing the song and sending the message "Playing the next song..." as usual, it just stopped and spammed the message for about 30 times before it disconnected. When I checked the logs, it showed
socket.send() raised exception
, which was also spammed in the terminal. When I tried making the bot reconnect, it joined my voice channel but didn't respond to any commands and would keep making the discord "connecting" noise. It wouldn't even leave with my .leave command unless I completely turned it off via the script.

    


    The same connecting problem would continue even after I reran the script and would only stop after I restarted my VS Code which is really odd...

    


    After some testing I found out that as of now, the bot is only able to play two songs before breaking. I really need help as this just happened randomly and I'm unable to find anything online about the problem.