
Recherche avancée
Autres articles (98)
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (12426)
-
libavformat/hls : add support for decryption of HLS media segments encrypted using...
21 septembre 2021, par Nachiket Taratelibavformat/hls : add support for decryption of HLS media segments encrypted using SAMPLE-AES encryption method
Apple HTTP Live Streaming Sample Encryption :
https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption
Signed-off-by : Nachiket Tarate <nachiket.programmer@gmail.com>
Signed-off-by : Steven Liu <lq@chinaffmpeg.org> -
Python OpenCV VideoCapture Color Differs from ffmpeg and Other Media Players
17 avril 2024, par cliffsuI’m working on video processing in Python and have noticed a slight color difference when using
cv2.VideoCapture
to read videos compared to other media players.



I then attempted to read the video frames directly using ffmpeg, and despite using the ffmpeg backend in OpenCV, there are still differences between OpenCV’s and ffmpeg’s output. The frames read by ffmpeg match those from other media players.




Below are the videos I’m using for testing :






Here is my code :


import cv2
import numpy as np
import subprocess

def read_frames(path, res):
 """Read numpy arrays of video frames. Path is the file path
 and res is the resolution as a tuple."""
 args = [
 "ffmpeg",
 "-i",
 path,
 "-f",
 "image2pipe",
 "-pix_fmt",
 "rgb24",
 "-vcodec",
 "rawvideo",
 "-",
 ]

 pipe = subprocess.Popen(
 args,
 stdout=subprocess.PIPE,
 stderr=subprocess.DEVNULL,
 bufsize=res[0] * res[1] * 3,
 )

 while pipe.poll() is None:
 frame = pipe.stdout.read(res[0] * res[1] * 3)
 if len(frame) > 0:
 array = np.frombuffer(frame, dtype="uint8")
 break

 pipe.stdout.close()
 pipe.wait()
 array = array.reshape((res[1], res[0], 3))
 array = cv2.cvtColor(array, cv2.COLOR_RGB2BGR)
 return array

ORIGINAL_VIDEO = 'test3.webm'

array = read_frames(ORIGINAL_VIDEO, (1280, 720))

cap = cv2.VideoCapture(ORIGINAL_VIDEO, cv2.CAP_FFMPEG)
while cap.isOpened():
 ret, frame = cap.read()
 if not ret:
 break
 print(frame.shape)
 cv2.imshow("Opencv Read", frame)
 cv2.imshow("FFmpeg Direct Read", array)
 cv2.waitKeyEx()
 cv2.waitKeyEx()
 break
cap.release()



I’ve attempted to use different media players to compare
cv2.VideoCapture
and ffmpeg’s frame reading, to confirm that the issue lies with opencv. I’m looking to determine whether it’s a bug in OpenCV or if there are issues in my code.

EDIT :


Just use the following code to check the difference between opencv read and ffmpeg read.


cv2.imshow('test', cv2.absdiff(array, frame)*10)
cv2.waitKey(0)





-
fftools/ffmpeg : store stream media type in OutputStream
11 avril 2023, par Anton Khirnovfftools/ffmpeg : store stream media type in OutputStream
Reduces access to a deeply nested muxer property
OutputStream.st->codecpar->codec_type for this fundamental and immutable
stream property.Besides making the code shorter, this will allow making the AVStream
(OutputStream.st) private to the muxer in the future.