Recherche avancée

Médias (91)

Autres articles (40)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour 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 (6467)

  • 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 converting to .265 corrupts videos

    25 juin 2022, par Alfa

    I'm trying to convert and compress videos in React Native using FFmpegKit, what is strange is it is very slow regardless of the preset I use, Also, no matter how big the input video is, it always produces a video less than 1MB that is corrupt.
This is my first time using FFmpeg, I'm using it due to the lack of good video compressing libraries on React Native.

    


    My command looks like this :

    


    const getFFmpegCommand = (input: string, output: string) => {
  const scale = `"scale='if(gte(iw,ih),min(720,iw),-2):if(lt(iw,ih),min(720,ih),-2)'"`;
  const preset = '-preset veryfast ';
  const ffmpegCommand = `-i ${input} -y -crf 28 -vf ${scale} ${preset} -c:v libx265 ${output}`;
  return ffmpegCommand;
};


    


    This is my log output

    


        ffmpeg version v4.5-dev-3393-g30322ebe3c
    LOG   Copyright (c) 2000-2021 the FFmpeg developers
    LOG  
    LOG    built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
    LOG    configuration: --cross-prefix=i686-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/storage/light/projects/ffmpeg-kit/prebuilt/android-x86/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=i686 --cpu=i686 --target-os=android --disable-neon --disable-asm --disable-inline-asm --ar=i686-linux-android-ar --cc=i686-linux-android24-clang --cxx=i686-linux-android24-clang++ --ranlib=i686-linux-android-ranlib --strip=i686-linux-android-strip --nm=i686-linux-android-nm --extra-libs='-L/storage/light/projects/ffmpeg-kit/prebuilt/android-x86/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libx264 --enable-libxvid --enable-libx265 --enable-libvidstab --disable-sdl2 --disable-openssl --enable-zlib --enable-mediacodec --enable-gpl
    LOG    libavutil      57. 13.100 / 57. 13.100
    LOG    libavcodec     59. 15.102 / 59. 15.102
    LOG    libavformat    59. 10.100 / 59. 10.100
    LOG    libavdevice    59.  1.100 / 59.  1.100
    LOG    libavfilter     8. 21.100 /  8. 21.100
    LOG    libswscale      6.  1.102 /  6.  1.102
    LOG    libswresample   4.  0.100 /  4.  0.100
    LOG  Guessed Channel Layout for Input Stream #0.1 : mono
    LOG  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:///data/user/0/com.orbis.cybersight/files/95fdb965-5074-421f-b6b0-9e67332550ca/VID_20220625_211041.mp4':
    LOG    Metadata:
    LOG      major_brand     :
    LOG  mp42
    LOG  
    LOG      minor_version   :
    LOG  0
    LOG  
    LOG      compatible_brands:
    LOG  isommp42
    LOG  
    LOG      creation_time   :
    LOG  2022-06-25T19:11:17.000000Z
    LOG  
    LOG      location        :
    LOG  +37.4234-122.0839/
    LOG  
    LOG      location-eng    :
    LOG  +37.4234-122.0839/
    LOG  
    LOG      com.android.version:
    LOG  11
    LOG  
    LOG    Duration:
    LOG  00:00:33.68
    LOG  , start:
    LOG  0.000000
    LOG  , bitrate:
    LOG  8302 kb/s
    LOG  
    LOG    Stream #0:0
    LOG  [0x1]
    LOG  (eng)
    LOG  : Video: h264 (avc1 / 0x31637661), yuv420p(tv, gbr/reserved/reserved, progressive), 1280x720, 9007 kb/s
    LOG  , SAR 1:1 DAR 16:9
    LOG  ,
    LOG  22.69 fps,
    LOG  90k tbr,
    LOG  90k tbn
    LOG   (default)
    LOG  
    LOG      Metadata:
    LOG        creation_time   :
    LOG  2022-06-25T19:11:17.000000Z
    LOG  
    LOG        handler_name    :
    LOG  VideoHandle
    LOG  
    LOG        vendor_id       :
    LOG  [0][0][0][0]
    LOG  
    LOG      Side data:
    LOG  
    LOG  displaymatrix: rotation of -90.00 degrees
    LOG  
    LOG    Stream #0:1
    LOG  [0x2]
    LOG  (eng)
    LOG  : Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, fltp, 12 kb/s
    LOG   (default)
    LOG  
    LOG      Metadata:
    LOG        creation_time   :
    LOG  2022-06-25T19:11:17.000000Z
    LOG  
    LOG        handler_name    :
    LOG  SoundHandle
    LOG  
    LOG        vendor_id       :
    LOG  [0][0][0][0]
    LOG  
    LOG  [h264 @ 0xebd4c280] The "sub_text_format" option is deprecated: Deprecated, does nothing
    LOG  [amrnb @ 0xebd4dc00] The "sub_text_format" option is deprecated: Deprecated, does nothing
    LOG  Stream mapping:
    LOG    Stream #0:0 -> #0:0
    LOG   (h264 (native) -> hevc (libx265))
    LOG  
    LOG    Stream #0:1 -> #0:1
    LOG   (amr_nb (amrnb) -> aac (native))
    LOG  
    LOG  Press [q] to stop, [?] for help
    LOG  [aac @ 0xebd4a5d0] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
    LOG  Output #0, mp4, to '/storage/emulated/0/Android/data/com.orbis.cybersight/files/3dfb9ef6-6cb3-4adf-9777-8fb4c7762dc7.mp4':
    LOG    Metadata:
    LOG      major_brand     :
    LOG  mp42
    LOG  
    LOG      minor_version   :
    LOG  0
    LOG  
    LOG      compatible_brands:
    LOG  isommp42
    LOG  
    LOG      com.android.version:
    LOG  11
    LOG  
    LOG      location        :
    LOG  +37.4234-122.0839/
    LOG  
    LOG      location-eng    :
    LOG  +37.4234-122.0839/
    LOG  
    LOG      encoder         :
    LOG  Lavf59.10.100
    LOG  
    LOG    Stream #0:0
    LOG  (eng)
    LOG  : Video: hevc (hev1 / 0x31766568), yuv420p(tv, gbr/reserved/reserved, progressive), 720x1280 [SAR 1:1 DAR 9:16], q=2-31
    LOG  ,
    LOG  22.69 fps,
    LOG  2502k tbn
    LOG   (default)
    LOG  
    LOG      Metadata:
    LOG        creation_time   :
    LOG  2022-06-25T19:11:17.000000Z
    LOG  
    LOG        handler_name    :
    LOG  VideoHandle
    LOG  
    LOG        vendor_id       :
    LOG  [0][0][0][0]
    LOG  
    LOG        encoder         :
    LOG  Lavc59.15.102 libx265
    LOG  
    LOG      Side data:
    LOG  
    LOG  cpb:
    LOG  bitrate max/min/avg: 0/0/0 buffer size: 0
    LOG  vbv_delay: N/A
    LOG  
    LOG  
    LOG  displaymatrix: rotation of -0.00 degrees
    LOG  
    LOG    Stream #0:1
    LOG  (eng)
    LOG  : Audio: aac (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 48 kb/s
    LOG   (default)
    LOG  
    LOG      Metadata:
    LOG        creation_time   :
    LOG  2022-06-25T19:11:17.000000Z
    LOG  
    LOG        handler_name    :
    LOG  SoundHandle
    LOG  
    LOG        vendor_id       :
    LOG  [0][0][0][0]
    LOG  
    LOG        encoder         :
    LOG  Lavc59.15.102 aac