Recherche avancée

Médias (0)

Mot : - Tags -/configuration

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

Autres articles (63)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Les images

    15 mai 2013

Sur d’autres sites (6452)

  • 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 ?

  • 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.&#xA;Since yesterday i've been trying to allow my bot to search youtube videos and play them in voice channels (mostly for songs).

    &#xA;

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

    &#xA;

    Here are the code snippets :

    &#xA;

    # first two words are activation keywords for the bot, then its the youtube query&#xA;query = &#x27; &#x27;.join(message.message.content.split()[2:])&#xA;youtube = build("youtube", "v3", developerKey=yt_token)&#xA;search_response = youtube.search().list(q=query, part="id,snippet", maxResults=5).execute()&#xA;video_id = search_response[&#x27;items&#x27;][0][&#x27;id&#x27;][&#x27;videoId&#x27;]&#xA;video_url = "https://www.youtube.com/watch?v=" &#x2B; video_id&#xA;&#xA;with youtube_dl.YoutubeDL(ydl_opts) as ydl:&#xA;     ydl.download([video_url])&#xA;await play_audio(message, &#x27;song.mp3&#x27;)&#xA;

    &#xA;

    (I delete the song.mp3 after playing)

    &#xA;

    my ydl options are

    &#xA;

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

    &#xA;

    and also my play_audio function is

    &#xA;

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

    &#xA;

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

    &#xA;

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

    &#xA;

  • Converting youtube videos to mp3 in golang using a ffmpeg binary

    19 août 2015, par Bera

    With golang it’s possible to extract a mp3 file from a given youtube video url ?

    Is needed to download a video in mp4 format and then extract the audio in the mp3 format.

    Would be better to use a lib like youtube-dl to download the video in mp4 and after invoke a ffmpeg binary to extract the audio or there is a easy way using only go libraries or binds ?

    thanks for your help.