Add support for mp3 demuxer/decoder.

This commit is contained in:
Alf
2023-01-09 21:20:20 -08:00
parent 3add6d7e2b
commit 14b62ad7bf
2 changed files with 21 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ FROM emscripten/emsdk:3.1.15 as build
ARG FFMPEG_VERSION=4.3.1 ARG FFMPEG_VERSION=4.3.1
ARG X264_VERSION=20170226-2245-stable ARG X264_VERSION=20170226-2245-stable
ARG LAME_VERSION=3.100
ARG PREFIX=/opt/ffmpeg ARG PREFIX=/opt/ffmpeg
ARG MAKEFLAGS="-j4" ARG MAKEFLAGS="-j4"
@@ -25,6 +26,21 @@ RUN cd /tmp/x264-snapshot-${X264_VERSION} && \
RUN cd /tmp/x264-snapshot-${X264_VERSION} && \ RUN cd /tmp/x264-snapshot-${X264_VERSION} && \
emmake make && emmake make install emmake make && emmake make install
# libmp3lame
RUN cd /tmp && \
wget -O lame-${LAME_VERSION}.tar.gz https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download && \
tar zxf lame-${LAME_VERSION}.tar.gz
RUN cd /tmp/lame-${LAME_VERSION} && \
emconfigure ./configure \
--prefix=${PREFIX} \
--host=i686-gnu \
--enable-static \
--disable-frontend
RUN cd /tmp/lame-${LAME_VERSION} && \
emmake make && emmake make install
# Get ffmpeg source. # Get ffmpeg source.
RUN cd /tmp/ && \ RUN cd /tmp/ && \
wget http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ wget http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
@@ -56,11 +72,12 @@ RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \
--enable-postproc \ --enable-postproc \
--enable-swscale \ --enable-swscale \
--enable-protocol=file \ --enable-protocol=file \
--enable-decoder=h264,aac,pcm_s16le \ --enable-decoder=h264,aac,pcm_s16le,mp3 \
--enable-demuxer=mov,matroska \ --enable-demuxer=mov,matroska,mp3 \
--enable-muxer=mp4 \ --enable-muxer=mp4 \
--enable-gpl \ --enable-gpl \
--enable-libx264 \ --enable-libx264 \
--enable-libmp3lame \
--extra-cflags="$CFLAGS" \ --extra-cflags="$CFLAGS" \
--extra-cxxflags="$CFLAGS" \ --extra-cxxflags="$CFLAGS" \
--extra-ldflags="$LDFLAGS" \ --extra-ldflags="$LDFLAGS" \

View File

@@ -11,7 +11,7 @@
<b-form-file <b-form-file
v-if="protocol === 'file'" v-if="protocol === 'file'"
id="file" id="file"
accept=".mp4, .mkv" accept=".mp4, .mkv, .mp3"
v-model="file" v-model="file"
:state="Boolean(file)" :state="Boolean(file)"
placeholder="Choose a file or drop it here..." placeholder="Choose a file or drop it here..."
@@ -59,7 +59,7 @@
<Overview :info="data" /> <Overview :info="data" />
</div> </div>
</b-tab> </b-tab>
<b-tab title="Frames" class="mt-2" lazy> <b-tab v-if="file.type !== 'audio/mpeg'" title="Frames" class="mt-2" lazy>
<Frames :file="file" /> <Frames :file="file" />
</b-tab> </b-tab>
</b-tabs> </b-tabs>