Recherche avancée

Médias (91)

Autres articles (21)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

Sur d’autres sites (5449)

  • FFMPEG failed with RTSP running in docker

    9 août 2023, par SantiSori

    I'm trying to dockerize a simple application with node to stream the content of a RTSP camera through a websocker. To test I'm using the example : rtsp ://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4

    


    My code in node is as follows :

    


    VideoStream = require('rtsp-multi-stream')
streamer = new VideoStream.VideoStream({
  debug: true,
  wsPort: 9000,
  ffmpegPath: 'ffmpeg',
  ffmpegArgs: {
    '-b:v': '2048K',
    '-an': '',
    '-r': '24',
  },
});

setInterval(() => console.log([...streamer.liveMuxers.keys()]), 10000);


    


    When I run it locally, it works correctly :

    


    $ node ./rtsp.js
ffmpeg version 5.1.2-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the F
Fmpeg developers
  built with gcc 12.1.0 (Rev2, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32thr
eads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --e
nable-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 --enabl
e-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-libo
pencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --e
nable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --ena
ble-libvorbis --enable-librubberband
  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
prueba: New WebSocket Connection (1 total)
Input #0, rtsp, from 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_11
5k.mp4':
  Metadata:
    title           : BigBuckBunny_115k.mp4
  Duration: 00:10:34.63, start: 0.000000, bitrate: N/A
  Stream #0:0: Audio: aac (LC), 12000 Hz, stereo, fltp
  Stream #0:1: Video: h264 (High), yuv420p(progressive), 240x160 [SAR 32:27 DAR
16:9], 24 fps, 24.08 tbr, 90k tbn
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> mpeg1video (native))
  Stream #0:0 -> #0:1 (aac (native) -> mp2 (native))
Press [q] to stop, [?] for help
[mpeg1video @ 00000217d19e8840] too many threads/slices (11), reducing to 10
Output #0, mpegts, to 'pipe:':
  Metadata:
    title           : BigBuckBunny_115k.mp4
    encoder         : Lavf59.27.100
  Stream #0:0: Video: mpeg1video, yuv420p(progressive), 240x160 [SAR 32:27 DAR 1
6:9], q=2-31, 200 kb/s, 30 fps, 90k tbn
    Metadata:
      encoder         : Lavc59.37.100 mpeg1video
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
  Stream #0:1: Audio: mp2, 16000 Hz, stereo, s16, 160 kb/s
    Metadata:
      encoder         : Lavc59.37.100 mp2
[mpegts @ 00000217d38c64c0] Non-monotonous DTS in output stream 0:1; previous: 3
774, current: 2576; changing to 3775. This may result in incorrect timestamps in
 the output file.
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.60 bitrate=   0.0kbits/s
frame=   23 fps=0.0 q=2.8 size=      69kB time=00:00:01.46 bitrate= 384.0kbits/s
frame=   35 fps= 31 q=2.6 size=     104kB time=00:00:01.97 bitrate= 430.0kbits/s
frame=   48 fps= 30 q=2.3 size=     135kB time=00:00:02.47 bitrate= 446.3kbits/s
frame=   60 fps= 28 q=2.1 size=     168kB time=00:00:02.98 bitrate= 461.7kbits/s
frame=   72 fps= 27 q=2.0 size=     194kB time=00:00:03.48 bitrate= 454.9kbits/s


    


    Then I pass it to docker, for that I have the following dockerfile :

    


    FROM node:16-alpine

RUN apk update
RUN apk add
RUN apk add ffmpeg

RUN mkdir -p /home/node/app
WORKDIR /home/node/app
COPY . .

RUN npm install
CMD [ "node", "rtsp-multi.js" ]


    


    When I run docker I get the following errors :

    


    Socket connected /?url=rtsp%3A%2F%2Fwowzaec2demo.streamlock.net%2Fvod%2Fmp4%3ABigBuckBunny_115k.mp4
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.2.1 (Alpine 12.2.1_git20220924-r3) 20220924
  configuration: --prefix=/usr --enable-avfilter --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libpulse --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-lto --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-librist --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --disable-lzma --enable-libaom --enable-libopus --enable-libsoxr --enable-libwebp --enable-vaapi --enable-vdpau --enable-vulkan --enable-libdrm --enable-libzmq --optflags=-O2 --disable-debug --enable-libsvtav1
  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
Error go live Timeout
[rtsp @ 0x7fdd7d811100] Could not find codec parameters for stream 1 (Video: h264, none, 240x160): unspecified pixel format
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, rtsp, from 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4':
  Metadata:
    title           : BigBuckBunny_115k.mp4
  Duration: 00:10:34.63, start: 0.000000, bitrate: N/A
  Stream #0:0: Audio: aac, 12000 Hz, stereo, fltp
  Stream #0:1: Video: h264, none, 240x160, 90k tbr, 90k tbn
Socket closed
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> mpeg1video (native))
Press [q] to stop, [?] for help
Cannot determine format of input stream 0:1 after EOF
Error marking filters as finished
Exiting normally, received signal 15.


    


    I have tried to put as parameter to increase the analyzeduration and probesize inside ffmpegArgs but it doesn't seem to work. I have also tried with the node library node-rtsp-stream but it doesn't work either.

    


    I need to make it work inside docker but I am not able to, I have checked and on my PC and inside docker the versions of node and ffmpeg are the same. I have also checked with other old versions and the error is the same. I don't know what else to try, how can I make it work inside docker ?

    


  • Latency and DAF in RTP transmissions

    24 février 2023, par jfernandz

    I'm trying to perform some tests for audio RTP transmissions to know their technical limitations. The idea is to prevent DAF effect in this kind of transmissions, I'm assuming a latency lower than 50ms will prevent it. But there is another handicap in my analysis, the RTP transmission must be over WiFi.

    


    For this tests I'm trying to transmit raw audio (not sure if skipping the encoding stage will improve latency) through ffmpeg between two different laptops, so I'm running ffmpeg in the first laptop (172.20.1.2) as :

    


    $ ffmpeg -f pulse -i 56 -c copy -f rtp rtp://172.20.1.5:10000

    


    which produces the following output :

    


    ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  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
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, pulse, from '56':
  Duration: N/A, start: 1677234050.938677, bitrate: 1536 kb/s
  Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Output #0, rtp, to 'rtp://172.20.1.5:10000':
  Metadata:
    encoder         : Lavf59.27.100
  Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 172.20.1.5
t=0 0
a=tool:libavformat LIBAVFORMAT_VERSION
m=audio 10000 RTP/AVP 97
b=AS:1536

Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=     322kB time=00:00:01.67 bitrate=1573.6kbits/s speed=1.06x


    


    I'm assuming the shown SDP is a valid one :

    


    v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 172.20.1.5
t=0 0
a=tool:libavformat LIBAVFORMAT_VERSION
m=audio 10000 RTP/AVP 97
b=AS:1536


    


    So I saved it in a file called ccopy.sdp on the second laptop (172.20.1.5). However, when I run ffplay in this other laptop as :

    


    $ ffplay -protocol_whitelist file,rtp,udp -i ccopy.sdp

    


    I can see there is problems with this SDP :

    


    ffplay version n5.1.2 Copyright (c) 2003-2022 the FFmpeg developers
  built with gcc 12.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  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
[sdp @ 0x7f8eec000c80] Could not find codec parameters for stream 0 (Audio: none, 0 channels): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, sdp, from 'ccopy.sdp':
  Metadata:
    title           : No Name
  Duration: N/A, bitrate: N/A
  Stream #0:0: Audio: none, 0 channels
Failed to open file 'ccopy.sdp' or configure filtergraph
    nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   


    


    Not sure if I'm doing something wrong or this is because of I cannot actually use pcm_s16le for an RTP transmission. Moreover ... Is there some argument for ffmpeg that I can use to improve this RTP transmission and reduce latency under 50ms.

    


    Thank you all :-)

    


    PS : When I don't use -c copy argument for ffmpeg and therefore I have this SDP

    


    v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 172.20.1.5
t=0 0
a=tool:libavformat LIBAVFORMAT_VERSION
m=audio 10000 RTP/AVP 97
b=AS:768
a=rtpmap:97 PCMU/48000/2


    


    The RTP transmission works as I expect, but with a significant DAF.

    


  • Problem concatenating an mp4 file with an mp4 created by repeating a single image, with the same codec with ffmpeg concat demuxer

    3 février 2023, par ashay

    I have an mp4 video (of a lecture) containing two streams, video and audio. I wanted an introduction for it (title slide of the presentation that accompanied it), so I made an mp4 out of the intro image via ffmpeg -framerate 30 -i lec01_title.jpg -t 3 -c:v libx264 -pix_fmt yuvj420p -vf "scale=1920:1080" lec01_title.mp4 -f lavfi -i anullsrc -c:a aac. When I try to concat the files using the demuxer, it doesn't work. First, I try to verify that the properties (encoding, etc.) of the two videos are the same.

    


    If I run ffmpeg -i lec01.mp4, I get :

    


    ffmpeg version 5.1.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/5.1.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
  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, mov,mp4,m4a,3gp,3g2,mj2, from 'dcai_lec01.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Wide
    encoder         : Lavf58.20.100
  Duration: 00:45:24.01, start: 0.000000, bitrate: 743 kb/s
  Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 96000 Hz, stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 606 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]


    


    If I run ffmpeg -i lec01_title.mp4, I get :

    


    ffmpeg version 5.1.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/5.1.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
  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, mov,mp4,m4a,3gp,3g2,mj2, from 'dcai_lec01_title.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.27.100
  Duration: 00:00:03.00, start: 0.000000, bitrate: 150 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt470bg/unknown/unknown, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 12877 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 libx264
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 2 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]


    


    I tried to verify that the properties of the two videos match via ffprobe -select_streams a:0 -show_entries stream=codec_name,channels -of default=nw=1:nk=1 -v 0 lec01.mp4 and ffprobe -select_streams v:0 -show_entries stream=codec_name,width,height,r_frame_rate,pix_fmt -of default=nw=1:nk=1 -v 0 lec01.mp4, and they do. The first command gives me

    


    aac
2


    


    and the second command gives me

    


    h264
1920
1080
yuvj420p
30/1


    


    for both videos.

    


    Now, if I have a file called lec01.txt containing :

    


    file 'lec01_title.mp4'
file 'lec01.mp4'


    


    when I run ffmpeg -f concat -i lec01.txt -c copy output.mp4, the resulting video is of length 04:44:04 (four hours, when my two input videos were 3 seconds and 45:24 minutes respectively), and it only shows the title slide for that entire duration.

    


    Furthermore, when I run this concat command, I get the following message repeated many times : [mp4 @ 0x7f82b9013b80] Non-monotonous DTS in output stream 0:1; previous: 133290, current: 133120; changing to 133291. This may result in incorrect timestamps in the output file.

    


    I'm missing something. When I look up this error, it seems to be something related to the decoding time stamps (DTS) or presentation time stamps. Anyone know what I'm doing wrong and how to fix ? Thank you for your help !

    


    Edit :
It appears to work if I re-encode via ffmpeg -i lec01_title.mp4 -i lec01.mp4 -filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" output.mp4, but I'd like to avoid doing this since I have tons of videos I need to do this for.