Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (62)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (9337)

  • Memory issues when using ffmpeg and gloss to play videos

    21 décembre 2015, par Noughtmare

    I’m trying to make a video player with haskell using ffmpeg-light, JuicyPixels and gloss. I’m now able to play video, but frames that have been played stay in memory. This causes major memory issues. How can I avoid storing all the frames in memory ?

    Here is my code :

    {-# LANGUAGE FlexibleContexts #-}
    module Main where

    -- For my own code:
    import Graphics.Gloss
    import Codec.FFmpeg
    import Codec.FFmpeg.Juicy
    import Codec.Picture
    import Control.Applicative
    import Data.Maybe
    import Graphics.Gloss.Juicy
    import Control.Monad (when, join)
    import Codec.FFmpeg.Decode
    import Codec.FFmpeg.Enums
    import Control.Monad.Error.Class
    import Control.Arrow (first)
    import Control.Monad.Except (runExceptT)
    import Graphics.Gloss.Interface.IO.Animate
    import Data.IORef

    -- Temporary hardcoded resolution
    resolution :: (Int,Int)
    resolution = (640, 360)

    main :: IO ()
    main = do
       -- First initialize ffmpeg, this needs to be run before other ffmpeg functions
       initFFmpeg
       -- Open the samplevideo for reading. video :: IO (IO (Maybe (AVFrame, Double)), IO ())
       video <- runExceptT $ frameReaderTime' avPixFmtRgb24 "SampleVideo_640x360_1mb.flv"
       either
             -- This code gets called when the frameReader reports an error
             (const $ putStrLn "Can't read file")
             -- This opens a new window and plays the video in it on a white background
             (animateFixedIO (InWindow "Nice Window" resolution (10, 10)) white . frameAtWait . fst)

             video

    -- This finds the frame at given time
    frameAtWait :: IO (Maybe (AVFrame, Double)) -> Float -> IO Picture
    frameAtWait getFrame time = do
       -- This gets the next frame from the video
       (frame, t) <- fromJust <$> getFrame
       -- t has to be converted from Double to Float
       let t' = realToFrac t
           -- The difference between the requested time and the actual frame time
           difference = t' - time
       -- If the frame is not yet supposed to be shown
       if difference > 0 then do
           -- Wait until it is
           threadDelay . round . (* 1000000) $ difference
           -- then return it
           fromJust <$> frameToPicture frame
       else
           -- return it immediately
           fromJust <$> frameToPicture frame

    -- This function converts a ffmpeg internal AVFrame to a gloss picture
    frameToPicture :: AVFrame -> IO (Maybe Picture)
    frameToPicture frame = do
       -- convert it to a juicypixels dynamicimage
       dynImage <- toJuicy frame
       -- then convert it to a gloss picture and return it
       return . join $ fmap fromDynamicImage dynImage
  • ffmpeg ignores seg_duration with svt-av1

    25 décembre 2022, par Asav Mali

    I'm trying to convert a mp4 file containing a HEVC HDR10 stream to AV1 using SVT-AV1 with ffmpeg. For some reason the seg_duration parameter gets ignored :

    


    


    /usr/bin/ffmpeg -i "/tmp/VODProcessing/testclip.mp4" -map 0:0 -c:v
libsvtav1 -b:v 1048576 -maxrate:v 1101004 -bufsize 4194304 -vf
zscale=width=640:height=480 -svtav1-params
"tile-columns=0:tile-rows=0:scd=0:color-primaries=9:transfer-characteristics=16:matrix-coefficients=9:input-depth=10:fast-decode=1:mastering-display=G(0.265,0.69)B(0.15,0.06)R(0.68,0.32)WP(0.3127,0.329)L(4000.0,0.005):content-light=368,226:enable-hdr=1:color-range=1"
-pix_fmt yuv420p10le -color_trc smpte2084 -color_primaries bt2020 -colorspace bt2020nc -chroma_sample_location:v topleft -color_range:v pc -max_muxing_queue_size 1024 -preset 7 -bf 0 -force_key_frames
"expr:gte(t,n_forced*2)" -keyint_min 48 -use_timeline 1 -use_template
1 -map_metadata -1 -map_chapters -1 -f hls -seg_duration 4 -hls_time 4
-streaming 1 -hls_list_size 0 -hls_segment_filename "/tmp/VODProcessing/output/testclip/v-av01-480p-av01.0.12M.10_PQ/f-%04d.m4s"
-hls_fmp4_init_filename "init-v-av01-480p-av01.0.12M.10_PQ.m4s" -hls_segment_type fmp4 -hls_playlist_type vod -movflags frag_keyframe+frag_every_frame+write_colr+prefer_icc+skip_trailer+faststart
-hls_flags independent_segments -strict experimental "/tmp/VODProcessing/output/testclip/v-av01-480p-av01.0.12M.10_PQ/master.m3u8"

    


    


    Using a similar command and transcoding HEVC to HEVC works as expected and the segment duration is fine. Does this make any sense ? Checking the generated master.m3u8 file always gives me this for AV1 :

    


    #EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:7
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MAP:URI="init-v-av01-480p-av01.0.12M.10_PQ.m4s"
#EXTINF:6.715042,
f-0000.m4s
#EXTINF:6.715042,
f-0001.m4s
#EXTINF:6.715042,
f-0002.m4s
#EXTINF:6.715042,
f-0003.m4s
#EXTINF:6.715042,
f-0004.m4s
#EXTINF:6.715042,
f-0005.m4s
#EXTINF:6.715042,
f-0006.m4s
#EXTINF:6.715042,
f-0007.m4s
#EXTINF:6.715042,
f-0008.m4s
#EXTINF:6.715042,
f-0009.m4s
#EXTINF:6.715042,
f-0010.m4s
#EXTINF:6.715042,
f-0011.m4s
#EXTINF:6.715042,
f-0012.m4s
#EXTINF:6.715042,
f-0013.m4s
#EXTINF:6.715042,
f-0014.m4s
#EXTINF:6.715042,
f-0015.m4s
#EXTINF:0.583917,
f-0016.m4s
#EXT-X-ENDLIST


    


    As you can see, the segments are not 4 seconds long as defined in my command, they are 6.715042 seconds long, why that ???

    


    Thanks in advance

    


  • ffmpeg stream segmenting loses some frames after initialization

    17 février 2020, par zerociudo

    I use this ffmep command to get stream from usb camera and segment videos of 1 seconds

    ffmpeg -i /dev/video0 -pix_fmt yuv420p -vcodec libx264 \
                     -r 15 -x264opts keyint=15:min-keyint=15 -crf 19 \
                     -vf drawtext='expansion=strftime:fontfile='/usr/share/fonts/cantarell/Cantarell-Light.otf':fontsize=28:fontcolor=white:shadowcolor=black:shadowx=2:shadowy=1:text='%Y-%m-%d\ %H\\\\:%m\\\\:%S':x=200:y=200'" \
                     -f segment -reset_timestamps 1 -segment_time 1 -segment_format mp4 \
                     -strftime 1 -map 0 output/%Y-%m-%d-%H:%M:%S.mp4 \

    The output that I get is

    Parsed_drawtext_0 @ 0x5633950a66c0] Using "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
    [Parsed_drawtext_0 @ 0x5633950a66c0] expansion=strftime is deprecated.
    [libx264 @ 0x5633950a1680] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    [libx264 @ 0x5633950a1680] profile High, level 3.1
    [libx264 @ 0x5633950a1680] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=10 keyint_min=6 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=19.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    [segment @ 0x56339509fac0] Opening 'output/2020-02-17-13:39:14.mp4' for writing
    Output #0, segment, to 'output/%Y-%m-%d-%H:%M:%S.mp4':
     Metadata:
       encoder         : Lavf58.20.100
       Stream #0:0: Video: h264 (libx264), yuv420p, 1280x720, q=-1--1, 10 fps, 10240 tbn, 10 tbc
       Metadata:
         encoder         : Lavc58.35.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    [segment @ 0x56339509fac0] Opening 'output/2020-02-17-13:39:18.mp4' for writing
    [segment @ 0x56339509fac0] Opening 'output/2020-02-17-13:39:19.mp4' for writing
    [segment @ 0x56339509fac0] Opening 'output/2020-02-17-13:39:20.mp4' for writing

    You can clearly see that first video is output/2020-02-17-13:39:14.mp4, then something happens and the next video is output/2020-02-17-13:39:18.mp4. After this I lose 3 seconds and my whole videos are delayed by 3 seconds.

    Is my command incorrect or is there something else could cause it ?