Recherche avancée

Médias (1)

Mot : - Tags -/ogg

Autres articles (73)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (13326)

  • How to overlay sequence of frames on video using ffmpeg-python ?

    19 novembre 2022, par Yogesh Yadav

    I tried below but it is only showing the background video.

    


    background_video = ffmpeg.input( "input.mp4")
overlay_video = ffmpeg.input(f'{frames_folder}*.png', pattern_type='glob', framerate=25)
subprocess = ffmpeg.overlay(
                          background_video,
                          overlay_video,
                        ).filter("setsar", sar=1)


    


    I also tried to assemble sequence of frames into .webm/.mov video but transparency is lost. video is taking black as background.

    


    P.s - frame size is same as background video size. So no scaling needed.

    


    Edit

    


    I tried @Rotem suggestions

    


    


    Try using single PNG image first

    


    


    overlay_video =  ffmpeg.input('test-frame.png')


    


    It's not working for frames generated by OpenCV but working for any other png image. This is weird, when I'm manually viewing these frames folder it's showing blank images(Link to my frames folder).
But If I convert these frames into the video(see below) it is showing correctly what I draw on each frame.

    


    output_options = {
                    'crf': 20,
                    'preset': 'slower',
                    'movflags': 'faststart',
                    'pix_fmt': 'yuv420p'
                }
ffmpeg.input(f'{frames_folder}*.png', pattern_type='glob', framerate=25 , reinit_filter=0).output(
                    'movie.avi',
                    **output_options
                ).global_args('-report').run()


    


    


    try creating a video from all the PNG images without overlay

    


    


    It's working as expected only issue is transparency. Is there is way to create a transparent background video ? I tried .webm/.mov/.avi but no luck.

    


    


    Add .global_args('-report') and check the log file

    


    


    Report written to "ffmpeg-20221119-110731.log"
Log level: 48
ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, image2, from './frames/*.png':
  Duration: 00:00:05.00, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: png, rgba(pc), 1920x1080, 25 fps, 25 tbr, 25 tbn
Codec AVOption crf (Select the quality for constant quality mode) specified for output file #0 (movie.avi) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Codec AVOption preset (Configuration preset) specified for output file #0 (movie.avi) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
Output #0, avi, to 'movie.avi':
  Metadata:
    ISFT            : Lavf59.27.100
  Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p(tv, progressive), 1920x1080, q=2-31, 200 kb/s, 25 fps, 25 tbn
    Metadata:
      encoder         : Lavc59.37.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=  125 fps= 85 q=31.0 Lsize=     491kB time=00:00:05.00 bitrate= 804.3kbits/s speed=3.39x    
video:482kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.772174%


    


    To draw frame I used below.

    


    for i in range(num_frames):
            transparent_img = np.zeros((height, width, 4),  dtype=np.uint8)
            cv2.line(transparent_img, (x1,y1), (x2,y2) ,(255, 255, 255), thickness=1, lineType=cv2.LINE_AA)
            self.frames.append(transparent_img)


## To Save each frame of the video in the given folder
for i, f in enumerate(frames):
    cv2.imwrite("{}/{:0{n}d}.png".format(path_to_frames, i, n=num_digits), f)





    


  • ffmpeg doesn't sometimes start reading RTSP stream from IP camera without error

    8 décembre 2022, par Petr Dub

    I've an IP camera, which provide RTSP stream. I want to read this stream, rotate it 90° and provide data for displaying video via IIS server. I have a working solution via ffmpeg, but it is not reliable. It ends after several minutes without error and it is not starting sometimes.

    


    I use this command :&#xA;ffmpeg.exe -thread_queue_size 128 -i "rtsp://<login>:<pwd>@192.168.0.201:554/live/ch0" -vf "transpose=1" -y -c:a aac -b:a 160000 -ac 1 -s 432x768 -g 50 -hls_time 2 -hls_list_size 1 -start_number 1 -hls_flags delete_segments m:\playlist.m3u8</pwd></login>

    &#xA;

    It works, but after several minutes (40 to 100) it stops without error (I have no idea why). When I restart the same ffmeg command, it sometimes doesn’t start reading the stream, but it doesn’t produce any error, the ffmpeg process is still running. Error output from ffmeg shows :

    &#xA;

    ffmpeg version 2022-11-03-git-5ccd4d3060-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with gcc 12.1.0 (Rev2, Built by MSYS2 project)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint&#xA;  libavutil      57. 40.100 / 57. 40.100&#xA;  libavcodec     59. 51.101 / 59. 51.101&#xA;  libavformat    59. 34.101 / 59. 34.101&#xA;  libavdevice    59.  8.101 / 59.  8.101&#xA;  libavfilter     8. 49.101 /  8. 49.101&#xA;  libswscale      6.  8.112 /  6.  8.112&#xA;  libswresample   4.  9.100 /  4.  9.100&#xA;  libpostproc    56.  7.100 / 56.  7.100&#xA;

    &#xA;

    The next row should be :

    &#xA;

    Input #0, rtsp, from &#x27;rtsp://<login>:<pwd>@192.168.0.201:554/live/ch0&#x27;</pwd></login>

    &#xA;

    Any ideas, what should I do ? At least to force ffmpeg end with error and not stays “running”…

    &#xA;

    Edit : I finally wrote a windows service, which starts the ffmpeg and monitors its error output. When nothing comes to this output for several seconds, it kills the ffmpeg process and starts a new one.

    &#xA;

  • av::av_encode_video produces blurred video from crisp files

    9 janvier 2023, par Abdirizak

    I am using the av::av_encode_video() function to produce a .mp4 video from png files, as in this answer. I pay special attention for the png files to be perfectly crisp, i.e. I plot matrices to png with exactly the same dimensions, so that every matrix cell maps to one cell in the png. Here is code to illustrate what I mean :

    &#xA;

    library(av)&#xA;&#xA;n.times &lt;- 24*10&#xA;n.row &lt;- 50&#xA;n.col &lt;- 26&#xA;&#xA;out.dir &lt;- "/Users/Abdirizak/Documents/some/directory/"&#xA;&#xA;for (i in 1:n.times) {&#xA;   &#xA;   current.mat &lt;- matrix(data = rnorm(n.row*n.col), nrow = n.row, ncol = n.col)&#xA;   &#xA;   setwd(out.dir)&#xA;   png(filename = paste0(i, ".png"), width = n.row, height = n.col)&#xA;   &#xA;   par(mar = rep(0,4))&#xA;   image(current.mat)&#xA;   &#xA;   dev.off()&#xA;   &#xA;}&#xA;&#xA;setwd(out.dir)&#xA;png.files &lt;- paste0(out.dir, list.files(pattern = ".png$"))&#xA;&#xA;av::av_encode_video(input = png.files, output = "000.mp4", framerate = 24)&#xA;

    &#xA;

    Now, even though my input .png files are perfectly crisp, the output .mp4 video is blurry. How can I prevent that from happening ? I.e. how can I get a perfectly crisp video ? (I am aware that this will likely inflate the file size of the .mp4 file)

    &#xA;

    I already digged a bit into the vfilter argument of av_encode_video() and the underlying ffmpeg filter graphs on here, but could not yet really get the hang on it.

    &#xA;

    I am looking at the .mp4 file through QuickTime Player on MacOS Ventura 13.0.1, and using R version 4.2.2 through RStudio 2022.12.0.353

    &#xA;

    Edit 9.1.2023 :

    &#xA;

    To further clarify, here is an example screenshot of a png image (not the original png file because that one appears too small here) :

    &#xA;

    enter image description here

    &#xA;

    As I said, a perfectly crisp image.

    &#xA;

    On the other hand, a screenshot of the .mp4 movie looks like this :

    &#xA;

    enter image description here

    &#xA;

    Somewhat unsatisfactory. Any suggestions are welcome.

    &#xA;