Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

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

Autres articles (90)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (6789)

  • OSError : [Errno 9] Bad file descriptor when downloading using pytube and playing with discord.py

    15 septembre 2022, par Trevor Mathisen

    When using pytube to download a YouTube video and discord.py to play it, I am getting a OSError : [Errno 9] Bad file descriptor error. I've had this working at one point and can't seem to figure out what I changed which broke it.

    


    Full traceback :

    


    2022-09-15 20:20:44 INFO       discord.voice_client The voice handshake is being terminated for Channel ID 902294184994693224 (Guild ID 902294184994693220)
2022-09-15T20:20:44.010142763Z 2022-09-15 20:20:44 INFO     discord.voice_client Disconnecting from voice normally, close code 1000.
2022-09-15T20:20:44.058592513Z 2022-09-15 20:20:44 ERROR    discord.player Exception in voice thread Thread-5
2022-09-15T20:20:44.058623864Z Traceback (most recent call last):
2022-09-15T20:20:44.058629130Z   File "/usr/local/lib/python3.10/dist-packages/discord/player.py", line 698, in run
2022-09-15T20:20:44.058632003Z     self._do_run()
2022-09-15T20:20:44.058634500Z   File "/usr/local/lib/python3.10/dist-packages/discord/player.py", line 691, in _do_run
2022-09-15T20:20:44.058637013Z     play_audio(data, encode=not self.source.is_opus())
2022-09-15T20:20:44.058639334Z   File "/usr/local/lib/python3.10/dist-packages/discord/voice_client.py", line 683, in send_audio_packet
2022-09-15T20:20:44.058648759Z     self.socket.sendto(packet, (self.endpoint_ip, self.voice_port))
2022-09-15T20:20:44.058653057Z OSError: [Errno 9] Bad file descriptor
2022-09-15T20:20:44.058673762Z 2022-09-15 20:20:44 INFO     discord.player ffmpeg process 12 has not terminated. Waiting to terminate...
2022-09-15T20:20:44.062083854Z 2022-09-15 20:20:44 INFO     discord.player ffmpeg process 12 should have terminated with a return code of -9.


    


    Dockerfile :

    


    ENV MEDIA_DIR='/media/'
RUN mkdir -p /media


    


    Download function (check_path returns True, showing the file is there) :

    


    def download_videos(stream, filename):
    print(f'downloading {filename}')
    filepath = stream.download(output_path=config_db.environ_path, filename=f'{filename}.mp4')
    print(f'completed download of {filepath}')
    check_path = Path(filepath)
    if check_path.is_file():
        print(check_path)
    return filepath


    


    Play function :

    


    async def play(voice_channel, message, control = None):
    vc = get_vc()
    if not vc:
        vc = await voice_channel.connect()
    next_yt = YouTube(next_song)
    next_file = sub(r'\W+', '', next_yt.title.replace(' ', '_').replace('__', '_')).lower()
    next_song_path = download_videos(next_yt.streams.filter(only_audio=True, file_extension='mp4')[0], next_file)

    await message.channel.send(f'Done getting ready, I\'ll be there in a moment.')

while next_song:
    while vc.is_playing():
        await asynciosleep(0.5)
        continue

    try:
        vc.play(FFmpegPCMAudio(next_song_path))
        print(f'Playing {next_song_path} with latency of {vc.average_latency}')
        vc.source = PCMVolumeTransformer(vc.source, volume=0.15)
    except Exception as e:
        print(e)
        await vc.disconnect()
        next_song = None
        return
    next_song = sounds_db.get_next_song()
    next_yt = YouTube(next_song) if next_song else None
    next_file = sub(r'\W+', '', next_yt.title.replace(' ', '_').replace('__', '_')).lower() if next_song else None
    next_song_path = download_videos(next_yt.streams.filter(only_audio=True, file_extension='mp4')[0], next_file) if next_song else None


    


    I've mounted the /media/ dir during docker -v and can see the file is getting downloaded and when I copy the file to my local machine I can play it in an audio player.

    


    The program can access the SQLite database right next to the files in question just fine.

    


    I've deployed the container locally and to two different VPS's with the same file structure with the same behavior. I'm ripping my hair out.

    


  • facing problem in downloading the audio data of a trimmed youtube video using youtube-dl and ffmpeg libraries

    15 mai 2022, par rkc

    I'm trying to download the audio content of a trimmed YouTube video using youtube-dl (v2021.12.17) and FFmpeg (v4.2.2) libraries in python, on Windows 10 PC. I am able to download the audio data when the command is executed on the Pycharm terminal, but not able to download the same content when using os.system() command.

    


    For example, I'm able to download the data when I execute

    


    "ffmpeg -ss 30 -t 10 -i $(youtube-dl -f best -g https://www.youtube.com/watch?v=3NGZcpAZcl0) -- output1.wav"


    


    command on the Pycharm terminal.

    


    But, i'm getting an error, when I try to execute the same in the Editor window as shown below,

    


    os.system('ffmpeg -ss 30 -t 10 -i $(youtube-dl -f best -g https://www.youtube.com/watch?v=3NGZcpAZcl0) -- output1.wav')

error: $(youtube-dl: No such file or directory


    


    I also tried enclosing the $() link in quotes and then executed it. But, after doing this, I am getting a different error as shown below

    


    os.system('ffmpeg -ss 30 -t 10 -i "$(youtube-dl -f best -g https://www.youtube.com/watch?v=3NGZcpAZcl0)" -- output1.wav')

error: $(youtube-dl -f best -g https://www.youtube.com/watch?v=3NGZcpAZcl0): Invalid argument


    


    So, can any of you help me in resolving this error ?

    


  • How easy is it to create a YouTube to MP3 application using yt-dlp and ffmpeg ?

    26 juin 2022, par fowlis

    I was thinking I could automate the process of downloading a video and converting it to mp3 (or other formats).
    
Instead of doing the process myself (which doesn't take that long and isn't too much hassle), which looks something like this :
    
• yt-dlp https://www.youtube.com/watch?v=dQw4w9WgXcQ
    
• wait for download then (find and) rename file to something simpler for next command
    
• ffmpeg -i video.mp4 video.mp3


    


    I thought I could turn it into a simple JS (or other language) program instead, where it :

    


      

    1. Asks for link and what format I want it in
    2. 


    3. Downloads the video
    4. 


    5. Renames it (not sure how easy this is)
    6. 


    7. Turns it into requested format
    8. 


    9. Opens file location
    10. 


    


    If something like this is possible, please let me know some things I should know since I've never written a windows app before, and some general guidance for how I could do this.

    
I apologise if questions like this aren't exactly allowed on this site, its my first time posting too.
    
Thanks in advance !