Recherche avancée

Médias (91)

Autres articles (91)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

Sur d’autres sites (8162)

  • FFMPEG HLS streaming and transcoding on the fly to HTML player - video duration changes while transcoding

    20 août 2019, par Thomas Tho

    I am trying to make a video streaming server and watch videos directly from web browser. The idea is to make the server to stream video from remote server, transcode with different audio format in local server, and then instantly stream to the client (this is specific way I need it to function).
    This is the FFMPEG code im currently using :

    ffmpeg -i "url" -c:v copy -c:a aac -ac 2 -f hls -hls_time 60 -hls_playlist_type event -hls_flags independent_segments out.m3u8

    The HLS stream is attached to the HTML player with hls.js and it works. However, the video duration is constantly changing while video is being transcoded. I have tried to change video duration with JS like $('video').duration = 120;with no luck.

    How do i make the player to display the video file duration instead of stream current transcoded time ?

    I am also planning to implement video seeking but i am clueless. The current idea is to send seeking time to the server, terminate ffmpeg, and start from specific time. However, i think the player might get stuck on loading and will not start playing without reloading.

  • Building A livestreaming server like youtube from scratch

    9 décembre 2022, par Dipo Ahmed

    I am trying to build a live streaming server like youtube where I can watch the video live or if I want to I can play the video from any duration I want.

    &#xA;

    What I have tried so far.&#xA;I have built a node js WebSocket server where I push the video blob that I receive from the browser via MediaRecorder API every 2 seconds. This blob is then getting converted to hls by a ffmpeg process which generates 2 seconds *.ts files and a .m3u8 file which I am playing with video.js in browser.

    &#xA;

    This is my ffmpeg command

    &#xA;

     spawn(&#x27;ffmpeg&#x27;, [&#xA;        &#x27;-i&#x27;, &#x27;-&#x27;,&#xA;        // &#x27;-re&#x27;,&#xA;        &#x27;-fflags&#x27;, &#x27;&#x2B;igndts&#x27;,&#xA;&#xA;        &#x27;-vcodec&#x27;, &#x27;h264&#x27;,&#xA;        &#x27;-acodec&#x27;, &#x27;aac&#x27;,&#xA;&#xA;        &#x27;-preset&#x27;, &#x27;slow&#x27;,&#xA;        &#x27;-crf&#x27;, &#x27;22&#x27;,&#xA;        // You can also use QP value to adjust output stream quality, e.g.: &#xA;        // &#x27;-qp&#x27;, &#x27;0&#x27;,&#xA;        // You can also specify output target bitrate directly, e.g.:&#xA;        &#x27;-b:v&#x27;, &#x27;1500K&#x27;,&#xA;        &#x27;-b:a&#x27;, &#x27;128K&#x27;, // Audio bitrate&#xA;&#xA;        &#x27;-f&#x27;, &#x27;hls&#x27;,&#xA;        &#x27;-hls_time&#x27;, &#x27;1&#x27;,&#xA;        // &#x27;-hls_playlist_type&#x27;, &#x27;vod&#x27;,&#xA;        &#x27;-hls_list_size&#x27;, &#x27;2&#x27;,&#xA;        &#x27;-hls_flags&#x27;, &#x27;independent_segments&#x27;,&#xA;        &#x27;-hls_segment_type&#x27;, &#x27;mpegts&#x27;,&#xA;        &#x27;-hls_segment_filename&#x27;, `${path}/stream%02d.ts`, `${path}/stream.m3u8`,&#xA;    ]);&#xA;

    &#xA;

    The problem is that the video js player duration is not updating like in youtube where the video duration increases every second.

    &#xA;

    Any direction will be appreciated. Please tell me if my approach is wrong and what needs to be learned for me to build this system.

    &#xA;

  • FileNotFoundError running ffmpeg on Windows from Python subprocess

    4 avril 2023, par mahmoudamintaha

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

    &#xA;

    import os&#xA;import subprocess&#xA;&#xA;if not os.path.exists("assets"):&#xA;    raise Exception("Please create and put all MKV files in assets folder. ")&#xA;&#xA;mkv_list = os.listdir("assets")&#xA;&#xA;if not os.path.exists("results"):&#xA;    os.mkdir("results")&#xA;&#xA;for mkv in mkv_list:&#xA;    name, ext = os.path.splitext(mkv)&#xA;    if ext != ".mkv":&#xA;        raise Exception("Please add MKV files only!")&#xA;&#xA;    output_name = name &#x2B; ".mp4"&#xA;&#xA;    try:&#xA;        subprocess.run(&#xA;            [&#x27;ffmpeg&#x27;, &#x27;-i&#x27;, f"assets/{mkv}", "-codec", "copy", f"results/{output_name}"], check=True&#xA;        )&#xA;&#xA;    except:&#xA;        raise Exception(&#xA;            "Please, download, install and Add the path FFMPEG to Enviroment variables ")&#xA;&#xA;print(f"{len(mkv_list)} video/s have ben converted")&#xA;os.startfile("results")&#xA;

    &#xA;

    i get this error messages when i run it

    &#xA;

    ---------------------------------------------------------------------------&#xA;FileNotFoundError                         Traceback (most recent call last)&#xA;Cell In[1], line 20&#xA;     19 try:&#xA;---> 20     subprocess.run(&#xA;     21         [&#x27;ffmpeg&#x27;, &#x27;-i&#x27;, f"assets/{mkv}", "-codec", "copy", f"results/{output_name}"], check=True&#xA;     22     )&#xA;     24 except:&#xA;&#xA;File c:\Users\HP\anaconda3\envs\Projectvenv\Lib\subprocess.py:546, in run(input, capture_output, timeout, check, *popenargs, **kwargs)&#xA;    544     kwargs[&#x27;stderr&#x27;] = PIPE&#xA;--> 546 with Popen(*popenargs, **kwargs) as process:&#xA;    547     try:&#xA;&#xA;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)&#xA;   1019             self.stderr = io.TextIOWrapper(self.stderr,&#xA;   1020                     encoding=encoding, errors=errors)&#xA;-> 1022     self._execute_child(args, executable, preexec_fn, close_fds,&#xA;   1023                         pass_fds, cwd, env,&#xA;   1024                         startupinfo, creationflags, shell,&#xA;   1025                         p2cread, p2cwrite,&#xA;   1026                         c2pread, c2pwrite,&#xA;   1027                         errread, errwrite,&#xA;   1028                         restore_signals,&#xA;   1029                         gid, gids, uid, umask,&#xA;   1030                         start_new_session, process_group)&#xA;   1031 except:&#xA;   1032     # Cleanup if the child failed starting.&#xA;&#xA;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)&#xA;   1490 try:&#xA;-> 1491     hp, ht, pid, tid = _winapi.CreateProcess(executable, args,&#xA;   1492                              # no special security&#xA;   1493                              None, None,&#xA;   1494                              int(not close_fds),&#xA;   1495                              creationflags,&#xA;   1496                              env,&#xA;   1497                              cwd,&#xA;   1498                              startupinfo)&#xA;   1499 finally:&#xA;   1500     # Child is launched. Close the parent&#x27;s copy of those pipe&#xA;   1501     # handles that only the child should have open.  You need&#xA;   (...)&#xA;   1504     # pipe will not close when the child process exits and the&#xA;   1505     # ReadFile will hang.&#xA;&#xA;FileNotFoundError: [WinError 2] The system cannot find the file specified&#xA;&#xA;During handling of the above exception, another exception occurred:&#xA;&#xA;Exception                                 Traceback (most recent call last)&#xA;Cell In[1], line 25&#xA;     20         subprocess.run(&#xA;     21             [&#x27;ffmpeg&#x27;, &#x27;-i&#x27;, f"assets/{mkv}", "-codec", "copy", f"results/{output_name}"], check=True&#xA;     22         )&#xA;     24     except:&#xA;---> 25         raise Exception(&#xA;     26             "Please, download, install and Add the path FFMPEG to Enviroment variables ")&#xA;     28 print(f"{len(mkv_list)} video/s have ben converted")&#xA;     29 os.startfile("results")&#xA;&#xA;Exception: Please, download, install and Add the path FFMPEG to Enviroment variables &#xA;

    &#xA;

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

    &#xA;