Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (80)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

Sur d’autres sites (9060)

  • FFmpeg crashing on drawtext filter (ffmpeg-python)

    31 août 2023, par DeadSec

    Hey guys so im trying to use ffmpeg-python to add text to a video but its crashing at

    


    [Parsed_drawtext_0 @ 0000012ea115ee80] Setting 'text' to value 'hi'

    


    and I'm not sure what I can do to fix this problem. I tried pure FFmpeg command-line style and still the same issue where it gets stuck at Setting text to value and it simply outputs a 0byte mp4 after crashing.

    


    My code :

    


    os.environ['FONTCONFIG_FILE'] = r'C:\Users\NOP\NOP\NOP\NOP\binaries\fonts\fonts.conf'
    os.environ['FONTCONFIG_PATH'] = r'C:\Users\NOP\NOP\NOP\NOP\binaries\fonts'
    os.environ['FC_CONFIG_DIR'] = r'C:\Users\NOP\NOP\NOP\NOP\binaries\fonts'
    in_ = ffmpeg.input(output_video_logo)
    in_ = in_.drawtext(text='hi')
    ffmpeg.output(in_, output_video).global_args('-loglevel', 'debug').run(cmd=FFMPEG_PATH)


    


    Font config file :

    


    &lt;?xml version="1.0"?>&#xA;&#xA;&#xA;<fontconfig>&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;    <dir>WINDOWSFONTDIR</dir>&#xA;    <dir>~/fonts</dir>&#xA;    <dir prefix="cwd">.</dir>&#xA;    <dir>~/.fonts</dir>&#xA;&#xA;&#xA;    <match target="pattern">&#xA;        <test qual="any">&#xA;            <string>mono</string>&#xA;        </test>&#xA;        <edit mode="assign">&#xA;            <string>monospace</string>&#xA;        </edit>&#xA;    </match>&#xA;&#xA;&#xA;    <match target="pattern">&#xA;        <test qual="any">&#xA;            <string>sans serif</string>&#xA;        </test>&#xA;        <edit mode="assign">&#xA;            <string>sans-serif</string>&#xA;        </edit>&#xA;    </match>&#xA;&#xA;&#xA;    <match target="pattern">&#xA;        <test qual="any">&#xA;            <string>sans</string>&#xA;        </test>&#xA;        <edit mode="assign">&#xA;            <string>sans-serif</string>&#xA;        </edit>&#xA;    </match>&#xA;&#xA;&#xA;    <include>conf.d</include>&#xA;&#xA;&#xA;&#xA;    <cachedir>WINDOWSTEMPDIR_FONTCONFIG_CACHE</cachedir>&#xA;    <cachedir>~/.fontconfig</cachedir>&#xA;&#xA;    <config>&#xA;&#xA;&#xA;        <rescan>&#xA;            <int>30</int>&#xA;        </rescan>&#xA;    </config>&#xA;&#xA;</fontconfig>&#xA;

    &#xA;

    Is this a issue with any of my fontconfig or script ? I'm really lost on fixing this.

    &#xA;

    As requested by Rotem tried adding new input to drawtext and this was the output before crashing with no error message :&#xA;Successfully opened the file.

    &#xA;

    [Parsed_drawtext_0 @ 00000171a2f0f900] Setting &#x27;box&#x27; to value &#x27;1&#x27;&#xA;[Parsed_drawtext_0 @ 00000171a2f0f900] Setting &#x27;boxcolor&#x27; to value &#x27;yellow&#x27;&#xA;[Parsed_drawtext_0 @ 00000171a2f0f900] Setting &#x27;fontcolor&#x27; to value &#x27;blue&#x27;&#xA;[Parsed_drawtext_0 @ 00000171a2f0f900] Setting &#x27;fontsize&#x27; to value &#x27;72&#x27;&#xA;[Parsed_drawtext_0 @ 00000171a2f0f900] Setting &#x27;text&#x27; to value &#x27;hi&#x27;&#xA;[Parsed_drawtext_0 @ 00000171a2f0f900] Setting &#x27;x&#x27; to value &#x27;10&#x27;&#xA;[Parsed_drawtext_0 @ 00000171a2f0f900] Setting &#x27;y&#x27; to value &#x27;10&#x27;&#xA;

    &#xA;

    Full log :&#xA;https://pastebin.com/E6sHvwUz

    &#xA;

  • Is there another way to export a frame in ffmpeg to a texture2d ? My code working in Windows but not Linux

    5 décembre 2024, par Robert Russell

    Sound is working in Linux the same as it did in Windows. But the video is just a black screen and when I attempt to save the frames as BMP files all of them were corrupt/empty files. I am using Ffmpeg.Autogen to interface with the libraries. https://github.com/Ruslan-B/FFmpeg.AutoGen. The file is VP8 and OGG in a MKV container. Though the extension is AVI for some reason.

    &#xA;&#xA;

    I tried messing with the order of the code a bit. I checked to make sure the build of Ffmpeg on Linux had VP8. I was searching online but was having trouble finding another way to do what I am doing. This is to contribute to the OpenVIII project. My fork-> https://github.com/Sebanisu/OpenVIII

    &#xA;&#xA;

    This just preps the scaler to change the pixelformat or else people have blue faces.

    &#xA;&#xA;

            private void PrepareScaler()&#xA;        {&#xA;&#xA;            if (MediaType != AVMediaType.AVMEDIA_TYPE_VIDEO)&#xA;            {&#xA;                return;&#xA;            }&#xA;&#xA;            ScalerContext = ffmpeg.sws_getContext(&#xA;                Decoder.CodecContext->width, Decoder.CodecContext->height, Decoder.CodecContext->pix_fmt,&#xA;                Decoder.CodecContext->width, Decoder.CodecContext->height, AVPixelFormat.AV_PIX_FMT_RGBA,&#xA;                ffmpeg.SWS_ACCURATE_RND, null, null, null);&#xA;            Return = ffmpeg.sws_init_context(ScalerContext, null, null);&#xA;&#xA;            CheckReturn();&#xA;        }&#xA;

    &#xA;&#xA;

    Converts Frame to BMP&#xA;I am thinking this is where the problem is. Because I had added bitmap.save to this and got empty BMPs.

    &#xA;&#xA;

    public Bitmap FrameToBMP()&#xA;        {&#xA;            Bitmap bitmap = null;&#xA;            BitmapData bitmapData = null;&#xA;&#xA;            try&#xA;            {&#xA;                bitmap = new Bitmap(Decoder.CodecContext->width, Decoder.CodecContext->height, PixelFormat.Format32bppArgb);&#xA;                AVPixelFormat v = Decoder.CodecContext->pix_fmt;&#xA;&#xA;                // lock the bitmap&#xA;                bitmapData = bitmap.LockBits(new Rectangle(0, 0, Decoder.CodecContext->width, Decoder.CodecContext->height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);&#xA;&#xA;                byte* ptr = (byte*)(bitmapData.Scan0);&#xA;&#xA;                byte*[] srcData = { ptr, null, null, null };&#xA;                int[] srcLinesize = { bitmapData.Stride, 0, 0, 0 };&#xA;&#xA;                // convert video frame to the RGB bitmap&#xA;                ffmpeg.sws_scale(ScalerContext, Decoder.Frame->data, Decoder.Frame->linesize, 0, Decoder.CodecContext->height, srcData, srcLinesize); //sws_scale broken on linux?&#xA;            }&#xA;            finally&#xA;            {&#xA;                if (bitmap != null &amp;&amp; bitmapData != null)&#xA;                {&#xA;                    bitmap.UnlockBits(bitmapData);&#xA;                }&#xA;            }&#xA;            return bitmap;&#xA;&#xA;        }&#xA;

    &#xA;&#xA;

    After I get a bitmap we turn it into a Texture2D so we can draw it.

    &#xA;&#xA;

     public Texture2D FrameToTexture2D()&#xA;        {&#xA;            //Get Bitmap. there might be a way to skip this step.&#xA;            using (Bitmap frame = FrameToBMP())&#xA;            {&#xA;                //string filename = Path.Combine(Path.GetTempPath(), $"{Path.GetFileNameWithoutExtension(DecodedFileName)}_rawframe.{Decoder.CodecContext->frame_number}.bmp");&#xA;&#xA;                //frame.Save(filename);&#xA;                BitmapData bmpdata = null;&#xA;                Texture2D frameTex = null;&#xA;                try&#xA;                {&#xA;                    //Create Texture&#xA;                    frameTex = new Texture2D(Memory.spriteBatch.GraphicsDevice, frame.Width, frame.Height, false, SurfaceFormat.Color); //GC will collect frameTex&#xA;                                                                                                                                        //Fill it with the bitmap.&#xA;                    bmpdata = frame.LockBits(new Rectangle(0, 0, frame.Width, frame.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);// System.Drawing.Imaging.PixelFormat.Format32bppArgb);&#xA;                    byte[] texBuffer = new byte[bmpdata.Width * bmpdata.Height * 4]; //GC here&#xA;                    Marshal.Copy(bmpdata.Scan0, texBuffer, 0, texBuffer.Length);&#xA;&#xA;                    frameTex.SetData(texBuffer);&#xA;&#xA;&#xA;                }&#xA;                finally&#xA;                {&#xA;                    if (bmpdata != null)&#xA;                    {&#xA;                        frame.UnlockBits(bmpdata);&#xA;                    }&#xA;                }&#xA;                return frameTex;&#xA;&#xA;            }&#xA;        }&#xA;

    &#xA;&#xA;

    I can post more if you want it's pretty much all up on my fork

    &#xA;&#xA;

    Video will play back as it does in Windows. As smooth as 15 fps can be. :)

    &#xA;

  • How to sync network audio with a different network video and play it with chewie

    26 mars 2023, par Rudra Sharma

    I am trying to stream a reddit videos on my app. For that reason I am using Reddit API but it is only giving the video url like 'redd.it/mpym0z9q8opa1/DASH_1080.mp4 ?source=fallback' with no audio but after some research I found out that we can get audio url by editing video url 'redd.it/mpym0z9q8opa1/DASH_audio.mp4 ?source=fallback'.

    &#xA;

    Now I have both audio and video url with me how can I sync them on network and stream them on my app using chewie package (video player).

    &#xA;

    This my code so far

    &#xA;

    import &#x27;dart:async&#x27;;&#xA;import &#x27;dart:convert&#x27;;&#xA;import &#x27;package:http/http.dart&#x27; as http;&#xA;import &#x27;package:flutter/material.dart&#x27;;&#xA;import &#x27;package:video_player/video_player.dart&#x27;;&#xA;import &#x27;package:chewie/chewie.dart&#x27;;&#xA;&#xA;void main() => runApp(MyApp());&#xA;&#xA;class MyApp extends StatelessWidget {&#xA;  @override&#xA;  Widget build(BuildContext context) {&#xA;    return MaterialApp(&#xA;      title: &#x27;Reddit Videos&#x27;,&#xA;      theme: ThemeData(&#xA;        primarySwatch: Colors.blue,&#xA;        visualDensity: VisualDensity.adaptivePlatformDensity,&#xA;      ),&#xA;      home: VideoPlayerScreen(),&#xA;    );&#xA;  }&#xA;}&#xA;&#xA;class VideoPlayerScreen extends StatefulWidget {&#xA;  @override&#xA;  _VideoPlayerScreenState createState() => _VideoPlayerScreenState();&#xA;}&#xA;&#xA;class _VideoPlayerScreenState extends State<videoplayerscreen> {&#xA;  final List<string> _videoUrls = [];&#xA;&#xA;  @override&#xA;  void initState() {&#xA;    super.initState();&#xA;    _loadVideos();&#xA;  }&#xA;&#xA;  Future<void> _loadVideos() async {&#xA;    try {&#xA;      final videoUrls =&#xA;          await RedditApi.getVideoUrlsFromSubreddit(&#x27;aww&#x27;);&#xA;&#xA;      setState(() {&#xA;        _videoUrls.addAll(videoUrls);&#xA;      });&#xA;    } catch (e) {&#xA;      print(e);&#xA;    }&#xA;  }&#xA;&#xA;  @override&#xA;  Widget build(BuildContext context) {&#xA;    return Scaffold(&#xA;      appBar: AppBar(&#xA;        title: Text(&#x27;Reddit Videos&#x27;),&#xA;      ),&#xA;      body: SafeArea(&#xA;        child: _videoUrls.isNotEmpty&#xA;            ? _buildVideosList()&#xA;            : Center(child: CircularProgressIndicator()),&#xA;      ),&#xA;    );&#xA;  }&#xA;&#xA;  Widget _buildVideosList() {&#xA;    return ListView.builder(&#xA;      itemCount: _videoUrls.length,&#xA;      itemBuilder: (context, index) {&#xA;        return Padding(&#xA;          padding: const EdgeInsets.all(8.0),&#xA;          child: Chewie(&#xA;            controller: ChewieController(&#xA;              videoPlayerController: VideoPlayerController.network(&#xA;                _videoUrls[index],&#xA;              ),&#xA;              aspectRatio: 9 / 16,&#xA;              autoPlay: true,&#xA;              looping: true,&#xA;              autoInitialize: true,&#xA;            ),&#xA;          ),&#xA;        );&#xA;      },&#xA;    );&#xA;  }&#xA;}&#xA;&#xA;class RedditApi {&#xA;  static const String BASE_URL = &#x27;https://www.reddit.com&#x27;;&#xA;  static const String CLIENT_ID = &#x27;id&#x27;;&#xA;  static const String CLIENT_SECRET = &#x27;secret&#x27;;&#xA;&#xA;  static Future> getVideoUrlsFromSubreddit(&#xA;      String subredditName) async {&#xA;    final response = await http.get(&#xA;        Uri.parse(&#x27;$BASE_URL/r/$subredditName/top.json?limit=10&#x27;),&#xA;        headers: {&#x27;Authorization&#x27;: &#x27;Client-ID $CLIENT_ID&#x27;});&#xA;&#xA;    if (response.statusCode == 200) {&#xA;      final jsonData = jsonDecode(response.body);&#xA;      final postsData = jsonData[&#x27;data&#x27;][&#x27;children&#x27;];&#xA;&#xA;      final videoUrls = <string>[];&#xA;&#xA;      for (var postData in postsData) {&#xA;        if (postData[&#x27;data&#x27;][&#x27;is_video&#x27;]) {&#xA;          videoUrls.add(postData[&#x27;data&#x27;][&#x27;media&#x27;][&#x27;reddit_video&#x27;]&#xA;              [&#x27;fallback_url&#x27;]);&#xA;        }&#xA;      }&#xA;&#xA;      return videoUrls;&#xA;    } else {&#xA;      throw Exception("Failed to load videos from subreddit");&#xA;    }&#xA;  }&#xA;}&#xA;</string></void></string></videoplayerscreen>

    &#xA;

    I think the code is self explainatory about what I am trying to achieve (Trying to make a client for reddit).

    &#xA;