
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (46)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP 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 (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (5674)
-
How to create a custom theme in Piwik – Introducing the Piwik Platform
23 août 2014, par Thomas Steur — DevelopmentThis is the start of a new blog series where we introduce the capabilities of the Piwik platform. You’ll learn how to write custom plugins & themes, how to use our HTTP APIs and more.
We have been greatly simplifying our APIs over the last year focusing primarily on one design principle :
The complexity of our API should never exceed the complexity of your use case.
In other words, if you have a simple use for our API, we want it to be simple for you to accomplish it. If you have a complex, big, hairy, change-the-world idea, then maybe we can’t make it simple for you to accomplish it, but we want it to be possible.
Over the next weeks and months you will learn what exactly we mean by this and how we accomplished it.
FYI, don’t worry if you’re currently using our APIs, we keep them backwards compatible and we announce breaking changes in our platform changelog.
Getting started
In this series of posts, we assume that you have already set up your development environment. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik.
To summarize the things you have to do to get setup :
- Install Piwik (for instance via git).
- Activate the developer mode :
./console development:enable --full
. - And if you want, generate some test data :
./console visitorgenerator:generate-visits --idsite=1 --limit-fake-visits=600
. This can take a while and requires the VisitorGenerator plugin from the Marketplace.
Let’s start creating our own theme
We start by using the Piwik Console to create a blank theme :
./console generate:theme
The command will ask you to enter a name, description and version number for your theme. I will simply use “CustomTheme” as the name of the theme. There should now be a folder
plugins/CustomTheme
which contains some files to get you started easily.Before we modify our theme, we have to activate it by visiting the Settings => Themes admin page in our Piwik installation, or alternatively by running the command
./console core:plugin activate YourCustomTheme
. If the theme is not activated, we won’t see any changes.Theme Contents
The most important files in our theme are
plugins/CustomTheme/stylesheets/theme.less
,plugins/CustomTheme/stylesheets/_colors.less
andplugins/CustomTheme/stylesheets/_variables.less
:theme.less
is the file that will be included when your theme is activated. In this file you would include other stylesheet files and overwrite CSS styles._colors.less
contains many less variables allowing you to easily change the colors Piwik uses._variables.less
contains currently only one variable to change the font family. More variables will be added in the future. Note : This is a new feature and the file will be only there in case you have installed Piwik using Git or at least Piwik 2.6.0.
Changing the font family
To change the font family simply overwrite the variable
@theme-fontFamily-base: Verdana, sans-serif;
in_variables.less
. That’s it.Changing colors
To change a color, uncomment the less variables of the colors you want to change in
_colors.less
. I will shortly explain some of them. Usually changing only these colors will be enough to adjust Piwik’s look to your corporate design or to create a look that pleases you :@theme-color-brand: #d4291f; // The Piwik red which is for instance used in the menu, it also defines the color of buttons, the little arrows and more
@theme-color-brand-contrast: #ffffff; // Contrast color to the Piwik red. Usually you need to change it only in case you define a light brand color. For instance to change the text color of buttons
@theme-color-link: #1e93d1; // The link color which is usually a light blue
@theme-color-widget-title-text: #0d0d0d; // The text and background color of the header of a widget (Dashboard)
@theme-color-widget-title-background: #f2f2f2;
@theme-color-menu-contrast-text: #666666; // The text color of a menu item in the reporting sub menu and the admin menu
@theme-color-menu-contrast-textActive: #0d0d0d; // The text color of an active menu item
@theme-color-menu-contrast-background: #f2f2f2; // The background color of a menu item
@graph-colors-data-series[1-8]: #000000; // The different colors used in graphsMaking the change visible
To make a color or font change actually visible when you reload a page in Piwik you will have to delete the compiled CSS file after each change like this :
rm tmp/assets/asset_manager_global_css.css
Publishing your Theme on the Marketplace
In case you want to share your theme with other Piwik users you can do this by pushing your theme to GitHub and creating a tag. Easy as that. Read more about how to distribute a theme.
Advanced features
Isn’t it easy to create a custom theme ? All we had to do is to change some less variables. We never even created a file ! Of course, based on our API design principle, you can accomplish more if you want. For instance, you can change icons, CSS stylesheets, templates and more.
For further customising your Piwik, you can even change the logo and favicon in the Settings => General settings page.
Would you like to know more about theming ? Go to our Theme guide in the Piwik Developer Zone.
If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.
PS : see also this related FAQ : How do I White Label Piwik ?
-
How can I build a custom version of opencv while enabling CUDA and opengl ?
1er avril, par JoshI have a hard requirement of python3.7 for certain libraries (aeneas & afaligner). I've been using the regular opencv-python and ffmpeg libraries in my program and they've been working find.


Recently I wanted to adjust my program to use h264 instead of mpeg4 and ran down a licensing rabbit hole of how opencv-python uses a build of ffmpeg with opengl codecs off to avoid licensing issues. x264 is apparently opengl, and is disabled in the opencv-python library.


In order to solve this issue, I built a custom build of opencv using another custom build of ffmpeg both with opengl enabled. This allowed me to use the x264 encoder with the VideoWriter in my python program.


Here's the dockerfile of how I've been running it :



FROM python:3.7-slim

# Set optimization flags and number of cores globally
ENV CFLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
 CXXFLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
 LDFLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
 MAKEFLAGS="-j\$(nproc)"

# Combine all system dependencies in a single layer
RUN apt-get update && apt-get install -y --no-install-recommends \
 build-essential \
 cmake \
 git \
 wget \
 unzip \
 yasm \
 pkg-config \
 libsm6 \
 libxext6 \
 libxrender-dev \
 libglib2.0-0 \
 libavcodec-dev \
 libavformat-dev \
 libswscale-dev \
 libavutil-dev \
 libswresample-dev \
 nasm \
 mercurial \
 libnuma-dev \
 espeak \
 libespeak-dev \
 libtiff5-dev \
 libjpeg62-turbo-dev \
 libopenjp2-7-dev \
 zlib1g-dev \
 libfreetype6-dev \
 liblcms2-dev \
 libwebp-dev \
 tcl8.6-dev \
 tk8.6-dev \
 python3-tk \
 libharfbuzz-dev \
 libfribidi-dev \
 libxcb1-dev \
 python3-dev \
 python3-setuptools \
 libsndfile1 \
 libavdevice-dev \
 libavfilter-dev \
 libpostproc-dev \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

# Build x264 with optimizations
RUN cd /tmp && \
 wget https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2 && \
 tar xjf x264-master.tar.bz2 && \
 cd x264-master && \
 ./configure \
 --enable-shared \
 --enable-pic \
 --enable-asm \
 --enable-lto \
 --enable-strip \
 --enable-optimizations \
 --bit-depth=8 \
 --disable-avs \
 --disable-swscale \
 --disable-lavf \
 --disable-ffms \
 --disable-gpac \
 --disable-lsmash \
 --extra-cflags="-O3 -march=native -ffast-math -fomit-frame-pointer -flto -fno-fat-lto-objects" \
 --extra-ldflags="-O3 -flto -fno-fat-lto-objects" && \
 make && \
 make install && \
 cd /tmp && \
 # Build FFmpeg with optimizations
 wget https://ffmpeg.org/releases/ffmpeg-7.1.tar.bz2 && \
 tar xjf ffmpeg-7.1.tar.bz2 && \
 cd ffmpeg-7.1 && \
 ./configure \
 --enable-gpl \
 --enable-libx264 \
 --enable-shared \
 --enable-nonfree \
 --enable-pic \
 --enable-asm \
 --enable-optimizations \
 --enable-lto \
 --enable-pthreads \
 --disable-debug \
 --disable-static \
 --disable-doc \
 --disable-ffplay \
 --disable-ffprobe \
 --disable-filters \
 --disable-programs \
 --disable-postproc \
 --extra-cflags="-O3 -march=native -ffast-math -fomit-frame-pointer -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
 --extra-ldflags="-O3 -flto -fno-fat-lto-objects -Wl,--gc-sections" \
 --prefix=/usr/local && \
 make && \
 make install && \
 ldconfig && \
 rm -rf /tmp/*

# Install Python dependencies first
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
 pip install --no-cache-dir numpy py-spy

# Build OpenCV with optimized configuration
RUN cd /tmp && \
 # Download specific OpenCV version archives
 wget -O opencv.zip https://github.com/opencv/opencv/archive/4.8.0.zip && \
 wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.8.0.zip && \
 unzip opencv.zip && \
 unzip opencv_contrib.zip && \
 mv opencv-4.8.0 opencv && \
 mv opencv_contrib-4.8.0 opencv_contrib && \
 rm opencv.zip opencv_contrib.zip && \
 cd opencv && \
 mkdir build && cd build && \
 cmake \
 -D CMAKE_BUILD_TYPE=RELEASE \
 -D CMAKE_C_FLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
 -D CMAKE_CXX_FLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections -Wno-deprecated" \
 -D CMAKE_EXE_LINKER_FLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
 -D CMAKE_SHARED_LINKER_FLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
 -D CMAKE_INSTALL_PREFIX=/usr/local \
 -D ENABLE_FAST_MATH=ON \
 -D CPU_BASELINE_DETECT=ON \
 -D CPU_BASELINE=SSE3 \
 -D CPU_DISPATCH=SSE4_1,SSE4_2,AVX,AVX2,AVX512_SKX,FP16 \
 -D WITH_OPENMP=ON \
 -D OPENCV_ENABLE_NONFREE=ON \
 -D WITH_FFMPEG=ON \
 -D FFMPEG_ROOT=/usr/local \
 -D OPENCV_EXTRA_MODULES_PATH=/tmp/opencv_contrib/modules \
 -D PYTHON_EXECUTABLE=/usr/local/bin/python3.7 \
 -D PYTHON3_EXECUTABLE=/usr/local/bin/python3.7 \
 -D PYTHON3_INCLUDE_DIR=/usr/local/include/python3.7m \
 -D PYTHON3_LIBRARY=/usr/local/lib/libpython3.7m.so \
 -D PYTHON3_PACKAGES_PATH=/usr/local/lib/python3.7/site-packages \
 -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.7/site-packages/numpy/core/include \
 -D BUILD_opencv_python3=ON \
 -D INSTALL_PYTHON_EXAMPLES=OFF \
 -D BUILD_TESTS=OFF \
 -D BUILD_PERF_TESTS=OFF \
 -D BUILD_EXAMPLES=OFF \
 -D BUILD_DOCS=OFF \
 -D BUILD_opencv_apps=OFF \
 -D WITH_OPENCL=OFF \
 -D WITH_CUDA=OFF \
 -D WITH_IPP=OFF \
 -D WITH_TBB=OFF \
 -D WITH_V4L=OFF \
 -D WITH_QT=OFF \
 -D WITH_GTK=OFF \
 -D BUILD_LIST=core,imgproc,imgcodecs,videoio,python3 \
 .. && \
 make && \
 make install && \
 ldconfig && \
 rm -rf /tmp/*

# Set working directory and copy application code
WORKDIR /app

COPY requirements.txt .

RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg

RUN pip install --no-cache-dir aeneas afaligner && \
 pip install --no-cache-dir -r requirements.txt

COPY . .

# Make entrypoint executable
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]



My trouble now, is I've been considering running parts of my program on my GPU, it's creating graphics for a video after all. I have no idea how to edit my Dockerfile to make the opencv build run with CUDA enabled, every combination I try leads to issues.


How can I tell which version of CUDA, opencv and ffmpeg are compatible with python 3.7 ?


-
dockerfile apt-get install ffmpeg unmet dependencies
8 juillet 2020, par MartinI have a Dockerfile which looks like this :


FROM node:carbon
VOLUME ["/root"]
ADD setup-ffmpeg.sh /root
RUN /root/setup-ffmpeg.sh
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm install
# If you are building your code for production
# RUN npm install --only=production
# Bundle app source
COPY . .
EXPOSE 8080
CMD [ "npm", "start" ]



Which tries to run the file setup-ffmpeg.sh :


#!/usr/bin/env bash
echo 'deb http://www.deb-multimedia.org jessie main non-free' >> /etc/apt/sources.list
echo 'deb-src http://www.deb-multimedia.org jessie main non-free' >> /etc/apt/sources.list
apt-get update
apt-get install -y --force-yes deb-multimedia-keyring
apt-get remove -y --force-yes ffmpeg
apt-get install -y --force-yes build-essential libmp3lame-dev libvorbis-dev libtheora-dev libspeex-dev yasm pkg-config libfaac-dev libx264-dev libav-tools 
echo "ffmpeg time"
apt-get install ffmpeg 



I am on Ubuntu 20.04 LTS, and try to run this the Dockerfile, from terminal, with the command :


docker build -t alien35/node-web-app .



This causes an error when reaching the
ffmpeg
part though :

Sending build context to Docker daemon 9.793MB
Step 1/10 : FROM node:carbon
 ---> 8eeadf3757f4
Step 2/10 : VOLUME ["/root"]
 ---> Using cache
 ---> 3658672462de
Step 3/10 : ADD setup-ffmpeg.sh /root
 ---> c9c192aa97c5
Step 4/10 : RUN /root/setup-ffmpeg.sh
 ---> Running in b9240ac8d351
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [529 kB]
Get:7 http://deb.debian.org/debian stretch-updates/main amd64 Packages [28.2 kB]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7083 kB]
Get:9 http://www.deb-multimedia.org jessie InRelease [24.6 kB]
Ign:9 http://www.deb-multimedia.org jessie InRelease
Get:10 http://www.deb-multimedia.org jessie/main Sources [60.8 kB]
Get:11 http://www.deb-multimedia.org jessie/non-free Sources [2480 B]
Get:12 http://www.deb-multimedia.org jessie/main amd64 Packages [82.8 kB]
Get:13 http://www.deb-multimedia.org jessie/non-free amd64 Packages [1776 B]
Fetched 8080 kB in 2s (3402 kB/s)
Reading package lists...
W: GPG error: http://www.deb-multimedia.org jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5C808C2B65558117
W: The repository 'http://www.deb-multimedia.org jessie InRelease' is not signed.
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
 deb-multimedia-keyring
0 upgraded, 1 newly installed, 0 to remove and 56 not upgraded.
Need to get 10.7 kB of archives.
After this operation, 25.6 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
 deb-multimedia-keyring
Get:1 http://www.deb-multimedia.org jessie/main amd64 deb-multimedia-keyring all 2016.8.1 [10.7 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 10.7 kB in 0s (23.3 kB/s)
Selecting previously unselected package deb-multimedia-keyring.
(Reading database ... 29962 files and directories currently installed.)
Preparing to unpack .../deb-multimedia-keyring_2016.8.1_all.deb ...
Unpacking deb-multimedia-keyring (2016.8.1) ...
Setting up deb-multimedia-keyring (2016.8.1) ...
W: --force-yes is deprecated, use one of the options starting with --allow instead.
W: --force-yes is deprecated, use one of the options starting with --allow instead.
Reading package lists...
Building dependency tree...
Reading state information...
Package 'ffmpeg' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 56 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
pkg-config is already the newest version (0.29-4+b1).
pkg-config set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libav-tools : Depends: ffmpeg (= 10:2.6.9-dmo1+deb8u2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
ffmpeg time
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ffmpeg : Depends: libavcodec56 (>= 10:2.6.9) but it is not going to be installed
 Depends: libavdevice56 (>= 10:2.6.9) but it is not going to be installed
 Depends: libavfilter5 (>= 10:2.6.9) but it is not going to be installed
 Depends: libavformat56 (>= 10:2.6.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c /root/setup-ffmpeg.sh' returned a non-zero code: 100



I have tried adding the dependencies to
apt-get install
in my Dockerfile, and adding-f
to theffmpeg
command as well, but I am still getting this error