Recherche avancée

Médias (91)

Autres articles (56)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

Sur d’autres sites (7271)

  • Downloading youtube mp3 - metadata encoding issue (python, youtube-dl, ffmpeg)

    21 mai 2015, par mopsiok

    I’m trying to download audio from youtube with youtube-dl.exe and ffmpeg.exe (Windows 7), but I am having some troubles with encoding. I have to parse metadata manually, because when I try to use

    --metadata-from-title "%(artist) - %(title)" --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=DaU94Ld3fuM

    I get ERROR : Could not interpret title of video as "%(artist) - %(title)"

    Anyway, I wrote some code to save metadata with ffmpeg :

    def download(url, title_first=False):
       if (0 == subprocess.call('youtube-dl --extract-audio --audio-format mp3 %s' % url)):
           #saves file in current directory in format: VID_TITLE-VID_ID.mp3
           video_id = url[url.find('=')+1:] #video id from URL (after ?v=)
           for f in os.listdir('.'):
               if video_id in f:
                   filename = f
                   break
           os.rename(filename, video_id+'.mp3') #name without non-ascii chars (for tests)
           video_title = filename[: filename.find(video_id)-1]

           output = video_title + '.mp3'
           title, artist = '', ''
           try: #parsing the title
               x = video_title.find('-')
               artist = video_title[:x].strip()
               title = video_title[x+1:].strip()
               if (title_first): output = '%s - %s.mp3' % (title, artist)
           except:
               pass

           x = 'ffmpeg -i "%s" -metadata title="%s" -metadata artist="%s" -acodec copy -id3v2_version 3 -write_id3v1 1 "%s"' \
                           % (video_id+'.mp3', title, artist, output)
           print x
           subprocess.call(x)

    The file is downloaded and then cropped to given start and duration times (the code above is a simplified version). Filename is fine, but when I open the file with AIMP3, it shows rubbish instead of non-ascii characters :

    enter image description here

    I’ve tried to re-encode the final command with iso-8859-2, utf-8 and mbcs :

    x = x.decode('cp1250').encode('iso-8859-2')

    But non-ascii chars are still not readable. Passing an unicode command returns UnicodeEncodeError...

    Any idea how to solve this problem ?

  • Downloading youtube mp3 - metadata encoding issue (python, youtube-dl, ffmpeg)

    21 novembre 2018, par mopsiok

    I’m trying to download audio from youtube with youtube-dl.exe and ffmpeg.exe (Windows 7), but I am having some troubles with encoding. I have to parse metadata manually, because when I try to use

    --metadata-from-title "%(artist) - %(title)" --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=DaU94Ld3fuM

    I get ERROR : Could not interpret title of video as "%(artist) - %(title)"

    Anyway, I wrote some code to save metadata with ffmpeg :

    def download(url, title_first=False):
       if (0 == subprocess.call('youtube-dl --extract-audio --audio-format mp3 %s' % url)):
           #saves file in current directory in format: VID_TITLE-VID_ID.mp3
           video_id = url[url.find('=')+1:] #video id from URL (after ?v=)
           for f in os.listdir('.'):
               if video_id in f:
                   filename = f
                   break
           os.rename(filename, video_id+'.mp3') #name without non-ascii chars (for tests)
           video_title = filename[: filename.find(video_id)-1]

           output = video_title + '.mp3'
           title, artist = '', ''
           try: #parsing the title
               x = video_title.find('-')
               artist = video_title[:x].strip()
               title = video_title[x+1:].strip()
               if (title_first): output = '%s - %s.mp3' % (title, artist)
           except:
               pass

           x = 'ffmpeg -i "%s" -metadata title="%s" -metadata artist="%s" -acodec copy -id3v2_version 3 -write_id3v1 1 "%s"' \
                           % (video_id+'.mp3', title, artist, output)
           print x
           subprocess.call(x)

    The file is downloaded and then cropped to given start and duration times (the code above is a simplified version). Filename is fine, but when I open the file with AIMP3, it shows rubbish instead of non-ascii characters :

    enter image description here

    I’ve tried to re-encode the final command with iso-8859-2, utf-8 and mbcs :

    x = x.decode('cp1250').encode('iso-8859-2')

    But non-ascii chars are still not readable. Passing an unicode command returns UnicodeEncodeError...

    Any idea how to solve this problem ?

  • Download youtube videos with youtube-dl/ffmpeg in php

    24 juillet 2019, par Baraque Obahamas

    I have been using youtube-dl for a long time, and I now want to install it on my dedicated server to make it easier for me to download content.

    I created a php script that allows me to download the video of my choice to the server, then I download it to my computer, pretty cool !

    I am now trying to improve this script in order to redirect only the feed to avoid uploading the video to the server.

    Example with this site : https://mpgun.com
    It seems to redirect the stream without downloading the video to the server. If you try to download a video that lasts 3 hours, the site will offer you the download immediately !

    I think ffmpeg allows you to do that, only I don’t know where to start in the code.

    Do you have any idea how to set this up in php ?

    Thank you