Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (18)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (6145)

  • How can I 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 embedding caption on a videos that need to be export as video file after processing it. I'm utilizing the flutter_ffmpeg_kit package. However, I'm having trouble getting the export to work properly.

    


    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;

  • Python, Youtube-video-downloader-merger Can i inproove this script run faster ?

    31 janvier 2020, par robotiaga

    I created script which one downloading video and sound from Youtube, and after that merging sound and video with ffmpeg, i wondering is another way to make same result but in faster way ? Because this script takes about 7 min depends on Video quality and duration. My code bellow :

    from pytube import YouTube
    import sys
    import ffmpeg
    import os


    class Downloader(YouTube):

       def __init__(self, link):
           self.link = YouTube(link)
           self.hq = []
           self.best_video = []
           self.best_sound = []


       def stream_objects(self):
           q = [self.hq.append(x) for x in self.link.streams.all()]
           self.best_video.append(str(self.hq[1]).split()[1].split('\"')[1])
           self.best_sound.append(str(self.hq[-1]).split()[1].split('\"')[1])
           return self.best_video, self.best_sound

       def downloady(self):
           vid = self.link.streams.get_by_itag(str(self.best_video).strip("['']"))
           audio = self.link.streams.get_by_itag(str(self.best_sound).strip("['']"))
           self.vid_title = (f"{vid.title}"+".mp4")

           vid.download(filename='video')
           audio.download(filename='audio')
           print('Downloaded, Now Starting Merge \n\n\n\n\n')
           print(f'{self.vid_title}'+'\n')

       def merge(self):
           ffmpeg.output(ffmpeg.input('video.mp4'), ffmpeg.input('audio.webm'), self.vid_title).run()
           os.remove('video.mp4')
           os.remove('audio.webm')



    if __name__=='__main__':
       a = Downloader(link = sys.argv[1])
       a.stream_objects()
       a.downloady()
       a.merge()

    OKE UPDATE :
    Now code looks like that..Second problem is slow downloading mp4 files from YouTube server, i have 10Gb/s internet. Good connection with YT servers, but why so poor downloading ? ? ? :)

    from pytube import YouTube
    import sys
    import ffmpeg
    import os
    import subprocess

    class Downloader(YouTube):

       def __init__(self, link):
           self.link = YouTube(link)
           self.hq = []


       def stream_objects(self):
           self.best = self.link.streams.filter(file_extension='mp4')
           q = [self.hq.append(x) for x in self.best.all()]
           self.best_vid_itag = str(self.best.all()[1]).split()[1].split('\"')[1]
           self.best_audio_itag = str(self.best.all()[-1]).split()[1].split('\"')[1]

       def downloader(self):
           vid = self.link.streams.get_by_itag(self.best_vid_itag)
           aud = self.link.streams.get_by_itag(self.best_audio_itag)
           print('Donwloading Video file...\n')
           vid.download(filename='video')
           print('Video file downloaded... Now Trying download Audio file..\n')
           aud.download(filename='audio')
           print('Audio file downloaded... Now Trying to merge audio and video files...\n')

       def merger(self):
           lin = str(self.link.title).rstrip()
           lin2 = (lin+'.mp4')
           subprocess.run(f'ffmpeg -i video.mp4 -i audio.mp4 -c copy "{lin2}"', shell=True)
           os.remove('video.mp4')
           os.remove('audio.mp4')
           print('Done....\n')

    if __name__=='__main__':
       a = Downloader(link = sys.argv[1])
       a.stream_objects()
       a.downloader()
       a.merger()
  • convert youtube video to mp3

    31 août 2015, par Try Mersianto