Recherche avancée

Médias (0)

Mot : - Tags -/serveur

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

Autres articles (16)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

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

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

Sur d’autres sites (3994)

  • Is there a way to use youtube-dl in async

    8 octobre 2024, par Stam Kaly

    I have an application where I use zmq with asyncio to communicate with the clients who have the ability to download a video with youtube-dl to the server. I tried adding await to youtube_dl's download function but it gave me an error since it was not a coroutine. My code right now is simply looking like this :

    



    import asyncio
import youtube_dl


async def networking_stuff():
    download = True
    while True:
        if download:
            print("Received a request for download")
            await youtube_to_mp3("https://www.youtube.com/watch?v=u9WgtlgGAgs")
            download = False
        print("Working..")
        await asyncio.sleep(2)


async def youtube_to_mp3(url):
    ydl_opts = {
        'format': 'bestaudio/best',
        'postprocessors': [{
            'key': 'FFmpegExtractAudio',
            'preferredcodec': 'mp3',
            'preferredquality': '192',
        }]
    }

    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
        ydl.download([url])


loop = asyncio.get_event_loop()
loop.create_task(networking_stuff())
loop.run_forever()


    



    which gives the following output :

    



    Received a request for download
[youtube] u9WgtlgGAgs: Downloading webpage
[youtube] u9WgtlgGAgs: Downloading video info webpage
[youtube] u9WgtlgGAgs: Extracting video information
[youtube] u9WgtlgGAgs: Downloading MPD manifest
[download] Destination: The Cardigans - My Favourite Game “Stone Version”-u9WgtlgGAgs.webm
[download] 100% of 4.20MiB in 00:03
[ffmpeg] Destination: The Cardigans - My Favourite Game “Stone Version”-u9WgtlgGAgs.mp3
Deleting original file The Cardigans - My Favourite Game “Stone Version”-u9WgtlgGAgs.webm (pass -k to keep)
Working..
Working..
....
Working..
Working..


    



    whereas I would expect the Working.. message to be printed in between youtube-dl's messages as well. Am I missing something here or is this impossible with async/await ? Is ffmpeg blocking ? If so, can I run the download in async without converting to mp3 or is using threads the only way ?

    


  • ffmpeg settings for high quality youtube videos [migrated]

    1er avril 2018, par pb.

    I am trying to record short video of my desktop and upload it to youtube.
    The problem is that every time when I upload it to youtube or even dropbox (as video), the quality is much worse.

    My ffmpeg execution :

    ffmpeg -f x11grab -s 1366x768 -r 30 -i :0.0 -codec:v libx264 -crf 10 -bf 20 -flags +cgop -pix_fmt yuv440p -movflags faststart help.mp4

    based on :

    ffmpeg -i <input file="file" /> -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart .mp4

    which I found here

    Original file (.zip) :
    https://www.dropbox.com/s/xlkr83rkqfxon23/help.mp4.zip?dl=0

    File after upload to youtube :
    https://www.youtube.com/watch?v=ewEUgpXOpmg

    As you can see, I loss quality after upload to youtube.

    Could you help me ?
    How should I choose the appropriate parameters to record and upload high quality video ?

  • ffmpeg settings for high quality youtube videos [migrated]

    1er avril 2018, par pb.

    I am trying to record short video of my desktop and upload it to youtube.
    The problem is that every time when I upload it to youtube or even dropbox (as video), the quality is much worse.

    My ffmpeg execution :

    ffmpeg -f x11grab -s 1366x768 -r 30 -i :0.0 -codec:v libx264 -crf 10 -bf 20 -flags +cgop -pix_fmt yuv440p -movflags faststart help.mp4

    based on :

    ffmpeg -i <input file="file" /> -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart .mp4

    which I found here

    Original file (.zip) :
    https://www.dropbox.com/s/xlkr83rkqfxon23/help.mp4.zip?dl=0

    File after upload to youtube :
    https://www.youtube.com/watch?v=ewEUgpXOpmg

    As you can see, I loss quality after upload to youtube.

    Could you help me ?
    How should I choose the appropriate parameters to record and upload high quality video ?