
Recherche avancée
Autres articles (101)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP 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" (...)
Sur d’autres sites (16547)
-
Websocket connection in Docker
22 avril 2024, par Akhil VargheseI have a Node.js app that takes an RTSP URL as input and provide a jsmpeg websocket stream as output. The focus of app is to generate a web compatible stream from an RTSP stream, and I have acheived this using a package rtsp-relay.
The app is working fine in locally.
But after dockerizing the app, I am not receiving the output stream. The stream is getting terminated.




The Dockerfile is :
I am building the ffmpeg from source in docker.



# Install necessary packages
RUN apt-get update && \
 DEBIAN_FRONTEND=noninteractive apt-get install -yq \
 autoconf \
 automake \
 build-essential \
 cmake \
 git \
 libass-dev \
 libfreetype6-dev \
 libgnutls28-dev \
 libmp3lame-dev \
 libsdl2-dev \
 libtool \
 libva-dev \
 libvdpau-dev \
 libvorbis-dev \
 libxcb1-dev \
 libxcb-shm0-dev \
 libxcb-xfixes0-dev \
 meson \
 ninja-build \
 pkg-config \
 texinfo \
 wget \
 yasm \
 zlib1g-dev \
 libunistring-dev \
 libaom-dev \
 libdav1d-dev \
 libnuma-dev \
 libopus-dev && \
 rm -rf /var/lib/apt/lists/*

# Create directories
RUN mkdir -p /ffmpeg_sources /ffmpeg_build /bin
RUN apt-get update
RUN apt-get install -y nasm
RUN apt-get install -y yasm

# Build and install NASM
WORKDIR /ffmpeg_sources
RUN wget https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/nasm-2.16.01.tar.bz2 && \
 tar xjvf nasm-2.16.01.tar.bz2 && \
 cd nasm-2.16.01 && \
 ./autogen.sh && \
 ./configure --prefix="/ffmpeg_build" --bindir="/bin" && \
 make && \
 make install

# Build and install x264
RUN apt-get update
RUN apt-get install -y libx264-dev


# Build and install x265
RUN apt-get install -y libx265-dev libnuma-dev

# Build and install libvpx
RUN git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
 cd libvpx && \
 ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm && \
 make && \
 make install

# Build and install fdk-aac
RUN git clone --depth 1 https://github.com/mstorsjo/fdk-aac && \
 cd fdk-aac && \
 autoreconf -fiv && \
 ./configure --prefix="/ffmpeg_build" --disable-shared && \
 make && \
 make install

# Build and install opus
RUN git clone --depth 1 https://github.com/xiph/opus.git && \
 cd opus && \
 ./autogen.sh && \
 ./configure --prefix="/ffmpeg_build" --disable-shared && \
 make && \
 make install

# Build and install SVT-AV1
RUN git clone --depth=1 https://gitlab.com/AOMediaCodec/SVT-AV1.git && \
 cd SVT-AV1 && \
 cd Build && \
 cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release && \
 make && \
 make install


# Build and install dav1d
RUN git clone --depth 1 https://code.videolan.org/videolan/dav1d.git && \
 mkdir -p dav1d/build && \
 cd dav1d/build && \
 meson setup -Denable_tools=false -Denable_tests=false --default-library=static .. --prefix "/ffmpeg_build" --libdir="/ffmpeg_build/lib" && \
 ninja && \
 ninja install

# Build and install ffmpeg
RUN wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
 tar xjvf ffmpeg-snapshot.tar.bz2 && \
 cd ffmpeg && \
 ./configure \
 --prefix="/ffmpeg_build" \
 --pkg-config-flags="--static" \
 --extra-cflags="-I/ffmpeg_build/include" \
 --extra-ldflags="-L/ffmpeg_build/lib" \
 --extra-libs="-lpthread -lm" \
 --ld="g++" \
 --bindir="/bin" \
 --enable-gpl \
 --enable-gnutls \
 --enable-libaom \
 --enable-libass \
 --enable-libfdk-aac \
 --enable-libfreetype \
 --enable-libmp3lame \
 --enable-libopus \
 --enable-libsvtav1 \
 --enable-libdav1d \
 --enable-libvorbis \
 --enable-libvpx \
 --enable-libx264 \
 --enable-libx265 \
 --enable-nonfree \
 --extra-ldflags="-lm -lstdc++ -L/ffmpeg_build/lib -Wl,-rpath,/ffmpeg_build/lib" \
 --extra-cflags="-I/ffmpeg_build/include" \
 --extra-libs="-lpthread -lm -lstdc++" && \
 make && \
 make install && \
 hash -r

# Update PATH
ENV PATH="/ffmpeg_build/bin:${PATH}"

# Cleanup
RUN rm -rf /ffmpeg_sources

# Source profile
RUN echo "source /root/.profile" >> ~/.bashrc



WORKDIR /usr/src/app
RUN apt-get update
RUN apt-get install -y nodejs
RUN apt-get install -y npm
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 2000
CMD ["npm", "start"]



While checking the network rules in the Docker image with the command : iptables -L
I am getting the following response :



I am able to access every API of the dockerized app, and I receive the responses and logs. but I'm not receiving the jsmpeg stream through the websocket connection.


I'm uncertain about the exact problem or how to resolve it.If you have encountered a similar issue before, and have a solution, I would greatly appreciate your assistance.


-
ffmpeg : Make output file duration that of the file with the longest length [closed]
27 février 2024, par losercantcodeI'm going crazy trying to figure this out.


Essentially I'm trying to apply sidechain compression using ffmpeg (for the sake of speed and automation). a2.mp3 in this example is the full length track and a1.wav is a short 5 second, spoken-word clip. The code currently applies the sidechain compression well, but the output file is only that of the spoken-word clips length, so 5 seconds. Is it at all possible to make the output match that of a2.mp3's length instead ? Switching around the input order is not something that's possible as it'll apply the compression to the incorrect track.


Essentially, i'm trying to make it so i'm just layering the spoken-word file on top of the audio track without having to pre-pad the file. I'd rather, if it's possible, this just happen with one block of code within the in one program. I'm interested to see if this is at all possible within ffmpeg.


ffmpeg -i a2.mp3 -i a1.wav -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress=threshold=0.000976563:ratio=10:level_sc=0.015625:release=100:attack=10[compr];[compr][mix]amix=duration=longest[aout]" -map "[aout]" output.wav



a1.wav is mon, a2.mp3 is stereo.


Attempted to implement amix=duration=longest to no avail. Research similar problems on the Stack Exchange that gave unrelated answers.


-
ffmpeg command exports flac with wrong 'length' metadata, works fine for mp3
21 juillet 2023, par MartinI have some audio recorded in Audacity 3.2.3 that I have exported as an mp3 and a flac. Then I have this file
split_by_silence.sh


Which has hardcoded input path values that take an input file, split it by detecting silence, and then finally run an ffmpeg command to split the files. If you save the below code into a file
split.sh
, you can call it with the command$ ./split_by_silence.sh "value1" "value2"


# ./split_by_silence.sh "full_lowq.flac" %03d_output.flac
#IN=$1
#OUT=$2

OUT="%03d_output.flac"
IN="/mnt/e/martinradio/rips/vinyl/WIP/Dogs On Fire (1983, Vinyl)/dog on fire.flac"
OUTPUT_LOCATION="/mnt/e/martinradio/rips/vinyl/WIP/Dogs On Fire (1983, Vinyl)/"

true ${SD_PARAMS:="-18dB"};
true ${MIN_FRAGMENT_DURATION:="20"};
export MIN_FRAGMENT_DURATION
if [ -z "$OUT" ]; then
 echo "Usage: split_by_silence.sh full.mp3 output_template_%03d.mp3"
 echo "Depends on FFmpeg, Bash, Awk, Perl 5. Not tested on Mac or Windows."
 echo ""
 echo "Environment variables (with their current values):"
 echo " SD_PARAMS=$SD_PARAMS Parameters for FFmpeg's silencedetect filter: noise tolerance and minimal silence duration"
 echo " MIN_FRAGMENT_DURATION=$MIN_FRAGMENT_DURATION Minimal fragment duration"
 exit 1
fi
#
# get comma separated list of split points (use ffmpeg to determine points where audio is at SD_PARAMS [-18db] )
#

echo "_______________________"
echo "Determining split points..." >& 2
SPLITS=$(
 ffmpeg -v warning -i "$IN" -af silencedetect="$SD_PARAMS",ametadata=mode=print:file=-:key=lavfi.silence_start -vn -sn -f s16le -y /dev/null \
 | grep lavfi.silence_start= \
 | cut -f 2-2 -d= \
 | perl -ne '
 our $prev;
 INIT { $prev = 0.0; }
 chomp;
 if (($_ - $prev) >= $ENV{MIN_FRAGMENT_DURATION}) {
 print "$_,";
 $prev = $_;
 }
 ' \
 | sed 's!,$!!'
)
echo "SPLITS= $SPLITS"

#
# Add 5 seconds to each of the comma separated numbers
#
# Convert the comma-separated string into an array
arr=($(echo $SPLITS | tr ',' '\n'))
# Initialize a new array to store the results
new_arr=()
# Iterate through each element and add 5 seconds of padding
for i in "${arr[@]}"; do
 result=$(echo "$i + 5" | bc -l)
 new_arr+=("$result")
done
# Convert the array back into a comma-separated string
NEW_SPLITS=$(IFS=,; echo "${new_arr[*]}")
# Print the result
echo "NEW_SPLITS= $NEW_SPLITS"
SPLITS=$NEW_SPLITS

#
# Print how many tracks should be exported
#
res="${SPLITS//[^,]}"
CHARCOUNT="${#res}"
num=$((CHARCOUNT + 2))
echo "Exporting $num tracks"
echo "_______________________"

#
# Split audio into individual tracks
#
current_directory=$(pwd)

cd "$OUTPUT_LOCATION"

echo "Running ffmpeg command: "

ffmpeg -i "$IN" -c copy -map 0 -f segment -segment_times "$SPLITS" "$OUT"
#ffmpeg -i "full_lowq.flac" -c copy -map 0 -f segment -segment_times "302.825,552.017" "%03d_output.flac"


echo "Done."

cd $current_directory

echo "running flac command"
# check flac file intrgrity



If I call this code for my flac file :


OUT="%03d_output.flac"
IN="/mnt/e/martinradio/rips/vinyl/WIP/Dogs On Fire (1983, Vinyl)/dog on fire.flac"



The outputted files have an incorrect metadata for the length. They all report as having the same length, but if i import any of them into audacity, the file has a correct length.




but if i run this for my mp3 file, we can see the correct length metadata :


OUT="%03d_output.mp3"
IN="/mnt/e/martinradio/rips/vinyl/WIP/Dogs On Fire (1983, Vinyl)/dogs on fire.mp3"





So there is something with my ffmpeg command that causes it to export flac files with wrong 'length' metadata


ffmpeg -i "$IN" -c copy -map 0 -f segment -segment_times "$SPLITS" "$OUT"




I've tried with the flac example to change
-c copy
to-c:a flac
, but that just gives every output flac file a length of 00:00:00

is it a problem with my ffmpeg command ? Or my files ? https://file.io/tIFsa1l70076
it works for mp3 files just fine, why does it have this issue with flac ?