Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (21)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • 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

Sur d’autres sites (4650)

  • How to run a python code via Django templates ?

    18 novembre 2018, par Iskender Berdiev

    I want to execute code below when the is submitted (project on Django) :

    from os import system, listdir, remove
    link = 'https://www.youtube.com/watch?v=ME9yO1KEVoo'

    def download(): ## Downloading a video from YouTube using youtube-dl
       system("youtube-dl -o download {}".format(link))

    def convert():  ## Converting downloaded video to mp3 format via ffmpeg.exe(same directory)
       listOfFiles = listdir('.')
       for i in listOfFiles:
           if i.startswith("download"):
               name = i
               system("ffmpeg -i {} download.mp3".format(name))

    def main():
       download()
       convert()

    main()

    I have tried to put this code into views.py :

    class download(TemplateView):
       def main(request):
           if request.method == 'POST':
               link = 'https://www.youtube.com/watch?v=ME9yO1KEVoo'
               system("youtube-dl -o download {}".format(link))
               listOfFiles = listdir('.')
               for i in listOfFiles:
                   if i.startswith("download"):
                       name = i
                       system("ffmpeg -i {} download.mp3".format(name))
           return redirect ('loader/wait.html')

    urls.py :

    path('wait/', views.download.as_view(), name='wait')

    and the html form which is submitted to run views.download.as_view() :

    <form action="{% url " method="POST">{% csrf_token %}
    <input type="submit" value="Yes" />
    </form>
  • youtube-dl python script postprocessing error : FFMPEG codecs aren't being recognized

    23 septembre 2016, par stackPusher

    My python script is trying to download youtube videos with youtube-dl.py. Works fine unless postprocessing is required. The code :

    import youtube_dl

    options = {
       'format':'bestaudio/best',
       'extractaudio':True,
       'audioformat':'mp3',
       'outtmpl':'%(id)s',     #name the file the ID of the video
       'noplaylist':True,
       'nocheckcertificate':True,
       'postprocessors': [{
           'key': 'FFmpegExtractAudio',
           'preferredcodec': 'mp3',
           'preferredquality': '192',
       }]
    }

    with youtube_dl.YoutubeDL(options) as ydl:
       ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])

    Below is the output I receive :enter image description here

    I get a similar error if I try setting ’preferredcodec’ to ’opus’ or ’best’.
    I’m not sure if this is relevant, but I can run the command line counterpart fine :

    youtube-dl -o 'test2.%(ext)s' --extract-audio --audio-format mp3 --no-check-certificate https://www.youtube.com/watch?v=BaW_jenozKc

    I’ve gotten a few clues from the internet and other questions and from what i understand this is most likely an issue with my ffmpeg, which isn’t a python module right ? Here is my ffmpeg version and configuration :
    enter image description here

    If the answer to my problem is to add some configuration setting to my ffmpeg please explain how i go about doing that.

  • Is there a fix for the 'flashing console' bug with FFMPEG ?

    29 août 2022, par NedNoodleHead

    When using a compiled a program that utilizes FFMPEG (Not library, but the path to the exe), and a GUI library ; that has a function that uses FFMPEG, a console window from FFMPEG will quickly open and disappear.

    &#xA;

    I have a github repo that can be used to reproduce the bug : https://github.com/nednoodlehead/ffmpegthreading

    &#xA;

    I also have a quick youtube video showing what the bug looks like, and what it should look like : https://www.youtube.com/watch?v=tCZ0z9E5Iyw

    &#xA;

    A few things to note with this :

    &#xA;

    1). This will only occur when the app is compiled. Running this in a virtual environment works as expected. I run it from my IDE all the time with no console flashing. (as seen in video)

    &#xA;

    2). It will only flash while a GUI is present. So using a regular script to call the same command that produces the bug will NOT cause the bug

    &#xA;

    3). The bug was tested in Tkinter and PyQt5 and produced the same result (flashing console)

    &#xA;

    4). Threading is NOT needed to reproduce this bug, it just makes the debugging a bit easier

    &#xA;

    5). Using the ffmpeg module does not work as my entire project is based around an interface for PyDub (Which uses ffmpeg)

    &#xA;

    6). This solution does not work for me : How to hide console output of FFmpeg in Python ? (Because this uses the module, while I use the exe)

    &#xA;

    7). I am using auto-py-to-exe to compile (which uses pyinstaller)

    &#xA;

    8). Running 'ffmpeg -version' (in regular cmd (same result in venv)) gives : ffmpeg version N-106605-gf67403edb3-20220413

    &#xA;

    I would appreciate any help, this is tying my brain up.

    &#xA;