Recherche avancée

Médias (91)

Autres articles (32)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (4459)

  • youtube-dl doesn't see ffmpeg in the executable

    30 novembre 2019, par Михаил Муратов

    I am writing a program to download music and videos via youtube-dl in python. Next, I pack the script into an executable file via pyinstaller.

    The problem is that youtube-dl (in the executable) doesn’t see ffmpeg and ffprobe, even though I add them to the spec file.

    As far as I know youtube-dl has the ffmpeg_location parameter, but that’s only in the console version. Maybe it is also for python ? But I didn’t find any information about it.

    How do I solve the problem ?


    command to create executable :

    pyinstaller --upx-dir=c:\users\exe-builder c:\users\exe-builder\youtubedownloader\main.spec

    .spec file :

    # -*- mode: python -*
    block_cipher = None

    a = Analysis(['C:\\Users\\Exe-Builder\\YoutubeDownloader\\main.py'],
                pathex=['C:\\Users\\Exe-Builder\\YoutubeDownloader'],
                binaries=[],
                datas=[],
                hiddenimports=[],
                hookspath=[],
                runtime_hooks=[],
                excludes=[],
                win_no_prefer_redirects=False,
                win_private_assemblies=False,
                cipher=block_cipher,
                noarchive=False)

    a.binaries += [('ffmpeg.exe','C:\\Users\\Exe-Builder\\YoutubeDownloader\\ffmpeg.exe', "Binary"),
                  ('ffprobe.exe','C:\\Users\\Exe-Builder\\YoutubeDownloader\\ffprobe.exe', "Binary")]

    pyz = PYZ(a.pure, a.zipped_data,
                cipher=block_cipher)
    exe = EXE(pyz,
             a.scripts,
             a.binaries,
             a.zipfiles,
             a.datas,
             [],
             name='MediaDownloader',
             debug=False,
             bootloader_ignore_signals=False,
             strip=False,
             upx=True,
             upx_exclude=['vcruntime140.dll'],
             runtime_tmpdir=None,
             console=True)

    very small example :

    import youtube_dl

    url = 'https://www.youtube.com/watch?v=MIk55C1s0ns'
    outtmpl = '\\%(title)s.%(ext)s'
    ydl_opts = {'format': 'bestaudio/best',
               'outtmpl': outtmpl,
               'postprocessors': [{'key': 'FFmpegExtractAudio',
                                   'preferredcodec': 'mp3',
                                   'preferredquality': '128'}]}

    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
       info_dict = ydl.extract_info(url, download=True)

    error message :

    youtube_dl.utils.DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.

  • PiCamera stream to youtube with ffmpeg and capture image every second

    9 octobre 2020, par MisterGray

    I'm sending a livestream with a Python script on a Raspberry Pi 4 to Youtube with ffmpeg.

    


    Additionally I want to check the stream for movements. Therefore I want to compare two frames with each other. Since this is relatively computationally intensive, I wanted to limit myself to "only" compare single frames every second.

    


    The camera.capture() command, however, seems to take very long, so the stream hangs again and again.

    


    What is the best way to get a raw frame during the stream ?

    


    Is there a better alternative to detect movements while creating a stream with ffmpeg ?

    


    #!/usr/bin/env python3
import subprocess
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2
import numpy as np

YOUTUBE = 'rtmp://a.rtmp.youtube.com/live2/'
KEY = 'MyYoutubeKey'
stream_cmd = 'ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv ' + YOUTUBE + KEY

avg = None
stream_pipe = subprocess.Popen(stream_cmd, shell=True, stdin=subprocess.PIPE)
resolution = (1280,720)
with PiCamera(resolution = resolution) as camera:

    rawCapture = PiRGBArray(camera, size = resolution)

    camera.framerate = 25
    camera.vflip = True
    camera.hflip = True
    camera.start_recording(stream_pipe.stdin, format='h264', bitrate = 6000000)
    while True:
        camera.wait_recording(1)

        # this command takes a long time to finish
        frame = camera.capture(stream_pipe.stdin, 'rgb')

        """
        further calculations
        """

        rawCapture.truncate(0)

    camera.stop_recording()
    stream_pipe.stdin.close()
    stream_pipe.wait()


    


  • wavpack : check number of channels

    22 août 2014, par Christophe Gisquet
    wavpack : check number of channels
    

    This means container and codec disagree. The codec is supposed to
    know better so this could be an error instead.

    • [DH] libavcodec/wavpack.c