Recherche avancée

Médias (91)

Autres articles (102)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

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

Sur d’autres sites (10011)

  • Invalid NAL unit size in m3u8 stream through OpenCV

    3 mai 2021, par ClownLegs

    streaming a ".m3u8" feed from a Raspberry Pi zero W that points to 10 sequenced ".m4s" video files.
when feeding this into the below cv2 library it throws the error codes shown at the bottom of this post.
these errors seem to be in sync with the output video hanging/stuttering.

    



    


    Code :

    


    import cv2
import sys
import random

faceCascade = [cv2.CascadeClassifier(x) for x in sys.argv[1:]]

video_capture = cv2.VideoCapture('http://*IP*:8080/camera/livestream.m3u8')
colors = [(random.randint(0,255), random.randint(0,255), random.randint(0,255)) for i in faceCascade]

while True:
    # Capture frame-by-frame
    ret, frame = video_capture.read()

    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)


    faces = [list(face)+[i] for i,faces in enumerate(faceCascade) for face in faces.detectMultiScale(
        gray,
        scaleFactor=1.1,
        minNeighbors=5,
        minSize=(30, 30),
        flags=cv2.CASCADE_SCALE_IMAGE
    )]

    # Draw a rectangle around the faces
    for (x, y, w, h, i) in faces:
        cv2.rectangle(frame, (x, y), (x+w, y+h), colors[i], 2)

    # Display the resulting frame
    cv2.imshow('Video', frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# When everything is done, release the capture
video_capture.release()
cv2.destroyAllWindows()


    



    


    Errors :

    


    [h264 @ 00000189507870c0] Invalid NAL unit size (2103052861 > 20986).
[h264 @ 00000189507870c0] Error splitting the input into NAL units.


    



    


    Is there a way of resolving these errors with the stream ?

    


  • Fail build rav1e ffmpeg in ubuntu based Docker

    27 mai 2021, par Kodsama

    I a trying to build a Docker with ffmpeg which supports (encode/decode), av1, h26x, vpx. Everything runs fine apart the build for rav1e (if I comment out —enable-librav1e and the rav1e run part it goes through without problem).

    


    I could not find any specific other dependencies which are needed for the built.

    


    Any idea what is missing ?

    


    The Dockerfile :

    


    FROM ubuntu

ARG DEBIAN_FRONTEND=noninteractive

RUN apt -y update
RUN apt install -y autoconf
RUN apt install -y --force-yes automake
RUN apt install -y --force-yes build-essential
RUN apt install -y --force-yes pkg-config
RUN apt install -y --force-yes libtool
RUN apt install -y --force-yes wget
RUN apt install -y --force-yes yasm
RUN apt install -y --force-yes libx264-dev
RUN mkdir /root/source
RUN mkdir /root/source/ffmpeg
RUN cd /root/source/ffmpeg && \
  wget -O fdk-aac.tar.gz https://github.com/mstorsjo/fdk-aac/tarball/master && \
  tar xzvf fdk-aac.tar.gz && \
  cd mstorsjo-fdk-aac* && \
  autoreconf -fiv && \
  ./configure --disable-shared && \
  make && \
  make install && \
  make distclean
RUN apt install -y --force-yes git
RUN apt install -y --force-yes cmake
RUN apt install -y --force-yes python2.7
RUN mkdir -p /root/source/ffmpeg/libaom && \
  cd /root/source/ffmpeg/libaom && \
  git clone https://aomedia.googlesource.com/aom && \
  cmake ./aom && \
  make && \
  make install
RUN apt install -y --force-yes python3 python3-pip ninja-build
RUN pip3 install meson
RUN apt install -y --force-yes nasm
RUN cd /root/source/ffmpeg && \
  git clone https://code.videolan.org/videolan/dav1d.git && \
  cd dav1d && \
  meson build --buildtype release && \
  ninja -C build && \
  ninja -C build install && \
  ldconfig
RUN apt install -y --force-yes cargo perl clang
RUN cd /root/source/ffmpeg && \
  git clone https://github.com/xiph/rav1e.git && \
  cd rav1e && \
  git submodule update --init && \
  cargo build --release && \
  ldconfig
RUN apt install -y --force-yes libvpx-dev
RUN apt install -y --force-yes libssl-dev
RUN DEBIAN_FRONTEND=noninteractive apt install -y --force-yes tclsh
RUN cd /root/source/ffmpeg && \
  git clone https://github.com/Haivision/srt.git && \
  cd srt && \
  ./configure && \
  make && \
  make install && \
  ldconfig
RUN apt install -y --force-yes libx265-dev libnuma-dev
RUN apt install -y --force-yes libfreetype6-dev
RUN apt install -y --force-yes libopus-dev
RUN apt install -y --force-yes openssl
RUN apt install -y --force-yes libssl-dev
RUN apt install -y --force-yes libmp3lame-dev
RUN cd /root/source/ffmpeg && \
  git clone https://github.com/ffmpeg/ffmpeg.git && \
  cd ffmpeg && \
  ./configure \
    --pkg-config-flags="--static" \
    --enable-gpl \
    --enable-libfdk-aac \
    --enable-libx264 \
    --enable-libx265 \
    --enable-libaom \
    --enable-libdav1d \
    --enable-librav1e \
    --enable-libvpx \
    --enable-libsrt \
    --enable-libfreetype \
    --enable-libopus \
    --enable-libmp3lame \
    --enable-version3 \
    --enable-openssl \
    --enable-nonfree && \
  make && \
  make install && \
  make distclean && \
  hash -r


    


    The (partial) output error :

    


     => ERROR [23/34] RUN cd /root/source/ffmpeg &&   git clone https://github.com/xiph/rav1e.git  37.9s
------
 > [23/34] RUN cd /root/source/ffmpeg &&   git clone https://github.com/xiph/rav1e.git &&   cd rav1e &&   git submodule update --init &&   cargo build --release &&   ldconfig:
#27 0.360 Cloning into 'rav1e'...
#27 6.571     Updating crates.io index
#27 24.37  Downloading crates ...
#27 26.09   Downloaded aho-corasick v0.7.18
#27 26.12   Downloaded av-metrics v0.6.2
#27 26.13   Downloaded crossbeam v0.8.0
#27 26.14   Downloaded rust_hawktracer_normal_macro v0.4.1
#27 26.17   Downloaded semver v0.11.0
#27 26.19   Downloaded semver-parser v0.10.2
#27 26.21   Downloaded signal-hook-registry v1.3.0
#27 26.23   Downloaded arrayvec v0.7.0
#27 26.26   Downloaded bitstream-io v1.0.0
#27 26.27   Downloaded console v0.14.1
#27 26.28   Downloaded crossbeam-queue v0.3.1
#27 26.30   Downloaded crossbeam-utils v0.8.4
#27 26.37   Downloaded itertools v0.10.0
#27 26.38   Downloaded jobserver v0.1.22
#27 26.38   Downloaded lab v0.8.2
#27 26.39   Downloaded nasm-rs v0.2.0
#27 26.39   Downloaded memoffset v0.6.3
#27 26.39   Downloaded num-derive v0.3.3
#27 26.40   Downloaded noop_proc_macro v0.3.0
#27 26.40   Downloaded bitflags v1.2.1
#27 26.48   Downloaded cfg-if v1.0.0
#27 26.49   Downloaded textwrap v0.11.0
#27 26.52   Downloaded chrono v0.4.19
#27 26.53   Downloaded log v0.4.14
#27 26.55   Downloaded cc v1.0.68
#27 26.55   Downloaded num-integer v0.1.44
#27 26.60   Downloaded libc v0.2.95
#27 26.62   Downloaded memchr v2.4.0
#27 26.62   Downloaded autocfg v1.0.1
#27 26.62   Downloaded atty v0.2.14
#27 26.63   Downloaded clap v2.33.3
#27 26.64   Downloaded num-traits v0.2.14
#27 26.64   Downloaded crossbeam-epoch v0.9.4
#27 26.64   Downloaded paste v1.0.5
#27 26.65   Downloaded pest v2.1.3
#27 26.68   Downloaded rayon-core v1.9.1
#27 26.72   Downloaded rustc_version v0.3.3
#27 26.72   Downloaded rust_hawktracer v0.7.0
#27 26.72   Downloaded rust_hawktracer_proc_macro v0.4.1
#27 26.72   Downloaded rayon v1.5.1
#27 26.73   Downloaded signal-hook v0.3.8
#27 26.73   Downloaded thiserror v1.0.25
#27 26.74   Downloaded terminal_size v0.1.17
#27 26.74   Downloaded thiserror-impl v1.0.25
#27 26.74   Downloaded scopeguard v1.1.0
#27 26.74   Downloaded regex v1.5.4
#27 26.75   Downloaded quote v1.0.9
#27 26.75   Downloaded proc-macro2 v1.0.27
#27 26.75   Downloaded num_cpus v1.13.0
#27 26.75   Downloaded simd_helpers v0.1.0
#27 26.75   Downloaded scan_fmt v0.2.6
#27 26.77   Downloaded syn v1.0.72
#27 26.78   Downloaded ucd-trie v0.1.3
#27 26.78   Downloaded arrayvec v0.5.2
#27 26.78   Downloaded crossbeam-channel v0.5.1
#27 26.79   Downloaded unicode-xid v0.2.2
#27 26.79   Downloaded unicode-width v0.1.8
#27 26.79   Downloaded y4m v0.7.0
#27 26.79   Downloaded either v1.6.1
#27 26.79   Downloaded lazy_static v1.4.0
#27 26.79   Downloaded crossbeam-deque v0.8.0
#27 26.79   Downloaded ansi_term v0.11.0
#27 26.80   Downloaded arg_enum_proc_macro v0.3.1
#27 26.80   Downloaded time v0.1.43
#27 26.80   Downloaded regex-syntax v0.6.25
#27 26.81   Downloaded fern v0.6.0
#27 26.81  Downloading crates ...
#27 27.22   Downloaded arbitrary v0.4.7
#27 27.23  Downloading crates ...
#27 27.70   Downloaded assert_cmd v1.0.4
#27 27.70  Downloading crates ...
#27 28.12   Downloaded criterion v0.3.4
#27 28.14  Downloading crates ...
#27 28.53   Downloaded interpolate_name v0.2.3
#27 28.53  Downloading crates ...
#27 28.95   Downloaded libfuzzer-sys v0.3.5
#27 28.95  Downloading crates ...
#27 29.37   Downloaded pretty_assertions v0.7.2
#27 29.38  Downloading crates ...
#27 29.78   Downloaded rand v0.8.3
#27 29.79  Downloading crates ...
#27 30.18   Downloaded rand_chacha v0.3.0
#27 30.21    Compiling autocfg v1.0.1
#27 30.21    Compiling libc v0.2.95
#27 30.21    Compiling cfg-if v1.0.0
#27 30.21    Compiling lazy_static v1.4.0
#27 30.29    Compiling proc-macro2 v1.0.27
#27 30.32    Compiling unicode-xid v0.2.2
#27 30.51    Compiling scopeguard v1.1.0
#27 30.56    Compiling rayon-core v1.9.1
#27 30.85    Compiling syn v1.0.72
#27 31.27    Compiling memchr v2.4.0
#27 31.42    Compiling either v1.6.1
#27 31.52    Compiling ucd-trie v0.1.3
#27 31.84    Compiling bitflags v1.2.1
#27 31.95    Compiling regex-syntax v0.6.25
#27 32.26    Compiling log v0.4.14
#27 32.61    Compiling unicode-width v0.1.8
#27 32.62    Compiling rust_hawktracer_normal_macro v0.4.1
#27 32.67    Compiling arrayvec v0.5.2
#27 32.69    Compiling rust_hawktracer_proc_macro v0.4.1
#27 32.87    Compiling noop_proc_macro v0.3.0
#27 32.94    Compiling signal-hook v0.3.8
#27 33.18    Compiling lab v0.8.2
#27 33.40    Compiling bitstream-io v1.0.0
#27 33.68    Compiling ansi_term v0.11.0
#27 33.68    Compiling y4m v0.7.0
#27 33.97    Compiling scan_fmt v0.2.6
#27 34.01    Compiling arrayvec v0.7.0
#27 34.04    Compiling paste v1.0.5
#27 34.06 error[E0658]: const generics are unstable
#27 34.06   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/arrayvec-0.7.0/src/arrayvec.rs:42:30
#27 34.06    |
#27 34.06 42 | pub struct ArrayVec {
#27 34.06    |                              ^^^
#27 34.06    |
#27 34.06    = note: see issue #74878 /github.com/rust-lang/rust/issues/74878> for more information
#27 34.06
#27 34.06 error[E0658]: const generics are unstable

[...]

#27 34.06  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/arrayvec-0.7.0/src/utils.rs:6:15
#27 34.06   |
#27 34.06 6 | impl MakeMaybeUninit {
#27 34.06   |               ^
#27 34.06   |
#27 34.06   = note: see issue #74878 /github.com/rust-lang/rust/issues/74878> for more information
#27 34.06
#27 34.14 error: aborting due to 70 previous errors
#27 34.14
#27 34.14 For more information about this error, try `rustc --explain E0658`.
#27 34.15 error: could not compile `arrayvec`.
#27 34.15
#27 34.15 To learn more, run the command again with --verbose.
#27 34.15 warning: build failed, waiting for other jobs to finish...
#27 37.83 error: build failed
------
executor failed running [/bin/sh -c cd /root/source/ffmpeg &&   git clone https://github.com/xiph/rav1e.git &&   cd rav1e &&   git submodule update --init &&   cargo build --release &&   ldconfig]: exit code: 101


    


  • ffmpeg errors in the daemon

    3 octobre 2020, par smoto_shei

    I created a shell script to compress a video using ffmpeg(4.3.1).

    


    ffmpeg -y -i \
 '/var/www/System/Backend/Outputs/TempSaveMovie/200703_4_short_5fr_p2(100_20)_r(50_20).mp4' \
 -vcodec h264 -an \
 '/var/www/System/Backend/Outputs/MovieOutputs/200703_4_short_5fr_p2(100_20)_r(50_20).mp4'



    


    If you run this code from the console, it will run without problems.
In fact, we're using the python subscript.call() to execute it. It works fine too.

    


    cmd = 'sh /var/www/System/Backend/cv2toffmpeg.sh'
subprocess.call(cmd, shell=True)


    


    Secondly, if I run it from a daemonized python program, I'll get an error. I get the following error.
You'll get an error like this

    


    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './Outputs/TempSaveMovie/200703_4_short_5fr_p2(100_20)_r(50_20).mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.35.100
  Duration: 00:00:06.15, start: 0.000000, bitrate: 10246 kb/s
    Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 10244 kb/s, 13 fps, 13 tbr, 13312 tbn, 13 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
[mpeg4 @ 0x55cec17c5480] header damaged
[mpeg4 @ 0x55cec17c6840] header damaged
[mpeg4 @ 0x55cec1855f80] header damaged
[mpeg4 @ 0x55cec1866e00] header damaged
Output #0, mp4, to './Outputs/MovieOutputs/200703_4_short_5fr_p2(100_20)_r(50_20).mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.45.100
    Stream #0:0(und): Video: h264 (h264_nvenc) (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 13 fps, 13312 tbn, 13 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.91.100 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: N/A
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg4 @ 0x55cec17c8780] header damaged
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg4 @ 0x55cec17c5480] header damaged


    


    I think the problem is when you run it from a daemonized process. There seems to be a similar problem in the past.
Ffmpeg does not properly convert videos when run as daemon
I would like to ask for your help to solve this problem. Thank you for your help from Japan.