Recherche avancée

Médias (0)

Mot : - Tags -/configuration

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (63)

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

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (9696)

  • How do I properly save an animation involving circles with matplotlib.animation and ffmpeg ?

    12 juillet 2020, par bghost

    I recently tried out matplotlib.animation, and it's a wonderful tool. I can now make and save basic animations (ie that only involve straight lines) without any issues. However, when I made an animation involving circles, even though the interactive display was perfect, the saved mp4 file wasn't really satisfying. In the mp4 file, the edges of the circles were blurred, and if the circles were made semi-transparent (ie with an alpha value < 1), they all suddenly became completely opaque after a couple of frames. I suspected it was due to the fact that my bitrate wasn't high enough, but I went up to 10000 kb/s (instead of 1800), and exactly the same phenomenon occurred.

    &#xA;

    What can be done to solve these 2 issues (blurred edges + negated transparency) in the generated mp4 file ?

    &#xA;

    Here is a simple animation that describes what I just said :

    &#xA;

    import numpy as np&#xA;import matplotlib.pyplot as plt&#xA;import matplotlib.animation as animation&#xA;&#xA;fig = plt.figure(figsize=(11, 7))&#xA;ax = plt.axes(xlim=(-1.2, 1.2), ylim=(-0.7, 0.7))&#xA;ax.set_aspect(&#x27;equal&#x27;)&#xA;&#xA;dict_circles = {}&#xA;dict_circles[&#x27;ring&#x27;] = plt.Circle((-0.5, 0), 0.5, color=&#x27;b&#x27;, lw=2, fill=False)&#xA;dict_circles[&#x27;disk&#x27;] = plt.Circle((-0.5, 0), 0.5, color=&#x27;b&#x27;, alpha=0.2)&#xA;&#xA;def init():&#xA;    for circle in dict_circles.values():&#xA;        ax.add_patch(circle)&#xA;    return(dict_circles.values())&#xA;&#xA;nb_frames = 100&#xA;X_center = np.linspace(-0.5, 0.5, nb_frames)&#xA;&#xA;def animate(frame):&#xA;    for circle in dict_circles.values():&#xA;        circle.center = (X_center[frame], 0)&#xA;        ax.add_patch(circle)&#xA;    return(dict_circles.values())&#xA;&#xA;ani = animation.FuncAnimation(fig, animate, init_func=init, frames=nb_frames, blit=True, interval=10, repeat=False)&#xA;plt.show()&#xA;&#xA;plt.rcParams[&#x27;animation.ffmpeg_path&#x27;] = &#x27;C:\\ffmpeg\\bin\\ffmpeg.exe&#x27;&#xA;Writer = animation.writers[&#x27;ffmpeg&#x27;]&#xA;writer_ref = Writer(fps=15, bitrate=1800)&#xA;&#xA;ani.save(&#x27;Blue circle.mp4&#x27;, writer=writer_ref)&#xA;

    &#xA;

  • Lossless trim and crop of MJPEG video

    28 avril 2021, par prouast

    I am working on a project where I need to trim and crop MJPEG videos without any re-encoding. I have working code that accomplishes this by exporting the relevant frames as JPEGs, cropping them individually, and then joining them back together into an MJPEG.

    &#xA;

    However, this seems quite inefficient and slow. I am looking for pointers how to improve this approach. For example, would it be possible to store the JPEGs in-memory ?

    &#xA;

    import ffmpeg&#xA;import os&#xA;import shutil&#xA;import subprocess&#xA;&#xA;def lossless_trim_and_crop(path, output_path, start, end, x, y, width, height, fps):&#xA;  # Trim the video in time and export all individual jpeg with ffmpeg &#x2B; mjpeg2jpeg&#xA;  jpeg_folder = os.path.splitext(output_path)[0]&#xA;  jpeg_path = os.path.join(jpeg_folder, "frame_%03d.jpg")&#xA;  stream = ffmpeg.input(path, ss=start/fps, t=(end-start)/fps)&#xA;  stream = ffmpeg.output(stream, jpeg_path, vcodec=&#x27;copy&#x27;, **{&#x27;bsf:v&#x27;: &#x27;mjpeg2jpeg&#x27;})&#xA;  stream.run(quiet=True)&#xA;  # Crop all individual jpeg with jpegtran&#xA;  for filename in os.listdir(jpeg_folder):&#xA;    filepath = os.path.join(jpeg_folder, filename)&#xA;    out_filepath = os.path.splitext(filepath)[0] &#x2B; "_c.jpg"&#xA;    subprocess.call(&#xA;      "jpegtran -perfect -crop {}x{}&#x2B;{}&#x2B;{} -outfile {} {}".format(&#xA;        width, height, x, y, out_filepath, filepath), shell=True)&#xA;    os.remove(filepath)&#xA;  # Join individual jpg back together&#xA;  cropped_jpeg_path = os.path.join(jpeg_folder, "frame_%03d_c.jpg")&#xA;  stream = ffmpeg.input(cropped_jpeg_path, framerate=fps)&#xA;  stream = ffmpeg.output(stream, output_path, vcodec=&#x27;copy&#x27;)&#xA;  stream.run(quiet=True)&#xA;  # Delete jpeg directory&#xA;  shutil.rmtree(jpeg_folder)&#xA;

    &#xA;

  • HLS implementation with FFmpeg

    6 juin 2017, par Joseph K

    I am trying to implement HLS using FFmpeg for transcoding + segmenting but have been facing a couple of issues that have been bugging me for the past week.

    Issue

    Webserver currently receives live MP4 fragments being recorded on-the-go and needs to take care of transcoding and segmentation.

    As mp4 fragments are being received, they need to be encoded. Then segmented. If i run a segmenter (be it ffmpeg or apple mediastreamsegmenter), every mp4 fragment is being treated as a VOD by itself and I’m not being able to integrate them as part of a larger live event implementation.

    I thought of a solution where every time I receive an mp4 fragment, I first use fmpeg to concatenate it with previous ones to form the larger mp4 that I then pass to be segmented for HLS. That did not work either because the entire stream has to be re-segmented each and every time and existing TS fragments replaced by new ones that are similar yet shifted in time.

    Implementation 1

    ffmpeg -re -i fragmentX.mp4 -b:v 118k -b:a 32k -vcodec copy -preset:v veryfast -acodec aac -strict -2 -ac 2 -f mpegts -y fragmentX.ts

    I manage the m3u8 manifest on my own, deleting old fragments and appending new ones.

    When validating the stream, I find it stacked with EXT-X-DISCONTINUITY tags making the stream unwatchable.

    Implementation 2

    First combine latest fragment with overall.mp4

    ffmpeg -i "concat:newfragment.mp4|existing.mp4" -c copy overall.mp4

    Then pass the combination to ffmpeg for HLS segmentation

    ffmpeg -re -i overall.mp4 -ac 2 -r 20 -vcodec libx264 -b:v 318k -preset:v veryfast -acodec aac -strict -2 -b:a 32k -hls_time 2 -hls_list_size 3 -hls_allow_cache 0 -hls_base_url /Users/JosephKalash/Desktop/test/350/ -hls_segment_filename ’350/fragment%03d.ts’ -hls_flags delete_segments 350/index.m3u8

    Concatenation is not perfect and there are noticeable glitches where the fragments are supposed to be stitched. Segmentation replaces older fragments and the manifest is rewritten as if it’s a new HLS stream every time ffmpeg is called.

    I cannot figure out how to get this to work properly.

    Any ideas ?