Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (65)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

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

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (8373)

  • How can I run an ffmpeg command in a python script ?

    24 juin 2022, par Nexion21

    I want to overlay a transparent video over top of an image using ffmpeg and python

    


    I am able to do this successfully through terminal, but I cannot get ffmpeg commands to work in python. The following command produces the result that I want in terminal when I am in the directory with the files there.

    


    ffmpeg -i head1.png -i hdmiSpitting.mov -filter_complex "[0:v][1:v] overlay=0:0" -pix_fmt yuv420p -:a copy output3.mov


    


    In python, my code is simple :

    


    import os
import subprocess
command = "ffmpeg -i head1.png -i hdmiSpitting.mov -filter_complex \"[0:v][1:v] overlay=0:0\" -pix_fmt yuv420p -c:a copy output3.mov"
subprocess.call(command,shell=True)


    


    The code runs, there is no indication of an error, but no output is produced.

    


    What am I missing here ?

    


  • FileNotFoundError running ffmpeg on Windows from Python subprocess

    4 avril 2023, par mahmoudamintaha

    this is my code to convert mkv to mp4
i created both assets and results folders
i added ffmpeg to user and enviroment variables path

    


    import os
import subprocess

if not os.path.exists("assets"):
    raise Exception("Please create and put all MKV files in assets folder. ")

mkv_list = os.listdir("assets")

if not os.path.exists("results"):
    os.mkdir("results")

for mkv in mkv_list:
    name, ext = os.path.splitext(mkv)
    if ext != ".mkv":
        raise Exception("Please add MKV files only!")

    output_name = name + ".mp4"

    try:
        subprocess.run(
            ['ffmpeg', '-i', f"assets/{mkv}", "-codec", "copy", f"results/{output_name}"], check=True
        )

    except:
        raise Exception(
            "Please, download, install and Add the path FFMPEG to Enviroment variables ")

print(f"{len(mkv_list)} video/s have ben converted")
os.startfile("results")


    


    i get this error messages when i run it

    


    ---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Cell In[1], line 20
     19 try:
---> 20     subprocess.run(
     21         ['ffmpeg', '-i', f"assets/{mkv}", "-codec", "copy", f"results/{output_name}"], check=True
     22     )
     24 except:

File c:\Users\HP\anaconda3\envs\Projectvenv\Lib\subprocess.py:546, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    544     kwargs['stderr'] = PIPE
--> 546 with Popen(*popenargs, **kwargs) as process:
    547     try:

File c:\Users\HP\anaconda3\envs\Projectvenv\Lib\subprocess.py:1022, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
   1019             self.stderr = io.TextIOWrapper(self.stderr,
   1020                     encoding=encoding, errors=errors)
-> 1022     self._execute_child(args, executable, preexec_fn, close_fds,
   1023                         pass_fds, cwd, env,
   1024                         startupinfo, creationflags, shell,
   1025                         p2cread, p2cwrite,
   1026                         c2pread, c2pwrite,
   1027                         errread, errwrite,
   1028                         restore_signals,
   1029                         gid, gids, uid, umask,
   1030                         start_new_session, process_group)
   1031 except:
   1032     # Cleanup if the child failed starting.

File c:\Users\HP\anaconda3\envs\Projectvenv\Lib\subprocess.py:1491, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session, unused_process_group)
   1490 try:
-> 1491     hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
   1492                              # no special security
   1493                              None, None,
   1494                              int(not close_fds),
   1495                              creationflags,
   1496                              env,
   1497                              cwd,
   1498                              startupinfo)
   1499 finally:
   1500     # Child is launched. Close the parent's copy of those pipe
   1501     # handles that only the child should have open.  You need
   (...)
   1504     # pipe will not close when the child process exits and the
   1505     # ReadFile will hang.

FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
Cell In[1], line 25
     20         subprocess.run(
     21             ['ffmpeg', '-i', f"assets/{mkv}", "-codec", "copy", f"results/{output_name}"], check=True
     22         )
     24     except:
---> 25         raise Exception(
     26             "Please, download, install and Add the path FFMPEG to Enviroment variables ")
     28 print(f"{len(mkv_list)} video/s have ben converted")
     29 os.startfile("results")

Exception: Please, download, install and Add the path FFMPEG to Enviroment variables 


    


    I checked adding ffmpeg to environment variable and it's added
I used jupyter to know the specific line the doesn't work and it's the subprocess line

    


  • create associative data from ffmpeg string result into python

    9 septembre 2018, par Question

    To perform video operations I’m using python with the support of ffmpeg. After I’ve uploaded videos, I need to resize them, so I’ll follow these instructions to calculate the video dimensions :

    link_v = "C:/video/video.mp4"
    ffmpeg = "ffprobe -v error -show_entries stream=width,height -of default=noprint_wrappers=1 %s"% link_v
    info = check_output(ffmpeg, shell=True)
    print(info)

    The console result is something like this :

    width=350
    height=350

    But I do not care about this, when it is printed as if it were a string, because the real data would be : b’width=350\r\nheight=350\r\n’ or [’width=350\r\nheight=350\r\n’].

    What I really want to see is an associative data : "width : 350, height : 350", once I get then I would call for example width in the info mode [’width’], how can I get this result ?