
Recherche avancée
Autres articles (29)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
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 (...) -
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)
Sur d’autres sites (5141)
-
cbs_h265 : read/write content light level information SEI message
10 mai 2018, par Haihao Xiang -
Haskell - Turning multiple image-files into one video-file using the ffmpeg-light package
25 avril 2021, par oRoleBackground

I wrote an application for image-processing which uses theffmpeg-light
package to fetch all the frames of a given video-file so that the program afterwards is able to apply grayscaling, as well as edge detection alogrithms to each of the frames.

Now I'm trying to put all of the frames back into a single video-file.


Used Libs

ffmpeg-light-0.12.0

JuicyPixels-3.2.8.3

...

What have I tried ?

I have to be honest, I didn't really try anything because I'm kinda clueless where and how to start. I saw that there is a package calledCommand
which allows running processes/commands using the command line. With that I could use ffmpeg (notffmpeg-light
) to create a video out of image-files which I would have to save to the hard drive first but that would be kinda hacky.
Within the documentation of
ffmpeg-light
on hackage (ffmpeg-light docu) I found the frameWriter function which sounds promising.

frameWriter :: EncodingParams -> FilePath -> IO (Maybe (AVPixelFormat, V2 CInt, Vector CUChar) -> IO ()) 



I guess
FilePath
would be the location where the video file gets stored but I can't really imagine how to apply the frames asEncodingParams
to this function.

Others

I can access :

- 

r
,g
,b
,a
as well asy
.a
values- image width / height / format






Question

Is there a way to achieve this using theffmpeg-light
package ?

As the
ffmpeg-light
package lacks of documentation when it comes to conversion from images to video, I really would appreciate your help. (I do not expect a fully working solution.)

Code

The code that reads the frames :

-- Gets and returns all frames that a given video contains
getAllFrames :: String -> IO [(Double, DynamicImage)]
getAllFrames vidPath = do 
 result <- try (imageReaderTime $ File vidPath) :: IO (Either SomeException (IO (Maybe (Image PixelRGB8, Double)), IO()))
 case result of 
 Left ex -> do 
 printStatus "Invalid video-path or invalid video-format detected." "Video" 
 return []
 Right (getFrame, _) -> addNextFrame getFrame [] 

-- Adds up all available frames to a video.
addNextFrame :: IO (Maybe (Image PixelRGB8, Double)) -> [(Double, DynamicImage)] -> IO [(Double, DynamicImage)]
addNextFrame getFrame frames = do
 frame <- getFrame
 case frame of 
 Nothing -> do 
 printStatus "No more frames found." "Video"
 return frames
 _ -> do 
 newFrameData <- fmap ImageRGB8 . swap . fromJust <$> getFrame 
 printStatus ("Frame: " ++ (show $ length frames) ++ " added.") "Video"
 addNextFrame getFrame (frames ++ [newFrameData]) 



Where I am stuck / The code that should convert images to video :


-- Converts from several images to video
juicyToFFmpeg :: [Image PixelYA8] -> ?
juicyToFFmpeg imgs = undefined



-
Using ffmpeg dshow option "HP Webcam Splitter" leaves a process running and the webcam light on
7 septembre 2017, par Matt MahonyI am streaming from a webcam using a command line like (simplified) :
ffmpeg.exe -f dshow -i video="HP Webcam Splitter" -c:v libx264 -an -f rtp rtp://localhost:50041
When the "HP Webcam Splitter" option is used, it launches a "HPMediaSmartWebcam.exe" process. This is a process used to stream the webcam to more than one process. My problem is when ffmpeg closes, that executable is still running, and it leaves the webcam light on.
I can manually kill the HPMediaSmartWebcam.exe process, but I’m hoping for a cleaner way to do this. Does ffmpeg have any idea another external process was launched ? Can ffmpeg detect that and close the new process ? Or is this a bug in the HPMediaSmartWebcam.exe program ?