Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (21)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

  • 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 (...)

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (4363)

  • Why does OpenCV read video faster than FFMPEG ?

    17 septembre 2022, par tadejsv

    I noticed that OpenCV reads video frames almost 2x faster than FFMPEG.

    


    Why is that ? I thought all OpenCV does is call FFMPEG under the hood, possibly adding its own overhead.

    


    Here's the code I use to obtain these results

    


    import cv2
import time
import numpy as np

cap = cv2.VideoCapture("BigBuckBunny.mp4", apiPreference=cv2.CAP_FFMPEG)
frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))

start = time.perf_counter()
while True:
    ret, frame = cap.read()
    if ret is False:
        break
    assert frame.shape == (720, 1280, 3)
    assert frame.dtype == np.uint8
end = time.perf_counter()

print(f"{frames/(end-start):.1f} frames per second")
# Output: 692.3 frames per second

cap.release()


    


    For FFMPEG (using the python-ffmpeg library :

    


    import ffmpeg
import numpy as np
import time

vid_info = ffmpeg.probe("BigBuckBunny.mp4")['streams'][1]
frames = int(vid_info['nb_frames'])

process1 = (
    ffmpeg
    .input("BigBuckBunny.mp4")
    .output('pipe:', format='rawvideo', pix_fmt='bgr24')
)
print(process1.compile())
# Output: ['ffmpeg', '-i', 'BigBuckBunny.mp4', '-f', 'rawvideo', '-pix_fmt', 'bgr24', 'pipe:']


process1 = process1.run_async(pipe_stdout=True)

start = time.perf_counter()
while True:
    in_bytes = process1.stdout.read(1280 * 720 * 3)
    if not in_bytes:
        break
    frame = np.frombuffer(in_bytes, np.uint8).reshape([720, 1280, 3])
end = time.perf_counter()
print(f"{frames/(end-start):.1f} frames per second")
# Output: 373.6 frames per second
process1.wait()


    


    Here's information about the video ( 10 minutes length)

    


    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'BigBuckBunny.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomavc1mp42
    creation_time   : 2010-01-10T08:29:06.000000Z
  Duration: 00:09:56.47, start: 0.000000, bitrate: 2119 kb/s
  Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2010-01-10T08:29:06.000000Z
      handler_name    : (C) 2007 Google Inc. v08.13.2007.
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1991 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
    Metadata:
      creation_time   : 2010-01-10T08:29:06.000000Z
      handler_name    : (C) 2007 Google Inc. v08.13.2007.
      vendor_id       : [0][0][0][0]


    


    And FFMPEG and OpenCV versions :

    


    ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers


    


    opencv-python-headless        4.6.0.66


    


  • ffmpeg doesnt use all the pictures when creating a video

    9 septembre 2022, par Mikhael Karabas

    I have 75 pictures of the same size for an animation. named 0.png ... 74.png
when running ffmpeg to create a video out of them with 24 fps (commmand and log below) the resulting video instead of expected 75/24 = 3.125 sec. is 2.667 sec in lenght and consists only of first 64 frames(pictures), although ffmpeg tells it has processed 75 frames.
I have checked with

    


    ffmpeg -i output.webm out%%d.png - on the resulting video, it indeed exports 64 first frames and not the rest 11 of them.

    


    Cant undertand what am i doing wrong. please kindly advise.

    


    brief output below.

    


    complete log : https://drive.google.com/file/d/1_J7wLPU9PJZ7jztpiJ8g_bZKPZfiK02L/view?usp=sharing

    


    D:\ffmpeg\ffmpeg-64.exe -report -framerate 24 -f image2 -i %01d.png -c:v libvpx-vp9 -pix_fmt yuva420p -crf 10 -b:v 0 output.webm
ffmpeg started on 2022-09-09 at 19:03:15
Report written to "ffmpeg-20220909-190315.log"
Log level: 48
ffmpeg version 2021-12-17-git-b780b6db64-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.2.0 (Rev2, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      57. 11.100 / 57. 11.100
  libavcodec     59. 14.100 / 59. 14.100
  libavformat    59. 10.100 / 59. 10.100
  libavdevice    59.  0.101 / 59.  0.101
  libavfilter     8. 20.100 /  8. 20.100
  libswscale      6.  1.101 /  6.  1.101
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
Input #0, image2, from '%01d.png':
  Duration: 00:00:03.13, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: png, rgba(pc), 300x400, 24 fps, 24 tbr, 24 tbn
File 'output.webm' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> vp9 (libvpx-vp9))
Press [q] to stop, [?] for help
[libvpx-vp9 @ 000002dad505c8c0] v1.11.0-62-g7f45e94d9
Output #0, webm, to 'output.webm':
  Metadata:
    encoder         : Lavf59.10.100
  Stream #0:0: Video: vp9, yuva420p(tv, progressive), 300x400, q=2-31, 24 fps, 1k tbn
    Metadata:
      encoder         : Lavc59.14.100 libvpx-vp9
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=   75 fps=9.9 q=0.0 Lsize=    1056kB time=00:00:02.58 bitrate=3347.2kbits/s speed=0.342x
video:1036kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.942318%


    


  • How to convert AAC/MP4A to MP3 using FFMPEG in full length ? Audio file gets cut off after 1 second

    6 novembre 2022, par Avatar

    I have recorded an audio file with MediaRecorder on iPhone.

    


    As ffmpeg command I am using :

    


    ffmpeg -i 18380889311644327118 -ar 44100 -ac 2 -b:a 128k -c:a libmp3lame -q:a 0 18380889311644327118.mp3


    


    -i specifies the input file
-vn disables all video-streams from the input
-ar audio sampling frequency
-ac number of audio channels
-b:a bit rate
-c:a libmp3lame - codec of target file
-q:a quality set audio quality (codec-specific) (lower is better), see https://superuser.com/a/1515841

-sn disables all subtitle-streams from the input
-dn disables all data-streams from the input


    


    The console output looks like this :

    


    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '18380889311644327118':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: isomiso5hlsf
    creation_time   : 2021-12-08T15:44:06.000000Z
  Duration: 00:00:01.00, start: 0.000000, bitrate: 2258 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 2234 kb/s (default)
    Metadata:
      creation_time   : 2021-12-08T15:44:06.000000Z
      handler_name    : Core Media Audio
Stream mapping:
  Stream #0:0 -> #0:0 (aac (native) -> mp3 (libmp3lame))

Output #0, mp3, to '18380889311644327118.mp3':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: isomiso5hlsf
    TSSE            : Lavf58.29.100
    Stream #0:0(und): Audio: mp3 (libmp3lame), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2021-12-08T15:44:06.000000Z
      handler_name    : Core Media Audio
      encoder         : Lavc58.54.100 libmp3lame
size=      17kB time=00:00:01.01 bitrate= 135.5kbits/s speed=37.2x
video:0kB audio:16kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.343701%


    


    As you can see, the duration is 01.00 second. And this happens with all recorded files.

    


    How to convert the entire file (which is 12 seconds long) to its full length ?

    

    

    


    Note : It seems that the recorded file does not have a length specified. Under Windows I renamed the file, adding an extension ".m4a" and opened the file properties :

    


    m4a properties

    


    The length attribute is empty.