Recherche avancée

Médias (91)

Autres articles (104)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (13007)

  • FFMPEG and JNI - pass AVFrame data to Java and Back

    17 octobre 2015, par tishu

    I have some C code that decodes a video frame by frame. I get to a point where i have an AVFrame in BGR32 and would like to send it back to Java for editing.

    I have a ByteBuffer object in my C code that was created in Java using AllocateDirect but i struggle to write the content of the AVFrame->data[0] (of uint8_t type) to it and read it back. I have tried memcpy with no luck. Does anyone have an idea how to achieve this ?

    UPDATE
    Followed Will’s comment below and wrote this in C

    char *buf = (*pEnv)->GetDirectBufferAddress(pEnv, byteBuffer);
    memcpy(buf, rgb_frame->data[0], output_width*output_height*4);

    The buffer does contain some data in Java but doing the following returns a null bitmap

    BufferedImage frame = ImageIO.read(bitmapStream);

    Where bitmapStream is a ByteBufferInputStream defined here :
    https://code.google.com/p/kryo/source/browse/trunk/src/com/esotericsoftware/kryo/io/ByteBufferInputStream.java?r=205

    Not sure if I am not writing things correctly in this buffer

    UPDATE 2

    Got pretty close now thanks to the latest snippet. I am using BGR32 format in my C code ie 4 bytes per pixel. So I modified things a bit in Java :

    final byte[] dataArray = new byte[width*height*4];
    imageData.get(dataArray);
    final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
    final DataBuffer buffer = new DataBufferByte(dataArray, dataArray.length);
    Raster raster = Raster.createRaster(sampleModel, buffer, null);
    image.setData(raster);

    I get the image correctly but there seems to be an issue with color channels
    Example

    Tried different formats with no luck

  • Rebuilding Website for sharing videos

    22 novembre 2015, par Léo Le Gall

    Some friends and I run a sport forum with a decent user base. A lot of users wanted the ability to share video clips of their tricks. We didn’t really think anyone would use a video website that we made, so I built a really simple one just to see if the users would really use it. I hosted the video site on a $10 VPS, and it got blown away. The site was literally garbage, it was not visually appealing and the performance was just sad. Just as expected really, since this was just a test site. Since our test project was a success, we want to create a new and more polished site for the videos.

    The website is really simple, and probably not optimized in any way at the moment. I will try to explain in details what the website does. The user uploads some video files in format X, the website combines them and converts (using ffmpeg) the final video to mp4(so it can be served with a html5 video player). The users gets a link (example.com/randomvideo) where he can see the video through a html5 player serving the mp4 file(just default html5, nothing fancy). The videos only contains highlights, and the final video is always under 1 minute, most are around 30 seconds.

    Currently everything happens on the same server, both the video processing and the video serving. I can try to show how it works :

    1. User uploads some videos
    2. Servers stores the videos in a new random folder
    3. Combine videos and convert to mp4 (ffmpeg)
    4. Move final video(random name) to directory containing processed videos
    5. Store the name of the video file in the database (for website to serve it)
    6. Delete directory used to process the videos

    I want to rebuild the website’s architecture to make it able to scale and handle heavy load. I have never done this before and I am currently making a plan how to do this. My plan is at the moment :

    1. Seperate servers for processing videos and viewing videos (all VPS in the start)
    2. Utilize content delivery network for serving static files
    3. Utilize load balancers both for servers proccesing and serving

    I don’t really know what I should do with database(s). Can I do with one database or should use more ? They do not need to store sensitive information, since the auth in done through an API. They only need store information about the videos. I have experience with postgresql, mysql and redis, but I am not limited to those. What would you recommend in terms of scaleability ?

    I will appriciate all the feedback I can get regarding my plan and what to do about databases. I know this might be a bit vague, so please ask me if I have forgotten anything imporant. Thanks for reading.

  • 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'.

    


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

    


    This my code so far

    


    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;