Recherche avancée

Médias (91)

Autres articles (72)

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

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

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

  • ffmpeg very bad quality mp4 conversion

    21 mai 2019, par Legotin

    Trying to convert mp4 with ffmpeg, two passes, with -crf 50 and seems like it doen’t impact on video quality. It’s always very poor.

    '/usr/bin/ffmpeg' '-y' '-i' '/app/storage/7/02/f47a2133-d0fe-6e7f-5e76-3efd22a88027_original.mp4' '-threads' '12' '-vcodec' 'libx264' '-acodec' 'libfaac' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' '-pix_fmt' 'yuv420p' '-crf' '50' '-profile' 'baseline' '-movflags' '+faststart' '-vf' '[in]scale=trunc(iw/2)*2:trunc(ih/2)*2[out]' '-pass' '1' '-passlogfile' '/tmp/ffmpeg-passes5cde7ed5d2937fzaaz/pass-5cde7ed5d2caf' '/app/storage/7/02/f47a2133-d0fe-6e7f-5e76-3efd22a88027_temp.mp4'
    '/usr/bin/ffmpeg' '-y' '-i' '/app/storage/7/02/f47a2133-d0fe-6e7f-5e76-3efd22a88027_original.mp4' '-threads' '12' '-vcodec' 'libx264' '-acodec' 'libfaac' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' '-pix_fmt' 'yuv420p' '-crf' '50' '-profile' 'baseline' '-movflags' '+faststart' '-vf' '[in]scale=trunc(iw/2)*2:trunc(ih/2)*2[out]' '-pass' '2' '-passlogfile' '/tmp/ffmpeg-passes5cde7ed5d2937fzaaz/pass-5cde7ed5d2caf' '/app/storage/7/02/f47a2133-d0fe-6e7f-5e76-3efd22a88027_temp.mp4'

    Original : https://giant.gfycat.com/CreepyZigzagFish.mp4
    Converted : https://leonardo.osnova.io/f47a2133-d0fe-6e7f-5e76-3efd22a88027/-/format/mp4/

    How to fix video quality ? I’ve tried to change crf value, but seems like it doesn’t matter.

  • OpenCV output file empty

    9 mai 2023, par Marco Bob

    I want to display 12 videos in a format of 4:3 in one video. The below code runs without errors but the output file is always empty. I have tried following encoder formats :

    


    fourcc = cv2.VideoWriter_fourcc(*'mp4v')
fourcc = cv2.VideoWriter_fourcc(*'avc1')


    


    Note : the duration of the videos is not exactly identical for all.

    


    I am on Windows10 with Pycharm, Python 3.9, opencv-python=4.6.066, ffmpeg is installed with PATH variable set, 264 library seems to load fine.

    


    import cv2
import numpy as np
import math
from tqdm import tqdm

# Set the dimensions of the merged video
video_width = 1920
video_height = 1080

# Set the dimensions of each video
sub_video_width = 480
sub_video_height = 360

# Set the margin between each video
margin = 20

# Create a black background frame
bg_frame = np.zeros((video_height, video_width, 3), dtype=np.uint8)

file_name_list = ['CAM010000000_compressed.mp4', 'CAM020000000_compressed.mp4', 'CAM030000000_compressed.mp4', 'CAM040000000_compressed.mp4', 'CAM050000000_compressed.mp4', 'CAM060000000_compressed.mp4', 'CAM070000000_compressed.mp4', 'CAM080000000_compressed.mp4', 'CAM090000000_compressed.mp4', 'CAM100000000_compressed.mp4', 'CAM110000000_compressed.mp4', 'CAM120000000_compressed.mp4']

# Calculate the number of rows and columns
num_videos = len(file_name_list)
num_rows = 3
num_cols = 4
num_total = num_rows * num_cols

# Determine the size of each sub-clip
sub_video_x = sub_video_width + margin
sub_video_y = sub_video_height + margin

# Calculate the total video duration
total_duration = 0
for filename in file_name_list:
    cap = cv2.VideoCapture(filename)
    total_duration += cap.get(cv2.CAP_PROP_FRAME_COUNT) / cap.get(cv2.CAP_PROP_FPS)
    cap.release()

# Initialize the final video
#fourcc = cv2.VideoWriter_fourcc(*'mp4v')
#out = cv2.VideoWriter('merged_video.mp4', fourcc, 30, (video_width, video_height))

fourcc = cv2.VideoWriter_fourcc(*'avc1')
out = cv2.VideoWriter('merged_video.mp4', fourcc, 30, (video_width, video_height))

# Iterate over each row and column
for i in tqdm(range(num_rows), desc='Processing rows'):
    for j in tqdm(range(num_cols), desc='Processing columns'):
        # Calculate the index of the video to be inserted
        video_index = i * num_cols + j

        # If there is no video at this index, skip to the next one
        if video_index >= num_videos:
            continue

        # Load the sub-clip and resize it
        cap = cv2.VideoCapture(file_name_list[video_index])
        frames = []
        while True:
            ret, frame = cap.read()
            if not ret:
                break
            frames.append(frame)
        cap.release()
        clip = cv2.resize(frames[0], (sub_video_width, sub_video_height))
        for frame in frames[1:]:
            frame = cv2.resize(frame, (sub_video_width, sub_video_height))
            clip = np.concatenate((clip, frame), axis=1)

        # Calculate the position of the sub-clip
        x = sub_video_x * j + margin
        y = sub_video_y * i + margin

        # Add the filename to the sub-clip
        font = cv2.FONT_HERSHEY_SIMPLEX
        text = file_name_list[video_index]
        textsize = cv2.getTextSize(text, font, 1, 2)[0]
        text_x = x + sub_video_width - textsize[0] - margin
        text_y = y + sub_video_height - textsize[1] - margin
        cv2.putText(clip, text, (text_x, text_y), font, 1, (255, 255, 255), 2, cv2.LINE_AA)

        # Add the sub-clip to the final video
        out.write(clip) # write the sub-clip to the output video

# Release the final video
out.release()


    


  • OSError : MoviePy error : failed to read the first frame of video file

    1er août 2023, par Steve

    I am trying to extract and save a frame from an .mp4 using moviepy like so (simplified) :

    


    from moviepy.editor import *
clip = VideoFileClip('conditiontest1.mpg')
clip.save_frame('frame1.png', 20)


    


    When I run this I get :

    


    


    Traceback (most recent call last) :
    
File"C :\Users\boss\Documents\DVDFab\Video Enhancer AI\join.py", line 23, > in 
clip = VideoFileClip(d + f + '.mp4')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
File "C :\Python311\Lib\site-packages\moviepy\video\io\VideoFileClip.py", > line 88, in init_
self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
File "C :\Python311\Lib\site-packages\moviepy\video\io\ffmpeg_reader.py", > line 73, in init_
self.lastread = self.read_frame()
^^^^^^^^^^^^^^^^^
    
File "C :\Python311\Lib\site-packages\moviepy\video\io\ffmpeg_reader.py", > line 133, in read_frame
raise IOError(("MoviePy error : failed to read the first frame of "
OSError : MoviePy error : failed to read the first frame of video file > conditiontest1.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Please update to a recent version from the website.

    


    


    Quite a few people have reported this error. The file is not corrupted, at least it plays fine in VLC. I have the latest FFMPEG. I have tried the other recommended fix, i.e. giving the full path. No help.

    


    One interesting thing is that this only seems to happen to me when I'm processing clips I've produced with moviepy, as in :

    


    from moviepy.editor import *
clip = VideoFileClip('conditiontest.mpg4')
clip1 = clip.subclip(10,60)
clip1.write_videofile('conditiontest1.mpg4',codec='libx264')


    


    That runs fine. Anyone have ideas how I can fix this ?