Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (81)

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

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, 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 (...)

Sur d’autres sites (11148)

  • Live stream failed on Youtube

    20 septembre 2023, par kuldeep chopra

    We are currently running an AWS container that utilizes FFmpeg for live streaming while concurrently saving the stream as an MP4 file. However, we encountered an issue during a recent live stream session that was functioning correctly until approximately 13 minutes in, at which point FFmpeg reported the following error logs :

    


    ffmpeg [flv @ 0x555c4bdfe680] Failed to update header with correct duration.
2023-09-07T23:06:38.490+05:30 [flv @ 0x555c4bdfe680] Failed to update header with correct filesize.
2023-09-07T23:06:38.491+05:30 failed => rtmp://a.rtmp.youtube.com/live2/key......
2023-09-07T23:06:38.491+05:30 ffmpeg [tee @ 0x555c48843700] Slave muxer #1 failed: Broken pipe, continuing with 1/2 slaves.


    


    It's worth noting that we have conducted hundreds of live streams on YouTube without encountering this error before ; this is the first occurrence of such an issue.

    


    We would greatly appreciate it if you could investigate and provide insights into the underlying problem causing these error messages.

    


  • How to generate valid live DASH for YouTube ?

    24 septembre 2019, par Matt Hensley

    I am attempting to implement YouTube live video ingestion via DASH as documented at :
    https://developers.google.com/youtube/v3/live/guides/encoding-with-dash

    To start, I am exercising the YouTube API manually and running ffmpeg to verify required video parameters before implementing in my app.

    Created a new livestream with liveStreams.insert and these values for the cdn field :

    "cdn": {
       "frameRate": "variable",
       "ingestionType": "dash",
       "resolution": "variable"
    }

    Created a broadcast via liveBroadcasts.insert, then used liveBroadcasts.bind to bind the stream to the broadcast.

    Then I grabbed the ingestionInfo from the stream and ran this ffmpeg command, copying in the ingestionAddress with the streamName :

    ffmpeg -stream_loop -1 -re -i mov_bbb.mp4 \
       -loglevel warning \
       -r 30 \
       -g 60 \
       -keyint_min 60 \
       -force_key_frames "expr:eq(mod(n,60),0)" \
       -quality realtime \
       -map v:0 \
       -c:v libx264 \
       -b:v:0 800k \
       -map a:0 \
       -c:a aac \
       -b:a 128k \
       -strict -2 \
       -f dash \
       -streaming 1 \
       -seg_duration 2 \
       -use_timeline 0 \
       -use_template 1 \
       -window_size 5 \
       -extra_window_size 10 \
       -index_correction 1 \
       -adaptation_sets "id=0,streams=v id=1,streams=a" \
       -dash_segment_type mp4 \
       -method PUT \
       -http_persistent 1 \
       -init_seg_name "dash_upload?cid=${streamName}&copy=0&file=init$RepresentationID$.mp4" \
       -media_seg_name "dash_upload?cid=${streamName}&copy=0&file=media$RepresentationID$$Number$.mp4" \
       'https://a.upload.youtube.com/dash_upload?cid=${streamName}&copy=0&file=dash.mpd'

    It appears all the playlist updates and video segments upload fine to YouTube - ffmpeg does not report any errors. However the liveStream status always shows noData, and the YouTube Live Control Room doesn’t show the stream as receiving data.

    The DASH output, when written to files play backs fine in this test player. The playlist output doesn’t match exactly the samples, but does have the required tags per the "MPD Contents" section in the documentation.

    Are my ffmpeg arguments incorrect, or does YouTube have additional playlist format requirements that are not documented ?

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