Recherche avancée

Médias (91)

Autres articles (98)

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

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (3650)

  • subprocess called from multiprocess not finishing

    24 juin 2020, par Pavel Komarov

    I've got a set of videos from which I'm trying to pull random frames. There are a lot of videos, so I want to work in parallel, and ffmpeg can splice out the frames for me, so here's the important part of the code :

    


    import os
from tqdm import tqdm
from joblib import Parallel, delayed
from multiprocessing import current_process
from subprocess import Popen

vids_dir = 'just a string'
out_dir = 'another string'

def process_each(f):
    temp = 'temp' + str(current_process()._identity[0])
    os.mkdir(temp)

    proc = Popen(['ffmpeg -i ' + vids_dir + '/' + f + ' ' + temp + '/' + f[:-4] + '_%03d.jpg &> /dev/null'], shell=True) # convert to frames
    proc.wait()

    # do stuff

    os.system('rm -rf ' + temp) # clean up


Parallel(n_jobs=10)(delayed(process_each)(f) for f in tqdm(os.listdir(vids_dir)))


    


    I can print out the command being passed to Popen and execute it in a shell, and it works. I can open a python3 session and call the command from Popen or subprocess.call or even os.system, and it works. I can even set n_jobs=1 in my Parallel, and it works.

    


    But the moment I actually parallelize this, I find ffmpeg doesn't flush its full results to the temporary folders ; it only gets the first one or few frames.

    


    What on earth could be going on ? subprocess and multiprocessing should be able to mix this way.

    


  • Use ffmpeg to record 2 webcams on raspberry pi

    30 janvier 2021, par RaresBaaa

    I want to record 2 webcams using ffmpeg, i have a simple python script but it doesn't work when I run the 2 subprocesses at the same time.

    


    ROOT_PATH = os.getenv("ROOT_PATH", "/home/pi")
ENCODING = os.getenv("ENCODING", "copy")
new_dir = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
RECORDINGS_PATH1 = os.getenv("RECORDINGS_PATH", "RecordingsCam1")
RECORDINGS_PATH2 = os.getenv("RECORDINGS_PATH", "RecordingsCam2")
recording_path1 = os.path.join(ROOT_PATH, RECORDINGS_PATH1, new_dir)
recording_path2 = os.path.join(ROOT_PATH, RECORDINGS_PATH2, new_dir)
os.mkdir(recording_path1)
os.mkdir(recording_path2)
segments_path1 = os.path.join(recording_path1, "%03d.avi")
segments_path2 = os.path.join(recording_path2, "%03d.avi")
record1 = "ffmpeg -nostdin -i /dev/video0 -c:v {} -an -sn -dn -segment_time 30 -f segment {}".format(ENCODING, segments_path1)
record2 = "ffmpeg -nostdin -i /dev/video2 -c:v {} -an -sn -dn -segment_time 30 -f segment {}".format(ENCODING, segments_path2)
subprocess.Popen(record1, shell=True)
subprocess.Popen(record2, shell=True)


    


    Also, i tried capturing the 2 sources side by side but it gives the error :`Filtering and streamcopy cannot be used together.

    


  • Command is running different from expected when i use it trought Python

    17 septembre 2021, par Gustavo Marinho

    I have a code where i download a youtube video as 3gpp and convert it to a mp3, i need to use FFmpeg to do this, and it work well when using both cmd and powershell, but, when i tried to run the same command in Python, it didin't work at all.

    


    This is my command :

    


    ffmpeg -i  C:\YTDownloads\CurrentAudio.3gpp C:\YTDownloads\CurrentAudio.mp3

    


    I tried :

    


    subprocess.call(r'%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe ffmpeg -i  C:\YTDownloads\CurrentAudio.3gpp C:\YTDownloads\CurrentAudio.mp3', shell=True)

    


    subprocess.run(["ffmpeg","-i","C:\YTDownloads\CurrentAudio.3gpp","C:\YTDownloads\CurrentAudio.mp3]")


    


    os.system('powershell ffmpeg -i  C:\YTDownloads\CurrentAudio.3gpp C:\YTDownloads\CurrentAudio.mp3')


    


    subprocess.run([
    'ffmpeg',
    '-i', os.path.join(parent_dir, f"{newname}.3gpp"),
    os.path.join(parent_dir, f"{newname}.mp3")
]) 


    


    subprocess.call('C:\Windows\System32\powershell.exe ffmpeg -i  C:\YTDownloads\CurrentAudio.3gpp C:\YTDownloads\CurrentAudio.mp3', shell=True)


    


    all of them return some type of error, in some of them it returns that ffmpeg isn't a recognized as a internal command, in others it says that the system can't find the specified path, but none of them works, even thought it works perfectly when i use the exactly same command on cmd/powershell.

    


    sorry for my bad english :3