
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (29)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (3060)
-
FFmpeg scale and watermark filters with VAAP gives error "Cannot allocate memory." [closed]
8 février 2024, par Diz-XI'm attempting to transcode any uploaded video on our website into H.264 using an ARC GPU (VAAPI). While I've achieved functionality, ffmpeg crashes after a certain period, displaying the error message : "Error while filtering : Cannot allocate memory."


The following is the ffmpeg command is used transcode videos to H.264 :




ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD129 -y -i '/Media/001.mp4' -codec:v h264_vaapi -movflags +faststart -f mp4 -b:v 500k -maxrate 1000k -bufsize 500k -vf "movie=/Watermarks/video-watermark.png,hwupload [watermark] ; [in] scale_vaapi=trunc(iw/2)*2:trunc(ih/2)*2 [scale] ; [scale][watermark] overlay_vaapi=main_w-overlay_w:main_h-overlay_h [out]" -an -pass 1 -passlogfile /tmp/91f13b11b0ccd5195b588fb204da6626 -map_metadata -1 /dev/null




We ensure that the video is scaled to the appropriate video dimensions expected by H.264 codec , we use the "scale_vaapi=trunc(iw/2)*2:trunc(ih/2)*2" filter for this. We also apply a watermark to the video using the "overlay_vaapi=main_w-overlay_w:main_h-overlay_h" filter.


If I omit the ",hwupload" after the "movie=" statement, I encounter the following error : "Impossible to convert between the formats supported by the filter 'Parsed_movie_0' and the filter 'auto_scale_0'."


The "-filter-complex" results in the identical error : "Error while filtering : Cannot allocate memory.".


Does anyone have insights on how to enable hardware-accelerated transcoding for this ?


-
cv2/ffmpeg "grabFrame packet read max attempts exceeded" error after exactly reading certain number of frames
6 février, par banjaxingI am using OpenCV to extract frames from videos, run a segmentation AI model, and save the frames and masks to a folder. When I run my code to extract the frame from I encounter the error "grabFrame packet read max attempts exceeded" after processing a certain number of frames. This issue occurs consistently for the same videos across multiple environments.


Error message :


[ WARN:0@379.898] global cap_ffmpeg_impl.hpp:1541 grabFrame packet read max attempts exceeded, if your video have multiple streams (video, audio) try to increase attempt limit by setting environment variable OPENCV_FFMPEG_READ_ATTEMPTS (current value is 10000)



Minimum Reproducible Example


import os
import cv2

videofilename = "test.mp4"
capture = cv2.VideoCapture(videofilename)
frameNum = 0

createfolder = os.getcwd() + '/' + videofilename.split(".")[0] + '/'
if not os.path.exists(createfolder):
 os.makedirs(createfolder)
 os.makedirs(createfolder + "/frames/")

while True:
 success, frame = capture.read()
 if success is False:
 break
 frameNum += 1
 framedownloadname = videofilename.split(".")[0] + '-fr' + str(frameNum) + '.jpg'
 framedownloadloc = createfolder + '/frames/' + framedownloadname
 print(framedownloadloc)
 cv2.imwrite(framedownloadloc, frame)
 img = cv2.imread(framedownloadloc)
 img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

capture.release()



As suggested in error, I increased the OPENCV_FFMPEG_READ_ATTEMPTS env variable up to 10000. However, this seems to have little to no effect on the number of frames before the error appears.


-
the "non-monotonic DTS in output stream " error while concatenation even after reencoded input files
19 juin 2024, par nishhi I am trying to write a Python program that is trying to first edit different videos separately under the heading "intro" "story" and "byte" with the help of FFmpeg and Python subprocess module and then concatenate them in the function named "bind". At first, I encountered this "Non-monotonic DTS in output stream" then i reencoded the input files before concatenating them but i am still getting this error


# function to assemble all the videos 



def bind() :


bunch = ["final_intro.mp4","final_story.mp4","finalbite.mp4"]
new_bunch =[]
for video in bunch:
 name = f"re_{video}"
 re_command =[
 "ffmpeg", "-y",
 "-i", video,
 "-c:v", "libx264",
 "-c:a", "aac",
 "-strict", "experimental",
 "-b:a", "192k",
 name
 ]
 subprocess.run(re_command)
 new_bunch.append(name)
 

with open("concat_list_final.txt", "w") as f:
 for video in new_bunch:
 f.write(f"file './{video}'\n")
 
command_final = [ 
 "ffmpeg", "-y",
 "-f", "concat",
 "-safe", "0",
 "-i", "concat_list_final.txt",
 "-c", "copy",
 "done.mp4"
]
subprocess.run(command_final)
for video in new_bunch:
 os.remove(video)
os.remove("final.mp4")
os.remove("updated_final.mp4")
os.remove("concat_list_final.txt")


return "done.mp4"



for reference this is the error messages :-


[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14cf16040] Auto-inserting h264_mp4toannexb bitstream filter [mp4 @ 0x12ce06880] Non-monotonic DTS in output stream 0:0 ; previous : 152933, current : 127760 ; changing to 152934. This may result in incorrect timestamps in the output file. [mp4 @ 0x12ce06880] Non-monotonic DTS in output stream 0:0 ; previous : 152934, current : 128272 ; changing to 152935. This may result in incorrect timestamps in the output file..........