Recherche avancée

Médias (91)

Autres articles (89)

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

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

Sur d’autres sites (11638)

  • Discord bot cannot play youtube video for more than 60sec

    18 octobre 2020, par Antoine Weber

    A few weeks back I started a discord bot as a side project for fun.
Since yesterday i've been trying to allow my bot to search youtube videos and play them in voice channels (mostly for songs).

    


    The bot correctly searches youtube with the query and finds the youtube video, starts playing it, but for some reason, after 60 sec (no matter of the video, always the same time), the bot suddenly provides no more audio, and then gets stuck somewhere (not a single error message, but the bots just stops responding).

    


    Here are the code snippets :

    


    # first two words are activation keywords for the bot, then its the youtube query
query = ' '.join(message.message.content.split()[2:])
youtube = build("youtube", "v3", developerKey=yt_token)
search_response = youtube.search().list(q=query, part="id,snippet", maxResults=5).execute()
video_id = search_response['items'][0]['id']['videoId']
video_url = "https://www.youtube.com/watch?v=" + video_id

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
     ydl.download([video_url])
await play_audio(message, 'song.mp3')


    


    (I delete the song.mp3 after playing)

    


    my ydl options are

    


    ydl_opts = {
    "postprocessors":[{
        "key": "FFmpegExtractAudio", # download audio only
        "preferredcodec": "mp3", # other acceptable types "wav" etc.
        "preferredquality": "192" # 192kbps audio
    }],
    "format": "bestaudio/best",
    "outtmpl": "song.mp3"
}


    


    and also my play_audio function is

    


    async def play_audio(message, audio_name):
        channel = message.message.author.voice.channel
        vc = await channel.connect()
        time.sleep(0.5)
        vc.play(discord.FFmpegPCMAudio(audio_name))
        while vc.is_playing():
            time.sleep(1)
        vc.stop()
        await vc.disconnect()


    


    I know the time.sleep() call is blocking but I don't really core for now.

    


    Any one had this issue ? For short videos (less than 60sec), everything works fine. Maybe an ffmpeg option ?

    


  • Autogenerate HTML5 tags from YouTube-DL

    13 novembre 2015, par Terence Eden

    I’m using youtube-dl to download videos I’ve stored on YouTube. It gives me the ability to download various formats, thumbnails, and subtitles.

    Is there any way I can automatically generate an HTML5 <video></video> snippet from the downloaded files ?

    For example, I’d like the end result to be .txt file containing :

    <video poster="file-160.jpg">
      <source src="file-135.mp4" type="video/mp4; codecs=mp4a.40.2, avc1.42001E">
      <source src="file-43.webm" type="video/webm; codecs=vorbis, vp8.0">
      ...
      <track kind="subtitles" src="file-160.en.srt">
    </track></source></source></video>

    At the moment, I have a file list like :

    • file-135.mp4
    • file-18.mp4
    • file-134.mp4
    • file-160.mp4
    • file-43.webm
    • file-5.flv
    • file-36.3gp
    • file-17.3gp
    • file-160.jpg
    • file-160.en.srt

    I can run some Python/Ruby/bash over them to generate the <source src="..."></source>code>, but the problem is, I don't know what codecs each of those videos are, so I can't generate the <code>; codecs= portion.

    Using avconv or ffmpeg I can get the codecs, but not in a suitable format for embedding into HTML.

    I’m wary of asking "what tool should I use" - but is there any way to get avconv/ffmpeg/youtube-dl to spit out the codec information in a format I can put into an HTML5 tag ?

    Or, is there a way to get YouTube-DL only to spit out HTML5 compatible files with known codecs ?

  • How to pass a youtube video's audio url as ffmpeg source

    8 janvier 2020, par CrystallVR

    Im trying to get my discord bot to play the audio from any youtube videos using the video’s url from youtube-dl (the audio url) as the ffmpeg path/source. I got it to work kind of but, while testing, the ffmpeg throws an error in the middle of the audio and the process ends. Here is the error :
    https://i.imgur.com/uCy8SfK.png

    I’ve tried to play the same exact song by downloading it and using the file’s path as ffmpeg source path and it worked fine.

    Here is how i start the ffmpeg process :

               return Process.Start(new ProcessStartInfo
               {
                   FileName = "ffmpeg.exe",
                   Arguments = $"-xerror -i \"{path}\" -ac 2 -f s16le -ar 48000 pipe:1",
                   UseShellExecute = false,
                   RedirectStandardOutput = true
               });

    path is the audio url from youtube-dl process. (can also see the url in the error screenshot)

    And here is how i get the link from youtube-dl :

    Process youtubedl;


                   ProcessStartInfo youtubedlGetTitle = new ProcessStartInfo()
                   {
                       FileName = "youtube-dl",
                       Arguments = $"--get-title --get-duration --get-url {url}",
                       CreateNoWindow = true,
                       RedirectStandardOutput = true,
                       UseShellExecute = false
                   };
                   youtubedl = Process.Start(youtubedlGetTitle);
                   youtubedl.WaitForExit();

    url is a normal youtube video link.

    I just started working with ffmpeg and youtube-dl so there probably are some stupid rookie mistakes that i’m not aware of. I would appreciate any guidance and/or explanation of what I did wrong.