
Recherche avancée
Autres articles (105)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (11409)
-
Video codec not supported error when adding audio to mp4
18 février 2019, par WPMedI work on an application which you can use to make still photos move. It’s basically a png sequence to mp4 converter.
Recently we introduced a feature where users can add sound effects to the video.
Since we released this feature, some users experience problems with the exported video. When they save the file and try to play it, they get a "Video codec not supported" error message. All they get is a black screen, and the audio playing in the background. I use FFmpeg to add audio (in mp3 format) to the mp4 video.
Here’s an example video, which plays fine on my Mac and on my Samsung Galaxy S6 and S8, but buggy on Samsung SM-A310F (Android 7.0). This is how it looks like on the device.
I tried to re-encode this video with all the FFmpeg commands I could find, but none of them seemed to work. Can someone spot something that’s not compatible with Android by analyzing the video I linked ? -
Changing video encoding quality : Raspberry pi+v4l2 (ffmpeg or direct v4l2 API)
24 octobre 2023, par Bill ShubertWe are using a raspberry pi 4 to acquire video. Using the x264 library for software encoding, we were able to select a usable quality level (generally in the 16-20 range), but the compression speed was much too slow to keep up with the video feed. We switched to ffmpeg's v4l2 hardware encoder, and it's plenty fast enough to keep up with the incoming video, but now the output is poor quality, too low to be usable for our application. We have tried the ffmpeg -crf flag from 20 all the way down to 5, and it seems to have little or no effect on the video quality. I dug through the ffmpeg source code and can't find any references to "crf", "quality", or even compression rate in the v4l2 codec of ffmpeg.


Is there a way to change the quality level of your encoded video using the PI's v4l2 hardware video encoder ? If so, does ffmpeg support it in some way ? Hopefully I just missed how to pass it in. If raspi+video4linux does support selecting output quality, but ffmpeg doesn't use it, then I could either patch ffmpeg or write my own code to drive v4l2, but it's not a simple API to use so I'd rather stay with ffmpeg if I can.


-
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)