Recherche avancée

Médias (1)

Mot : - Tags -/net art

Autres articles (81)

  • Diogene : création de masques spécifiques de formulaires d’édition de contenus

    26 octobre 2010, par

    Diogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
    A quoi sert ce plugin
    Création de masques de formulaires
    Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
    Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)

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

  • Utilisation et configuration du script

    19 janvier 2011, par

    Informations spécifiques à la distribution Debian
    Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
    Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
    Récupération du script
    Le script d’installation peut être récupéré de deux manières différentes.
    Via svn en utilisant la commande pour récupérer le code source à jour :
    svn co (...)

Sur d’autres sites (8305)

  • Is there any fast methods to download blob video other than ffmpeg ?

    4 juillet 2021, par InVinCiblezz

    I knew we can use

    


    ffmpeg -i 'xxxxx.m3u8' xxx.mp4


    


    to download and format the video.
But it seems pretty slow.
Is there any fast method ?
Thanks a lot !

    


  • Trouble downloading a youtube playlist and converting to mp4 with audio/video

    15 mars 2024, par Patrick Coogan

    I am having difficulty with a side project I am working on. The goal of the program is to be able to do a few functions with a youtube video or playlist link.

    


      

    1. download a youtube video and audio and merge them.
    2. 


    3. download a youtube playlist's video and audio and merge them.
    4. 


    5. download a youtube video's audio only.
    6. 


    7. download a youtube playlist's audio only.
    8. 


    


    My main issues arise with the 2. function, downloading a playlist with video and audio and merging them. The program is able to complete function 1 successfully (download a video and audio and merge to one file), and function 3 successfully (download video and output just audio file) Function 4 hasn't been implemented at all yet.

    


    The program is broken into 2 main files : youtube_downloader.py and main.py
The errors I receive from output of running function 2 are listed after the code below

    


    I am hoping for some clarification on what the errors are describing any advice on implementing the second function outlined in comments below.

    


    main.py

    


    from youtube_downloader import download_playlist,input_links,download_video,convert_to_mp3,convert_to_mp4
from moviepy.editor import VideoFileClip, AudioFileClip, concatenate_videoclips
import os


print("Load Complete\n")

print('''
What would you like to do?
(1) Download a YouTube video and audio
(2) Download a YouTube Playlist (video and audio)
(3) Download a YouTube Video's audio only
(4) Download a Youtube Playlist's audio only
(q) Quit
''')

done = False

while done == False:
    #ask user for choice
    choice = input("Choice: ")
    if choice == "1" or choice == "2":
        # Sets Quality Option of video(s)
        quality = input("Please choose a quality (low or 0, medium or 1, high or 2, very high or 3):")
        #download videos manually
        if choice == "1":
            links = input_links()
            print('Download has been started')
            for link in links: 
                filename = download_video(link, quality)
                convert_to_mp4(filename)
                print("Download finished!")
        #download a playlist
        if choice == "2":
            link = input("Enter the link to the playlist: ")
            print("Downloading playlist...")
            filenames = download_playlist(link, quality)
            print("Download finished! Beginning conversion...")
            **#################################################################
            for file in os.listdir('./Downloaded/'):
                convert_to_mp4(filenames)
            #################################################################**
            print("Conversion finished!")
    elif choice == "3":
        links = input_links()
        for link in links:
            print("Downloading...")
            filename = download_video(link, 'low')
            print("Converting...")
            convert_to_mp3(filename)
            os.remove(filename)
    elif choice == "4":
        pass
        #TODO: add option 4 code
    elif choice == "q" or choice == "Q":
        done = True
        print("Goodbye")
    else:
        print("Invalid input!")


    


    youtube_downloader.py

    


    import pytube
from pytube import YouTube, Playlist
from pytube.cli import on_progress
from moviepy.editor import VideoFileClip, AudioFileClip
import os

"""
Downloads video to a 'Downloaded' folder in the same dir as the program.

"""

def download_video(url, resolution):
    itag = choose_resolution(resolution)
    video = YouTube(url,on_progress_callback=on_progress)
    stream = video.streams.get_by_itag(itag)
    try:
        os.mkdir('./Downloaded/')
    except:
        pass
    stream.download(output_path='./Downloaded/')
    return f'./Downloaded/{stream.default_filename}'

def download_videos(urls, resolution):
    for url in urls:
        download_video(url, resolution)

def download_playlist(url, resolution):
    playlist = Playlist(url)
    download_videos(playlist.video_urls, resolution)

def choose_resolution(resolution):
    if resolution in ["low", "360", "360p","0"]:
        itag = 18
    elif resolution in ["medium", "720", "720p", "hd","1"]:
        itag = 22
    elif resolution in ["high", "1080", "1080p", "fullhd", "full_hd", "full hd","2"]:
        itag = 137
    elif resolution in ["very high", "2160", "2160p", "4K", "4k","3"]:
        itag = 313
    else:
        itag = 18
    return itag


def input_links():
    print("Enter the links of the videos (end by entering 'stop' or 0):")

    links = []
    link = ""

    while link != "0" and link.lower() != "stop":
        link = input("video_url or \"stop\": ")
        links.append(link)
    
    if len(links)==1:
        print("No links were inputed")
        exit()

    links.pop()

    return links

def convert_to_mp3(filename):
    clip = VideoFileClip(filename)
    clip.audio.write_audiofile(filename[:-3] + "mp3")
    clip.close()

def convert_to_mp4(filename):
    video_clip = VideoFileClip(filename)
    audio_clip = AudioFileClip(filename)
    final_clip = video_clip.set_audio(audio_clip)
    final_clip.write_videofile(filename[:-3] + "mp4")
    final_clip.close()


    


    Error output

    


    Traceback (most recent call last):&#xA;  File "C:\Users\ptcoo\Documents\youtube-downloader-converter\main.py", line 44, in <module>&#xA;    convert_to_mp4(filenames)&#xA;  File "C:\Users\ptcoo\Documents\youtube-downloader-converter\youtube_downloader.py", line 69, in convert_to_mp4&#xA;    video_clip = VideoFileClip(filename)&#xA;                 ^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\ptcoo\AppData\Roaming\Python\Python312\site-packages\moviepy\video\io\VideoFileClip.py", line 88, in __init__&#xA;    self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,&#xA;                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\ptcoo\AppData\Roaming\Python\Python312\site-packages\moviepy\video\io\ffmpeg_reader.py", line 35, in __init__&#xA;    infos = ffmpeg_parse_infos(filename, print_infos, check_duration,&#xA;            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\ptcoo\AppData\Roaming\Python\Python312\site-packages\moviepy\video\io\ffmpeg_reader.py", line 244, in ffmpeg_parse_infos&#xA;    is_GIF = filename.endswith(&#x27;.gif&#x27;)&#xA;             ^^^^^^^^^^^^^^^^^&#xA;AttributeError: &#x27;NoneType&#x27; object has no attribute &#x27;endswith&#x27;&#xA;</module>

    &#xA;

  • Converting images to youtube supported video using ffmpeg

    15 février 2014, par Kaushik DB

    I'm trying to generate a 1.5hr video for uploading to Youtube using ffmpeg with a 1280x720 screenshot and a audio file.
    I've tried
    but it takes a long time for Youtube to process the video. how can i minimize the processing time.

    ffmpeg -loop 1 -r 2 -i input.png -i audio.ogg -c:v libx264 -preset medium -tune stillimage -crf 18 -c:a copy -shortest -pix_fmt yuv420p output.mkv