Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (55)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (10987)

  • On-the-fly transcoding using derolf/transcoder

    8 septembre 2015, par user1811678

    https://github.com/derolf/transcoder

    I need to transcode locally and playback locally in my project, no other external connection to the server.
    It is a good source of doing on the fly transcoding by ffmpeg.

    In my case i have to transcode it to mp4 as it could perform faster.
    However i run into following problem, and i need some help in here to fix it.

    ----------------------------------------
    Exception happened during processing of request from ('127.0.0.1', 34089)
    Traceback (most recent call last):
     File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
       self.finish_request(request, client_address)
     File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
       self.RequestHandlerClass(request, client_address, self)
     File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
       self.finish()
     File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
       self.wfile.close()
     File "/usr/lib/python2.7/socket.py", line 279, in close
       self.flush()
     File "/usr/lib/python2.7/socket.py", line 303, in flush
       self._sock.sendall(view[write_offset:write_offset+buffer_size])
    error: [Errno 32] Broken pipe

    Here is my code :
    server.py

       from flask import Flask, request, Response, abort, send_file, jsonify
    import os, subprocess, re
    import config

    app = Flask(__name__)

    @app.route('/media/.js')
    def media_content_js(path):
       d= os.path.abspath( os.path.join( config.media_folder, path ) )
       print d
       if not os.path.isfile( d ): abort(404)
       cmdline= list()
       cmdline.append( config.ffmpeg )
       cmdline.append( "-i" )
       cmdline.append( d );
       print cmdline
       duration= -1
       FNULL = open(os.devnull, 'w')
       proc= subprocess.Popen( cmdline, stderr=subprocess.PIPE, stdout=FNULL )
       try:
           for line in iter(proc.stderr.readline,''):
               line= line.rstrip()
               #Duration: 00:00:45.13, start: 0.000000, bitrate: 302 kb/s
               m = re.search('Duration: (..):(..):(..)\...', line)
               if m is not None: duration= int(m.group(1)) * 3600 + int(m.group(2)) * 60 + int(m.group(3)) + 1
       finally:
           proc.kill()

       return jsonify(duration=duration)

    @app.route('/media/.mp4')
    def media_content_ogv(path):
       d= os.path.abspath( os.path.join( config.media_folder, path ) )
       print d
       if not os.path.isfile( d ): abort(404)
       start= request.args.get("start") or 0
       print start
       def generate():
           cmdline= list()
           cmdline.append( config.ffmpeg )
           cmdline.append( "-i" )
           cmdline.append( d );
           cmdline.append( "-ss" )
           cmdline.append( str(start) );
           cmdline.extend( config.ffmpeg_args )
           print cmdline
           FNULL = open(os.devnull, 'w')
           proc= subprocess.Popen( cmdline, stdout=subprocess.PIPE, stderr=FNULL )
           try:
               f= proc.stdout
               byte = f.read(512)
               while byte:
                   yield byte
                   byte = f.read(512)
           finally:
               proc.kill()

       return Response(response=generate(),status=200,mimetype='video/mp4',headers={'Access-Control-Allow-Origin': '*', "Content-Type":"video/mp4","Content-Disposition":"inline","Content-Transfer-Enconding":"binary"})

    @app.route('/', defaults={"path":"index.html"})
    @app.route('/')
    def static_content(path):
       d= os.path.abspath( os.path.join( config.static_folder, path ) )
       if not os.path.isfile( d ): abort(404)
       return send_file( d )

    app.run( host="0.0.0.0",port=config.port, threaded=True, debug=True )

    config.py

    media_folder=   "media"
    static_folder=  "static"
    port=       8123
    ffmpeg=     "/usr/bin/ffmpeg"

    ffmpeg_args=    [ "-f", "avi" ,"-acodec", "libfdk_aac", "-b:a", "128k", "-vcodec", "libx264", "-b:v", "1200k" , "-flags" , "+aic+mv4", "pipe:1"]

    index.html

       
       <code class="echappe-js">&lt;script src=&quot;http://vjs.zencdn.net/4.5/video.js&quot;&gt;&lt;/script&gt;

    &lt;script src=&quot;http://code.jquery.com/jquery-1.9.1.min.js&quot;&gt;&lt;/script&gt;

    &lt;script&gt;<br />
           var video= videojs('video');<br />
           video.src(&quot;media/testavi.avi.mp4&quot;);<br />
    <br />
           // hack duration<br />
           video.duration= function() { return video.theDuration; };<br />
           video.start= 0;<br />
           video.oldCurrentTime= video.currentTime;<br />
           video.currentTime= function(time) <br />
           { <br />
               if( time == undefined )<br />
               {<br />
                   return video.oldCurrentTime() + video.start;<br />
               }<br />
               console.log(time)<br />
               video.start= time;<br />
               video.oldCurrentTime(0);<br />
               video.src(&quot;media/testavi.avi.mp4?start=&quot; + time);<br />
               video.play();<br />
               return this;<br />
           };<br />
    <br />
           $.getJSON( &quot;media/testavi.avi.js&quot;, function( data ) <br />
           {<br />
               video.theDuration= data.duration;<br />
           });<br />
       &lt;/script&gt;
  • ffmpeg node js s3 stream screenshots qestion

    20 octobre 2015, par user3564443

    On my Node js server I need get video from s3, generate thumbnail for it, set thumbnail to s3, without saving video or thumbnail on my server. So I need to use streams for this. For thumbnail generation I use fluent-ffmpeg.

    Is it possible to get screenshots from streams using fluent-ffmpeg ?

    Is the correct way to intercept s3 getObject stream, that there was no need to download full video ?

    var config = require('../config');
    var AWS = require('aws-sdk');
    AWS.config.update({
     accessKeyId: config.AWS_accessKeyId,
     secretAccessKey: config.AWS_secretAccessKey,
     region: 'eu-west-1'
    });
    var s3 = new AWS.S3();
    var fs = require('fs');
    var ffmpeg = require('fluent-ffmpeg');

    exports.generateVideoThumbnail = function(fileId, url, done) {
     var params = {
       Bucket: config.AWS_bucket,
       Key: url
     };
     var input = s3.getObject(params);
     var stream = fs.createWriteStream('./screenshot.png');
     return ffmpeg(input).screenshots({
       timestamps: ['0.1', '0.2'],
       size: '200x200'
     }).output('./screenshot.png').output(stream).on('error', function(err) {
       return done(err);
     }).on('end', function() {
       input.close();
       var _key = "files/" + fileId + "/thumbnail.png";
       return s3.putObject({
         Bucket: config.AWS_bucket,
         Key: _key,
         Body: stream,
         ContentType: 'image/jpeg'
       }, function(err) {
         return done(err);
       });
     });
    };
  • ffmpeg streaming camera with directshow

    17 novembre 2015, par atu0830

    I am trying use ffmpeg to streaming one camera. The command is

    ffmpeg.exe -y  -f dshow -i video="AmCam" -c:v copy  -framerate 7.5 -map 0:0 -f ssegment -segment_time 4 -segment_format mpegts  -segment_list "web\stream.m3u8"  -segment_list_size 720  -segment_list_flags live  -segment_wrap 10 -segment_list_type m3u8  "web\segments\s%%d.ts"

    And I create a html in web folder

                                         
                                   
                                       
                                     
       <video controls="controls" width="720" height="405" autoplay="autoplay">  
           <source src="stream.m3u8" type="application/x-mpegURL"></source>          
       </video>                                    
                                       

    All ts file generated but looking Safari on iPad looding but it always show dark player and loading