Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (63)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • Activation de l’inscription des visiteurs

    12 avril 2011, par

    Il est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
    Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
    Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)

Sur d’autres sites (10138)

  • How to export a video with a widget overlay in a Flutter app ?

    30 juin 2024, par Mohammed Bekele

    I'm developing a Flutter app for a caption embeding on a video that needs to export a video file after processing it. I'm using the flutter_ffmpeg_kit package. However, I'm having trouble getting the export to work correctly.

    


    Here's the code I'm using :

    


    initially this is my stack

    


                      Expanded(
                    child: Stack(
                      children: [
                        Center(
                          child: _videoPlayerController.value.isInitialized
                              ? AspectRatio(
                                  aspectRatio:
                                      _videoPlayerController.value.aspectRatio,
                                  child: VideoPlayer(_videoPlayerController),
                                )
                              : CircularProgressIndicator(),
                        ),
                        if (_currentCaption.isNotEmpty)
                          Positioned.fill(
                            child: Center(child: _buildCaptionText()),
                          ),
                      ],
                    ),
                  ),


    


    and in export button i executed this function

    


     Future<void> _exportVideo() async {&#xA;    setState(() {&#xA;      _isProcessing = true;&#xA;    });&#xA;&#xA;    try {&#xA;      final directory = await getExternalStorageDirectory();&#xA;      final rootPath = directory?.parent.parent.parent.parent.path;&#xA;      final mobixPath = path.join(rootPath!, &#x27;Mobix App&#x27;);&#xA;      final appPath = path.join(mobixPath, &#x27;Caption&#x27;);&#xA;      final outputPath = path.join(appPath, &#x27;Output&#x27;);&#xA;&#xA;      // Create the directories if they don&#x27;t exist&#xA;      await Directory(outputPath).create(recursive: true);&#xA;&#xA;      final timestamp = DateTime.now().millisecondsSinceEpoch;&#xA;      final outputFilePath = path.join(outputPath, &#x27;output-$timestamp.mp4&#x27;);&#xA;&#xA;&#xA;      // Generate the FFmpeg command&#xA;      final ffmpegCommand = _generateFFmpegCommand(&#xA;        widget.videoPath,&#xA;        outputFilePath,&#xA;        widget.words,&#xA;        _fontSize,&#xA;        _isBold,&#xA;        _isItalic,&#xA;        _fontColor,&#xA;        _backgroundColor,&#xA;      );&#xA;&#xA;      // Execute the FFmpeg command&#xA;      await FFmpegKit.execute(&#xA;        ffmpegCommand,&#xA;      ).then(&#xA;        (session) async {&#xA;          // Update progress if needed&#xA;          final returnCode = await session.getReturnCode();&#xA;          if (ReturnCode.isSuccess(returnCode)) {&#xA;            setState(() {&#xA;              _outputFilePath = outputFilePath;&#xA;            });&#xA;            ScaffoldMessenger.of(context).showSnackBar(&#xA;              SnackBar(content: Text(&#x27;Export successful: $_outputFilePath&#x27;)),&#xA;            );&#xA;          } else {&#xA;            print(&#x27;Export failed with rc: $returnCode&#x27;);&#xA;&#xA;            ScaffoldMessenger.of(context).showSnackBar(&#xA;              SnackBar(content: Text(&#x27;Export failed with rc: $returnCode&#x27;)),&#xA;            );&#xA;          }&#xA;          setState(() {&#xA;            _isProcessing = false;&#xA;          });&#xA;        },&#xA;      );&#xA;    } catch (e) {&#xA;      print(&#x27;Export failed: $e&#x27;);&#xA;      ScaffoldMessenger.of(context).showSnackBar(&#xA;        SnackBar(content: Text(&#x27;Export failed: $e&#x27;)),&#xA;      );&#xA;      setState(() {&#xA;        _isProcessing = false;&#xA;      });&#xA;    }&#xA;  }&#xA;&#xA;  String _generateFFmpegCommand(&#xA;    String inputPath,&#xA;    String outputPath,&#xA;    List<dynamic> words,&#xA;    double fontSize,&#xA;    bool isBold,&#xA;    bool isItalic,&#xA;    Color fontColor,&#xA;    Color backgroundColor,&#xA;  ) {&#xA;    final ffmpegCommand = StringBuffer();&#xA;&#xA;    // Add input file&#xA;    ffmpegCommand.write(&#x27;-i $inputPath &#x27;);&#xA;&#xA;    // Add subtitles filter&#xA;    final subtitleFilter = StringBuffer();&#xA;    for (var word in words) {&#xA;      final startTime = word[&#x27;startTime&#x27;].toDouble();&#xA;      final endTime = word[&#x27;endTime&#x27;].toDouble();&#xA;      final caption = word[&#x27;word&#x27;];&#xA;&#xA;      final fontStyle = isBold &amp;&amp; isItalic&#xA;          ? &#x27;bold italic&#x27;&#xA;          : isBold&#xA;              ? &#x27;bold&#x27;&#xA;              : isItalic&#xA;                  ? &#x27;italic&#x27;&#xA;                  : &#x27;normal&#x27;;&#xA;      final fontColorHex = fontColor.value.toRadixString(16).substring(2);&#xA;      final backgroundColorHex =&#xA;          backgroundColor.value.toRadixString(16).substring(2);&#xA;&#xA;      subtitleFilter.write(&#xA;          "drawtext=text=&#x27;$caption&#x27;:x=(w-tw)/2:y=h-(2*lh):fontcolor=$fontColorHex:fontsize=$fontSize:fontStyle=$fontStyle:box=1:boxcolor=$backgroundColorHex@0.5:boxborderw=5:enable=&#x27;between(t,$startTime,$endTime)&#x27;,");&#xA;    }&#xA;    ffmpegCommand.write(&#x27;-vf "${subtitleFilter.toString()}" &#x27;);&#xA;&#xA;    // Add output file&#xA;    ffmpegCommand.write(&#x27;$outputPath&#x27;);&#xA;&#xA;    return ffmpegCommand.toString();&#xA;  }&#xA;</dynamic></void>

    &#xA;

    when i run this it returns ReturnCode 1. what am i doing wrong ?

    &#xA;

  • Using FFMPEG to automatically set a single max filesize across multiple different sized files

    14 juin 2020, par DuffCreeper

    I don't really know how to word it any better but I'm trying to convert WEBM/GIF to MP4 with no sound

    &#xA;&#xA;

    The problem I'm facing is retaining the quality without having to sacrifice it across multiple files by having to resize them to 420p

    &#xA;&#xA;

    The idea was to hopefully somehow get FFMPEG to automatically determine the bitrate required for the file to hit the filesize of 10mb. Though I have looked everywhere online and I have not found a single answer regarding it, so either it's not possible or I'm blind

    &#xA;

  • FFMPEG AMF Hardware Acceleration on AMD Ryzen™ 7 7700 Server in Ubuntu 22.04 [closed]

    4 décembre 2024, par LoNormaly

    I was trying to make ffmpeg available with AMF and have access to the AMF hardware acceleration (in ffmpeg -hwaccels) but failed.

    &#xA;

    At first, the kernel that the server as Ubuntu 22.04 came with was 5.15 and after contacting support I was explained that I need to upgrade the kernel to have access to /dev/dri.

    &#xA;

    So I upgraded to 6.8 and then I had access to /dev/dri and was able to use ffmpeg 7.1 with vaapi working.

    &#xA;

    In AMD, they have their own hardware acceleration named AMF, that allows much better speed and quality of transcoding.

    &#xA;

    I installed the AMD GPU drivers like it's explained here : https://www.amd.com/en/support/download/linux-drivers.html

    &#xA;

    I installed AMF as well, and compiled my own ffmpeg build with --enable-amf flag.

    &#xA;

    Still in ffmpeg -hwaccels I get access to vaapi and drm only.

    &#xA;

    Can you share if you know any solution to this enigma ?

    &#xA;

    These are the instructions with which I installed the drivers, AMF and ffmpeg with :

    &#xA;

    Install AMD GPU Pro Drivers:&#xA;wget https://repo.radeon.com/amdgpu-install…60203-1_all.deb&#xA;sudo apt install ./amdgpu-install_6.2.60203-1_all.deb&#xA;&#xA;amdgpu-install --usecase=amf,multimedia -y&#xA;sudo amdgpu-install -y --usecase=amf,graphics --accept-eula --opencl=rocr,legacy --vulkan=amdvlk,pro&#xA;&#xA;&#xA;&#xA;CompilationGuide/Ubuntu – FFmpeg&#xA;Compiling ffmpeg:&#xA;&#xA;sudo apt-get update -qq &amp;&amp; sudo apt-get -y install \&#xA;autoconf \&#xA;automake \&#xA;build-essential \&#xA;cmake \&#xA;git-core \&#xA;libass-dev \&#xA;libfreetype6-dev \&#xA;libgnutls28-dev \&#xA;libmp3lame-dev \&#xA;libtool \&#xA;libvorbis-dev \&#xA;meson \&#xA;ninja-build \&#xA;pkg-config \&#xA;texinfo \&#xA;wget \&#xA;yasm \&#xA;zlib1g-dev&#xA;&#xA;sudo apt install libunistring-dev libaom-dev libdav1d-dev -y&#xA;&#xA;mkdir -p ~/ffmpeg_sources ~/bin&#xA;&#xA;// Install prerequisites&#xA;apt-get update &amp;&amp; apt-get install -y \&#xA;build-essential \&#xA;pkg-config \&#xA;yasm \&#xA;nasm \&#xA;libtool \&#xA;automake \&#xA;cmake \&#xA;libx264-dev \&#xA;libx265-dev \&#xA;libvpx-dev \&#xA;libfdk-aac-dev \&#xA;libopus-dev \&#xA;libaom-dev \&#xA;libdrm-dev \&#xA;libva-dev \&#xA;vainfo&#xA;    &#xA;    &#xA;cd ~/ffmpeg_sources &amp;&amp; \&#xA;wget https://ffmpeg.org/releases/ffmpeg-7.1.tar.bz2 &amp;&amp; \&#xA;tar -xjf ffmpeg-7.1.tar.bz2 &amp;&amp; \&#xA;mkdir ffmpeg_build &amp;&amp; \&#xA;cd ffmpeg_build &amp;&amp; \&#xA;mkdir include &amp;&amp; \&#xA;cd include &amp;&amp; \&#xA;&#xA;&#xA;// Install AMF&#xA;git clone https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git &amp;&amp; \&#xA;mv ~/ffmpeg_build/include/AMF/amf ~/ffmpeg_build/include/ &amp;&amp; \&#xA;rm -rf AMF &amp;&amp; \&#xA;&#xA;// From here: https://askubuntu.com/questions/1440…-ubuntu-20-04-5&#xA;// Correct install:&#xA;cd ~/&#xA;git clone https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git&#xA;mkdir /usr/local/include/AMF&#xA;cd /usr/local/include/AMF&#xA;ln -sf ~/AMF/amf/public/include/core&#xA;ln -sf ~/AMF/amf/public/include/components&#xA;&#xA;// Install libvmaf&#xA;cd ~/ffmpeg_sources &amp;&amp; \&#xA;wget https://github.com/Netflix/vmaf/archive/v3.0.0.tar.gz &amp;&amp; \&#xA;tar xvf v3.0.0.tar.gz &amp;&amp; \&#xA;mkdir -p vmaf-3.0.0/libvmaf/build &amp;&amp; \&#xA;&#xA;cd vmaf-3.0.0/libvmaf &amp;&amp; \&#xA;meson setup build --buildtype=release --default-library=static --prefix="$HOME/ffmpeg_build" &amp;&amp; \&#xA;ninja -C build &amp;&amp; \&#xA;ninja -C build install&#xA;&#xA;cd ~/ffmpeg_sources/ffmpeg-7.1&#xA;PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \&#xA;--prefix="$HOME/ffmpeg_build" \&#xA;--pkg-config-flags="--static" \&#xA;--extra-cflags="-I$HOME/ffmpeg_build/include" \&#xA;--extra-ldflags="-L$HOME/ffmpeg_build/lib" \&#xA;--extra-libs="-lpthread -lm" \&#xA;--ld="g&#x2B;&#x2B;" \&#xA;--bindir="$HOME/bin" \&#xA;--enable-gpl \&#xA;--enable-gnutls \&#xA;--enable-libaom \&#xA;--enable-libass \&#xA;--enable-libfdk-aac \&#xA;--enable-libfreetype \&#xA;--enable-libmp3lame \&#xA;--enable-libopus \&#xA;--enable-libdav1d \&#xA;--enable-libvorbis \&#xA;--enable-libvpx \&#xA;--enable-libx264 \&#xA;--enable-libx265 \&#xA;--enable-libdrm \&#xA;--enable-vaapi \&#xA;--enable-libvmaf \&#xA;--enable-amf \&#xA;--enable-nonfree &amp;&amp; \&#xA;PATH="$HOME/bin:$PATH" make &amp;&amp; \&#xA;make -j$(nproc) install &amp;&amp; \&#xA;hash -r&#xA;&#xA;&#xA;./ffmpeg -buildconf&#xA;&#xA;&#xA;&#xA;Test VMAF to compare quality:&#xA;./ffmpeg -i input.mp4 -i reference.mp4 -lavfi libvmaf -f null -&#xA;// example output: [Parsed_libvmaf_0 @ 0x74a0f8004940] VMAF score: 98.930249ate=N/A speed=9.06x&#xA;

    &#xA;