Recherche avancée

Médias (10)

Mot : - Tags -/wav

Autres articles (86)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

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

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (5541)

  • ffmpeg conversion from h264 for webserver

    11 juin 2021, par Xav

    I'm working on a system to record videos through RPi (picamera, h264 format), export (rsync) 10s segments of videos to a distant webserver, and trying to concatenate those segment into a single video file to read on the webserver.

    


    Simplified code to record on RPi :

    


    import os
import datetime as dt
import picamera

camera = picamera.PiCamera()
camera.resolution = (1920, 1080)
camera.framerate = 25
duration = 10 #sec

[...]

camera.start_recording(filename, format='h264')
while True:
    filename = get_timestamped_filename()
    camera.split_recording(filename)
    camera.wait_recording(duration)

camera.stop_recording()


    


    For the conversion, I tried many options/searches without success. I can get the video (.ts, .mp4, .ogv, .webm) working on majority of web browser but never on ios/android (chrome/safari).
As example of test & fail with ffmpeg : https://gist.github.com/jaydenseric/220c785d6289bcfd7366

    


    When I don't try to concatenate but only convert those video :

    


    ffmpeg -i input.h264 -profile:v baseline -level 3.0 output.mp4


    


    I have the following output :

    


    ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, h264, from 'input.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x480, 25 fps, 25 tbr, 1200k tbn, 50 tbc
File 'output.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x556885757980] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x556885757980] profile Constrained Baseline, level 3.0
[libx264 @ 0x556885757980] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=9 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 720x480, q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.35.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=  195 fps=0.0 q=-1.0 Lsize=     229kB time=00:00:07.76 bitrate= 241.3kbits/s speed=20.4x    
video:227kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.687068%
[libx264 @ 0x556885757980] frame I:1     Avg QP:23.86  size: 24802
[libx264 @ 0x556885757980] frame P:194   Avg QP:22.46  size:  1067
[libx264 @ 0x556885757980] mb I  I16..4: 26.4%  0.0% 73.6%
[libx264 @ 0x556885757980] mb P  I16..4:  1.1%  0.0%  0.4%  P16..4: 20.3%  1.5%  0.6%  0.0%  0.0%    skip:76.1%
[libx264 @ 0x556885757980] coded y,uvDC,uvAC intra: 34.9% 54.4% 12.3% inter: 1.8% 12.4% 0.0%
[libx264 @ 0x556885757980] i16 v,h,dc,p: 45% 14% 17% 23%
[libx264 @ 0x556885757980] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 31% 11%  4%  4%  4%  4%  4%  4%
[libx264 @ 0x556885757980] i8c dc,h,v,p: 51% 17% 28%  4%
[libx264 @ 0x556885757980] ref P L0: 80.0% 10.6%  9.4%
[libx264 @ 0x556885757980] kb/s:237.75


    


    But still, impossible to play on mobile web (iOS, Android)

    


    Is there anything I'm doing wrong, either in the capturing process or conversion ?
Do you have any recommendations ?

    


  • Something wrong with recording video and merging audio and video by using FFmpeg

    16 mars 2014, par VaFancy

    At the beginning, I have to admit that I am a newbie in FFmpeg and also raspbian. Unfortunately, I need to solve this problem as soon as possible.

    I tried to record videos on my Raspberry PI by using PIcamera and USB webcam separately. When I used command :

    ffmpeg -t 10 -f video4linux2 -r 25 -i /dev/video0 out.h264

    However, something was very wrong because there was nothing saved in that video file. I copy the log.

    [video4linux2,v4l2 @ 0x267ad80] The driver changed the time per frame from 1/25 to 1/30
    Input #0, video4linux2,v4l2, from '/dev/video0':
     Duration: N/A, start: 37562.908020, bitrate: 147456 kb/s
       Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    File 'out.h264' already exists. Overwrite ? [y/N] y
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x267ca60] using cpu capabilities: ARMv6
    [libx264 @ 0x267ca60] profile High 4:2:2, level 3.0, 4:2:2 8-bit
    Output #0, h264, to 'out.h264':
     Metadata:
       encoder         : Lavf55.34.101
       Stream #0:0: Video: h264 (libx264), yuv422p, 640x480, q=-1--1, 90k tbn, 25 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo -> libx264)
    Press [q] to stop, [?] for help
    DTS 140730117085, next:18648459 st:0 invalid dropping00.00 bitrate=N/A    
    PTS 140730117085, next:18648459 invalid dropping st:0
    DTS 140740452429, next:6538221 st:0 invalid dropping:00.00 bitrate=N/A    
    PTS 140740452429, next:6538221 invalid dropping st:0
    frame=   44 fps=1.1 q=28.0 size=      18kB time=00:00:00.04 bitrate=3712.6kbits/
    frame=   45 fps=0.8 q=28.0 size=      22kB time=00:00:00.08 bitrate=2262.8kbits/
    frame=   46 fps=0.7 q=28.0 size=      27kB time=00:00:00.12 bitrate=1813.4kbits/
    frame=   47 fps=0.6 q=28.0 size=      30kB time=00:00:00.16 bitrate=1559.2kbits/
    frame=   48 fps=0.5 q=28.0 size=      34kB time=00:00:00.20 bitrate=1397.7kbits/
    frame=   49 fps=0.5 q=28.0 size=      39kB time=00:00:00.24 bitrate=1324.3kbits/
    frame=   50 fps=0.4 q=28.0 size=      42kB time=00:00:00.28 bitrate=1241.7kbits/

    As you can see, the size of each frame was only few kb and fps was so low. Thus each frame was taken by using a long time(4s in this case). Then I test my USB webcam by using command :

    ffplay -f video4linux2 /dev/video0

    The video stream which displayed on the screen was so unnatural. It looked like there was such a long delay between each frame. So the video was hardly moved. The log I have copied :

    pi@raspberrypi ~ $ ffplay -f video4linux2 /dev/video0
    avplay version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2003-2013 the Libav developers
     built on Mar 31 2013 13:58:10 with gcc 4.6.3
    [video4linux2 @ 0x1ad83c0] Estimating duration from bitrate, this may be inaccurate
    Input #0, video4linux2, from '/dev/video0':
     Duration: N/A, start: 36107.154598, bitrate: 147456 kb/s
       Stream #0.0: Video: rawvideo, yuyv422, 640x480, 147456 kb/s, 30 tbr, 1000k tbn, 30 tbc
    [avsink @ 0x1ad9960] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
    [scale @ 0x1ad9d20] w:640 h:480 fmt:yuyv422 -> w:640 h:480 fmt:yuv420p flags:0x4
    36163.33 A-V:  0.000 s:0.0 aq=    0KB vq= 3000KB sq=    0B f=8/8

    The final problem is that no sound was added in video file when I tried to add some in. I used the command :

    avconv -i /home/pi/Desktop/test.mp4 -i /home/pi/Desktop/test.mp3 -map 0:0 -vcodec copy -map 1:0 -acodec copy output.h264

    I have checked separately that the video and audio were both able to play. However the merged file only had video but no audio. The log is shown below, it seems that the process was succeed.

    pi@raspberrypi ~ $ avconv -i /home/pi/Desktop/test.mp4 -i /home/pi/Desktop/test.mp3 -map 0:0 -vcodec copy -map 1:0 -acodec copy output.h264
    avconv version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2000-2013 the Libav developers
     built on Mar 31 2013 13:58:10 with gcc 4.6.3
    [h264 @ 0x1aa6680] max_analyze_duration reached
    [h264 @ 0x1aa6680] Estimating duration from bitrate, this may be inaccurate
    Input #0, h264, from '/home/pi/Desktop/test.mp4':
     Duration: N/A, bitrate: N/A
       Stream #0.0: Video: h264 (High), yuv420p, 640x480, 25 fps, 25 tbr, 1200k tbn, 2400k tbc
    [mp3 @ 0x1aaa120] Estimating duration from bitrate, this may be inaccurate
    Input #1, mp3, from '/home/pi/Desktop/test.mp3':
     Metadata:
       title           : We Are Legend (Original Mix)
       artist          : Dimitri Vegas & Like Mike & Steve Aoki
       album           : SPINNIN RECORDS
       encoded_by      : iTunes 11.1.5
       TBP             : 128
       genre           : Progressive House
       date            : 2013
     Duration: 00:00:11.14, start: 0.000000, bitrate: 191 kb/s
       Stream #1.0: Audio: mp3, 48000 Hz, stereo, s16, 192 kb/s
    File 'output.h264' already exists. Overwrite ? [y/N] y
    Output #0, h264, to 'output.h264':
     Metadata:
       encoder         : Lavf53.21.1
       Stream #0.0: Video: libx264, yuv420p, 640x480, q=2-31, 90k tbn, 1200k tbc
       Stream #0.1: Audio: libmp3lame, 48000 Hz, stereo, 192 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #1:0 -> #0:1 (copy)
    Press ctrl-c to stop encoding
    frame=  144 fps=  0 q=-1.0 Lsize=    1684kB time=5.06 bitrate=2724.7kbits/s    
    video:1566kB audio:119kB global headers:0kB muxing overhead 0.000000%

    Could somebody helps me, please. And sorry for my bad english.

    BTW : When I finally captured 200 frames, it turns out all of them were green.

  • ffmpeg video to rtsp not working, ffmpeg is not reading the video frame by frame [closed]

    15 janvier, par Leroy Jeslyn

    Here's the ffmpeg command :

    


    gst-launch-1.0 videotestsrc ! decodebin ! videoconvert ! videoscale \
 ! video/x-raw,width=1280,height=720 ! x264enc speed-preset=ultrafast \
 tune=zerolatency ! rtph264pay ! udpsink host=127.0.0.1 port=5000 sync=false \
 ! rtspserver service=0/test


    


    The output was :

    


    ffmpeg version 7.1-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers                                   
  built with gcc 14.2.0 (Rev1, 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-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-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libopenjpeg --enable-libqui
rc --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-libqrencode --enable-librav1e --enable-libsvtav1 --enable-libvvenc --enable-libwebp --enable-libx264 
--enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libvpx --enable-mediafoundation --enable-libass --enable
-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-
cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-lib
shaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enab
le-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-liblc3 --e
nable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.100 / 61. 19.100
  libavformat    61.  7.100 / 61.  7.100
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  4.100 / 10.  4.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Render/fire3.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp41isom
    creation_time   : 2025-01-08T13:10:15.000000Z
  Duration: 00:01:21.79, start: 0.000000, bitrate: 12799 kb/s
  Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 12798 kb/s, 14 fps, 14 tbr, 14k tbn (default)
      Metadata:
        creation_time   : 2025-01-08T13:10:15.000000Z
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
        encoder         : AVC Coding
[out#0/rtsp @ 00000178486d9a00] Codec AVOption b:a (set bitrate (in bits/s)) 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 decoder which was not actually used for any stream.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0000017848d200c0] using SAR=1/1
[libx264 @ 0000017848d200c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0000017848d200c0] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0000017848d200c0] 264 - core 164 r3192 c24e06c - H.264/MPEG-4 AVC codec - Copyleft 2003-2024 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 d
eblock=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_q
p_offset=-2 threads=22 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=250 keyint_min=14 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=1000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00



    


    This is were the output stopped, instead of reading the video frame by frame, it stops here and runs indefinitely. I tried to use VLC and python script to read the rtsp url, but that didn't work.
I tried the alternative using GStreamer, but i couldn't install rtsp-server on Windows 11.

    


    Thank you for your time, any suggestion or answers are appreciated. The end goal is to convert a video to a rtsp url.