Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP

Autres articles (13)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • La gestion des forums

    3 novembre 2011, par

    Si les forums sont activés sur le site, les administrateurs ont la possibilité de les gérer depuis l’interface d’administration ou depuis l’article même dans le bloc de modification de l’article qui se trouve dans la navigation de la page.
    Accès à l’interface de modération des messages
    Lorsqu’il est identifié sur le site, l’administrateur peut procéder de deux manières pour gérer les forums.
    S’il souhaite modifier (modérer, déclarer comme SPAM un message) les forums d’un article particulier, il a à sa (...)

Sur d’autres sites (3345)

  • ffmpeg stream input sdp shows warning keyframe missing

    27 mars 2021, par Doua Beri

    I'm using ffmpeg 4.3.2.
I'm trying to forward a stream to a rtmp server having sdp file as input

    


    Opening the sdp file with VLC everything is working great. The same thing happens when I use ffplay

    


    ffplay -i rtp-forwarder.sdp -protocol_whitelist file,udp,rtp


    


    The problem starts when I start streaming to a rtmp server. The audio is good but the video is just a black screen. I event tried to stream to youtube rtmp server but it didn't work.

    


    I'm new to ffmpeg. Let me know if I'm missing something.

    


    I'm using this command

    


    ffmpeg -protocol_whitelist file,crypto,udp,rtp -re -i rtp-forwarder.sdp -c:v libx264 -b:v 3000k -maxrate 3000k -bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 -ar 44100 -f flv rtmp://localhost/live/test


    


    The sdp file content is like this

    


    v=0
o=- 0 0 IN IP4 192.168.1.49
s=Pion WebRTC
c=IN IP4 192.168.1.49
t=0 0
m=audio 4000 RTP/AVP 111
a=rtpmap:111 OPUS/48000/2
m=video 4002 RTP/AVP 96
a=rtpmap:96 VP8/90000


    


    Here is a full log

    


      libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[sdp @ 0000015a81ede6c0] Keyframe missing
Input #0, sdp, from 'rtp-forwarder.sdp':
  Metadata:
    title           : Pion WebRTC
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
    Stream #0:1: Video: vp8, yuv420p(tv, bt470bg/unknown/unknown), 640x480, 90k tbr, 90k tbn, 90k tbc
Stream mapping:
  Stream #0:1 -> #0:0 (vp8 (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (opus (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0000015a81f9e880] MB rate (108000000) > level limit (16711680) -0.0kbits/s speed=N/A
[libx264 @ 0000015a81f9e880] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0000015a81f9e880] profile High, level 6.2, 4:2:0, 8-bit
[libx264 @ 0000015a81f9e880] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - 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=12 lookahead_threads=2 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=50 keyint_min=5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=cbr mbtree=1 bitrate=3000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=3000 vbv_bufsize=6000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://localhost/live/test':
  Metadata:
    title           : Pion WebRTC
    encoder         : Lavf58.45.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 640x480, q=-1--1, 3000 kb/s, 90k fps, 1k tbn, 90k tbc
    Metadata:
      encoder         : Lavc58.91.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 3000000/0/3000000 buffer size: 6000000 vbv_delay: N/A
    Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 160 kb/s
    Metadata:
      encoder         : Lavc58.91.100 aac
[flv @ 0000015a820dd200] Failed to update header with correct duration..1kbits/s speed=   1x
[flv @ 0000015a820dd200] Failed to update header with correct filesize.
frame=   13 fps=0.1 q=-1.0 Lsize=    4233kB time=00:03:07.12 bitrate= 185.3kbits/s speed=0.999x
video:440kB audio:3658kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.281771%
[libx264 @ 0000015a81f9e880] frame I:1     Avg QP: 1.61  size: 59263
[libx264 @ 0000015a81f9e880] frame P:3     Avg QP: 9.10  size: 44500
[libx264 @ 0000015a81f9e880] frame B:9     Avg QP: 9.80  size: 28605
[libx264 @ 0000015a81f9e880] consecutive B-frames:  7.7%  0.0%  0.0% 92.3%
[libx264 @ 0000015a81f9e880] mb I  I16..4: 36.5% 19.5% 44.0%
[libx264 @ 0000015a81f9e880] mb P  I16..4: 10.7% 50.3% 12.3%  P16..4: 11.6%  9.6%  5.5%  0.0%  0.0%    skip: 0.1%
[libx264 @ 0000015a81f9e880] mb B  I16..4:  2.2% 10.4%  3.6%  B16..8: 45.7% 21.2%  6.1%  direct:10.6%  skip: 0.1%  L0:60.0% L1:25.5% BI:14.5%
[libx264 @ 0000015a81f9e880] final ratefactor: 13.03
[libx264 @ 0000015a81f9e880] 8x8 transform intra:56.7% inter:41.9%
[libx264 @ 0000015a81f9e880] coded y,uvDC,uvAC intra: 90.9% 99.6% 98.9% inter: 66.1% 99.0% 93.2%
[libx264 @ 0000015a81f9e880] i16 v,h,dc,p: 23% 22% 18% 38%
[libx264 @ 0000015a81f9e880] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 26% 23%  4%  2%  3%  3%  4%  4%
[libx264 @ 0000015a81f9e880] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 34% 18%  2%  2%  2%  2%  2%  2%
[libx264 @ 0000015a81f9e880] i8c dc,h,v,p: 55% 29% 11%  5%
[libx264 @ 0000015a81f9e880] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0000015a81f9e880] ref P L0: 59.2%  5.0% 13.4% 22.4%
[libx264 @ 0000015a81f9e880] ref B L0: 87.1%  7.5%  5.4%
[libx264 @ 0000015a81f9e880] ref B L1: 95.1%  4.9%
[libx264 @ 0000015a81f9e880] kb/s:4028.74
[aac @ 0000015a81f9a880] Qavg: 7535.380


    


    I get this warning [sdp @ 0000015a81ede6c0] Keyframe missing
and this one after a stop it

    


    [flv @ 0000015a820dd200] Failed to update header with correct duration..1kbits/s speed=   1x
[flv @ 0000015a820dd200] Failed to update header with correct filesize.


    


  • Extracted .wav file from .mp4 video with ffmpeg only has half of the duration

    16 mars 2021, par TheSprinter

    I've been using ffmpeg to extract .wav files from .mp4 videos to then generate waveforms and spectrograms for it, but I stumbled upon a file for which ffmpeg does not generate the full audio file. The video duration is 25:25 (25 minutes and 25 seconds), but the .wav file is 12:28 (12 minutes and 28 seconds).

    


    This is what I've been doing :

    


    C:\Users\<user>> ffmpeg -i video.mp4 -ab 160k -ac 1 -ar 44100 -vn audio.wav&#xA;</user>

    &#xA;

    I tried with -ac 2 only to see if I get something different, but the result is the same. In fact, I can't generate the plots I need with a stereo audio file.

    &#xA;

    This is what I get in the terminal when I run the command :

    &#xA;

    C:\Users\<user>>ffmpeg -i video.mp4 -ab 160k -ac 1 -ar 44100 -vn audio.wav&#xA;ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 9.3.1 (GCC) 20200621&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;audio.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 0&#xA;    compatible_brands: mp42mp41&#xA;    creation_time   : 2021-03-09T05:00:00.000000Z&#xA;  Duration: 00:25:25.29, start: 0.000000, bitrate: 2308 kb/s&#xA;    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 4410 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2021-03-09T05:00:00.000000Z&#xA;      handler_name    : ?Mainconcept Video Media Handler&#xA;      encoder         : AVC Coding&#xA;    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 253 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2021-03-09T05:00:00.000000Z&#xA;      handler_name    : #Mainconcept MP4 Sound Media Handler&#xA;Stream mapping:&#xA;  Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))&#xA;Press [q] to stop, [?] for help&#xA;Output #0, wav, to &#x27;audio.wav&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 0&#xA;    compatible_brands: mp42mp41&#xA;    ISFT            : Lavf58.45.100&#xA;    Stream #0:0(eng): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2021-03-09T05:00:00.000000Z&#xA;      handler_name    : #Mainconcept MP4 Sound Media Handler&#xA;      encoder         : Lavc58.91.100 pcm_s16le&#xA;size=   64463kB time=00:12:28.41 bitrate= 705.6kbits/s speed= 156x&#xA;video:0kB audio:64463kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000118%&#xA;</user>

    &#xA;

    If this information on the video is not enough to troubleshoot, the video says the following (when it starts, for the first few seconds) :

    &#xA;

    &#xA;EP TRT (23.976): 01:24:53:18&#xA;EP TRT (29.976): 01:24:55:06&#xA;&#xA;AUDIO LAYOUT&#xA;&#xA;Channel 1: Left Front (L)&#xA;Channel 2: Right Front (R)&#xA;Channel 3: Center (C)&#xA;Channel 4: Low Frequency/Effects (LFE)&#xA;Channel 5: Left Surround (Ls)&#xA;Channel 6: Right Surround (Rs)&#xA;Channel 7: Mono Mix (L)&#xA;Channel 8: Mono Mix (R)&#xA;

    &#xA;

    This is for TV, that's why you see that longer duration. I don't know if all this is relevant, actually.

    &#xA;

    Some additional info

    &#xA;

    Something curious is that I'm doing this for manual tests, but I'm actually creating an app with python and, for that, I'm using python-ffmpeg module, and I with that I'm getting the correct .wav file (with the correct duration). The python lines for this are the following :

    &#xA;

    (&#xA;                        ffmpeg&#xA;                        .input(&#xA;                            &#xA;                        )&#xA;                        .output(&#xA;                            ,&#xA;                            audio_bitrate=316000,&#xA;                            ac=1,&#xA;                            ar=48000&#xA;                        )&#xA;                        .run()&#xA;)&#xA;

    &#xA;

  • Pydub AudioSegment.from_file() fails for mp3 audio file : Decoding failed. ffmpeg returned error code : 1,

    27 mars 2021, par Nisuga Jayawardana

    Couldn't find any fix. Looks like a bug. How to fix this ?

    &#xA;

        # Grab the file from the request&#xA;    file_uploaded = request.FILES.get(&#x27;sourceFile&#x27;)&#xA;    file_path = uploads_base_path &#x2B; file_uploaded.name&#xA;    &#xA;    # saving the uploaded file&#xA;    open(file_path, &#x27;wb&#x27;)&#xA;&#xA;    extension = file_uploaded.name.split(&#x27;.&#x27;)[-1]&#xA;    with open(file_path, "rb") as wav_file:&#xA;        audio_segment = AudioSegment.from_file(wav_file, format=extension)    &lt;-------------Error&#xA;&#xA;    # create .wav filename for the file&#xA;    wavFileName = uploads_base_path &#x2B; &#x27;out.wav&#x27;&#xA;    print(wavFileName)&#xA;&#xA;    # convert audio file to .wav type&#xA;    audio_segment.export(wavFileName,"wav")&#xA;

    &#xA;

    // Pydub Error
    &#xA;Decoding failed. ffmpeg returned error code : 1
    &#xA;Output from ffmpeg/avlib :
    &#xA;ffmpeg version N-101739-gcad3a5d715 Copyright (c) 2000-2021 the FFmpeg developers
    &#xA;built with gcc 9.3-win32 (GCC) 20200320

    &#xA;

    // FFMPEG Error
    &#xA;[cache @ 000001c52157fdc0] Inner protocol failed to seekback end : -40
    &#xA;Last message repeated 1 times
    &#xA;[mp3 @ 000001c52157f400] Failed to read frame size : Could not seek to 1026.
    &#xA;[cache @ 000001c52157fdc0] Statistics, cache hits:0 cache misses:0
    &#xA;cache:pipe:0 : Invalid argument

    &#xA;