
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (7)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (2513)
-
Better Image Quality with Python OpenCV
6 avril 2023, par bozolinoI use OpenCV to capture webcam video as frames to a list variable, then write that list to disk both as image sequence and as a video file. The image quality is fine. But the video is horribly compressed, with a bitrate of less than 4mbit, sometimes even less than 3mbit.


I've spent days and nights on Google finding solutions, tried many fourccs and other wrappers like WriteGear and ffmpeg-python, but to no avail.


Can anyone please tell me how I


a) specify the bitrate for my H.264 file, and


b) choose a lossless compression codec ?


(Python 3.10 on MacOS MacBook Pro M1 / MacOS 13.0.1)


# ::::: import libraries and set variables

import cv2, time, os, shutil, datetime as dt
frames = []
frame_dimensions_known = False

# ::::: define file and folder names

output_folder_name = "output"
frame_folder_name = "frames"
video_file_name = "video.mp4"
frame_file_name = "frame_x.jpg"

# ::::: create output folders and paths

path_script = os.path.abspath(os.path.dirname(__file__))
path_output = os.path.join(path_script,output_folder_name)
if not os.path.exists(path_output):
 os.mkdir(path_output)
 path_session_fold
path_session_folder = os.path.join(
 path_script,
 output_folder_name,
 dt.datetime.now().strftime("%y%m%d_%H%M%S"))
os.mkdir(path_session_folder)
path_video = os.path.join(path_session_folder,video_file_name)
path_frames = os.path.join(path_session_folder,frame_folder_name)
os.mkdir(path_frames)


# ::::: open webcam stream

vcap = cv2.VideoCapture(0)
start_time = (time.time() * 1000)
if vcap.isOpened() is False:
 print("[Exiting]: Error accessing webcam stream.")
 exit(0)

# ::::: read frames

while True:
 _grabbed, _frame = vcap.read()
 if _grabbed is False:
 print('[Exiting] No more frames to read')
 exit(0)

 # ::::: get frame dimensions on first read
 if not frame_dimensions_known:
 height, width, channels = _frame.shape
 frame_dimensions_known = True

 # ::::: append frame to list
 frames.append(_frame)

 # ::::: process frames
 pass

 # ::::: display frame
 cv2.imshow("cam", _frame)
 if cv2.waitKey(1) == ord("q"):
 break

# ::::: close webcam stream

vcap.release()
cv2.destroyAllWindows()

# ::::: calculate frame rate

stop_time = (time.time() * 1000)
total_seconds = (stop_time - start_time) / 1000
fps = len(frames) / total_seconds

# ::::: open video writer

fourcc = cv2.VideoWriter_fourcc(*'mp4v')
video_writer = cv2.VideoWriter(
 path_video,
 fourcc,
 fps,
 (width, height)
)

# ::::: write frames to disk as files and video

frame_number = 0
for frame in frames:

 # ::::: write video

 video_writer.write(frame) # Write out frame to video

 # ::::: construct image file path

 frame_number = frame_number + 1
 frame_number_file = str(frame_number).zfill(4)
 frame_name = frame_file_name.replace('x',frame_number_file)
 frame_path = os.path.join(path_frames,frame_name)

 # ::::: write image

 cv2.imwrite(
 frame_path,
 frame,
 [cv2.IMWRITE_JPEG_QUALITY, 100]
 )

# ::::: clean up

video_writer.release
print (f"Written {frame_number} frames at {fps} FPS.")




-
Screenshot of video file in Electron Angular project without ffmpeg
15 juin 2022, par Gary KlasenWithin my Electron Angular project, I want to preview a video file which is stored locally on Windows / MacOS within a frame, like this :




On the left side, currently, there is a placeholder image. But i want to have a snapshot out of the video, it is not important at which position of the video this is taken.


Our attempt at the moment is to use
fluent-ffmpeg
library from npm :

var ffmpeg = require('fluent-ffmpeg');

let command = new ffmpeg({source: "MY_VIDEO_PATH"}).inputOptions('-protocol_whitelist file,http,https,tcp,tls,crypto')

command.takeScreenshots({
 count: 1,
 timemarks: ['5%'],
 filename: "MY_FILENAME"
}, "DESTINATION_FOLDER_PATH_FOR_THUMB");



It takes the screen after 5% of the video would have been played. However, this requires ffmpeg executable to be present, which actually costs more space for the application as we want to use.


So : Can i pick out a screenshot out of a video file without using additional executables like ffmpeg ? If there are some suitable npm libaries, this would be also fine, as they are a lot smaller.


-
ffmpeg is failing to load shared libraries after a ./configure with a prefix inside a conda environment
30 janvier 2024, par user3133806I am using
conda
and building ffmpeg from source within that environment.

I ran the following commands :


conda create --name my_conda_env
conda activate my_conda_env
# Now I am in the conda environment
# $CONDA_PREFIX is /home/myuser/.conda/envs/my_conda_env/bin/ffmpeg

# Checkout ffmpeg code
# git checkout ...

./configure --prefix=$CONDA_PREFIX --enable-shared --disable-static && make distclean && make -j 100 && make install

# The above command does install the newly built ffmpeg into:
# /home/myuser/.conda/envs/my_conda_env/bin/ffmpeg

# However it fails to execute:
ffmpeg
ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory

# When I add the conda lib path to LD_LIBRARY_PATH it works:
LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH ffmpeg
ffmpeg version n4.2.9-4-gd7beb0c61f Copyright (c) 2000-2023 the FFmpeg developers

# I thought ./configure with a --prefix will build a binary that will search for libraries relative to itself, but that does not appear to be the case:

strace -o /tmp/strace.out ffmpeg
tail /tmp/strace.out

openat(AT_FDCWD, "/usr/lib64/haswell/x86_64/libavdevice.so.58", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/haswell/x86_64", 0x7fff65f56d90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/haswell/libavdevice.so.58", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/haswell", 0x7fff65f56d90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/avx512_1/x86_64/libavdevice.so.58", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/avx512_1/x86_64", 0x7fff65f56d90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/avx512_1/libavdevice.so.58", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/avx512_1", 0x7fff65f56d90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/x86_64/libavdevice.so.58", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/x86_64", 0x7fff65f56d90, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/libavdevice.so.58", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64", {st_mode=S_IFDIR|0555, st_size=49526, ...}, 0) = 0
writev(2, [{iov_base="ffmpeg", iov_len=6}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {i
ov_base=": ", iov_len=2}, {iov_base="libavdevice.so.58", iov_len=17}, {iov_base=": ", iov_len=2}, {iov_base="cannot open shared object file", iov_len=30}, {iov_base=": ", iov_len=2}, {iov_base="No such file or directory", iov_len=25}, {iov_base="\n", iov_len=1}], 10) = 
123



Conda documentation says not to use LD_LIBRARY_PATH here :




How can I build ffmpeg from source in a conda environment and have the binary find the .so file relative to itself ?