Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (63)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 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 (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (7527)

  • ffmpeg - how can I get a specific channel using channel masks (e.g. : get only surround left channel)

    26 novembre 2013, par awfulcode

    I'm trying to build a mixer that allows users to toggle specific channels on and off. I know that different codecs encode those channels in different orders (it's not as simple as getting channel #3 as the center channel every time), so the challenge is to properly identify the channel position in surround audio tracks.

    ffmpeg does list the in the beginning of libavutil/channel_layout.h :

    #define AV_CH_FRONT_LEFT             0x00000001
    #define AV_CH_FRONT_RIGHT            0x00000002
    #define AV_CH_FRONT_CENTER           0x00000004
    #define AV_CH_LOW_FREQUENCY          0x00000008
    #define AV_CH_BACK_LEFT              0x00000010
    #define AV_CH_BACK_RIGHT             0x00000020
    #define AV_CH_FRONT_LEFT_OF_CENTER   0x00000040
    #define AV_CH_FRONT_RIGHT_OF_CENTER  0x00000080
    #define AV_CH_BACK_CENTER            0x00000100
    #define AV_CH_SIDE_LEFT              0x00000200
    #define AV_CH_SIDE_RIGHT             0x00000400
    #define AV_CH_TOP_CENTER             0x00000800
    #define AV_CH_TOP_FRONT_LEFT         0x00001000
    #define AV_CH_TOP_FRONT_CENTER       0x00002000
    #define AV_CH_TOP_FRONT_RIGHT        0x00004000
    #define AV_CH_TOP_BACK_LEFT          0x00008000
    #define AV_CH_TOP_BACK_CENTER        0x00010000
    #define AV_CH_TOP_BACK_RIGHT         0x00020000
    #define AV_CH_STEREO_LEFT            0x20000000  ///< Stereo downmix.
    #define AV_CH_STEREO_RIGHT           0x40000000  ///< See AV_CH_STEREO_LEFT.
    #define AV_CH_WIDE_LEFT              0x0000000080000000ULL
    #define AV_CH_WIDE_RIGHT             0x0000000100000000ULL
    #define AV_CH_SURROUND_DIRECT_LEFT   0x0000000200000000ULL
    #define AV_CH_SURROUND_DIRECT_RIGHT  0x0000000400000000ULL
    #define AV_CH_LOW_FREQUENCY_2        0x0000000800000000ULL

    But looking over the header files and whatever little documentation about ffmpeg I couldn't find anything that tells me how to assign a specific channel position (or mask, as it's described in the header file) to a specific bus in a mixer audio unit.

    Do you know how to do that ? Please let me know if you want to look at the code I'm using right now.

    And as always, thank you so much.

  • 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;

  • How to combine 2 images with ffmpeg ?

    7 octobre 2018, par senops

    I have 2 images which I’d like to place one on top of the other. I made this line :

    ffmpeg -i "C:\image_1.jpg" -i "C:\image_2.jpg" -q:v 1 -filter_complex "[0:v]scale=800:-1[v0];[v0][1:v]vstack" C:\combined.jpg

    and it works when they have the same resolution 800x800 and when the resolution of the first one is smaller than image_2.

    Is it possible to add some mathematics instead of 800 to make this line suitable for any type of resolutions when the first one is bigger or the second is bigger (width and height separately) ?

    I want to find a maximal dimension and scale another image to it preserving aspect ratio. If the aspect ratio of 2 images is not the same fill the holes with plain white (255,255,255).

    I suppose the mathematics should be like this :

    w1, h1 - width and height of the 1st img
    w2, h2 - width and height of the 2st img
    w1', h1', w2', h2' - width and height of resulted images

    if w1 max{w1, h1, w2, h2} -> if w2/h2>=1 -> w2'=w1; h2'=h2*w2'/w2
    if w1 max{w1, h1, w2, h2} -> if w2/h2&lt;1  -> h2'=w1; w2'=w2*h2'/h2

    if h1 max{w1, h1, w2, h2} -> if w2/h2>=1 -> w2'=h1; h2'=h2*w2'/w2
    if h1 max{w1, h1, w2, h2} -> if w2/h2&lt;1  -> h2'=h1; w2'=w2*h2'/h2

    if w2 max{w1, h1, w2, h2} -> if w1/h1>=1 -> w1'=w2; h1'=h1*w1'/w1
    if w2 max{w1, h1, w2, h2} -> if w1/h1&lt;1  -> h1'=w2; w1'=w1*h1'/h1

    if h2 max{w1, h1, w2, h2} -> if w1/h1>=1 -> w1'=h2; h1'=h1*w1'/w1
    if h2 max{w1, h1, w2, h2} -> if w1/h1&lt;1  -> h1'=h2; w1'=w1*h1'/h1

    Example 1 Example 2

    If the two images i1 and i2 are 800x800 and - 436x800 resp :
    the combined image will be 800x1600.

    If the two images i1 and i2 are 300x400 and 200x500 resp :
    max(300,400,200,500)=500 ; 300x400 -> (300*500/400=375)x500 ; 200x500 -> 200x500. Align the smallest one (200x500) to center, fill the gaps (2 gaps : (375-200)/2=88) with white (255,255,255).