Recherche avancée

Médias (91)

Autres articles (80)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

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

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (2266)

  • About the delay of Electron playing FFpmeg transcoded video

    26 juillet 2020, par Yohann

    In the Electron project, you need to try to play the video screen of the camera

    


    The camera is Haikang’s webcam

    


    Get real-time video stream through RTSP protocol

    


    rtsp://admin:admin@192.168.0.253/main/Channels/

    


    There will be a delay of about 3s when playing through the VLC player

    


    Then when used in the project, create a websocket service in Electron through the main process, decode the rtsp video through fluent-ffmpeg, and convert it to flv stream and push it to the rendering process

    


    import * as express from 'express'
import * as expressWebSocket from 'express-ws'
import ffmpeg from 'fluent-ffmpeg'
import webSocketStream from 'websocket-stream/stream'
const path = require('path')

let ffmpegPath
if (process.env.NODE_ENV === 'development') {
  ffmpegPath = path.join(__static, 'ffmpeg', 'bin', 'ffmpeg.exe')
} else {
  ffmpegPath = path.join(process.cwd(), 'ffmpeg', 'bin', 'ffmpeg.exe')
}
ffmpeg.setFfmpegPath(ffmpegPath)

// Start video transcoding service
function videoServer () {
  let app = express()
  app.use(express.static(__dirname))
  expressWebSocket(app, null, {
    perMessageDeflate: true
  })
  app.ws('/rtsp/', rtspRequestHandle)
  app.listen(8888)
  console.log('Create a monitoring service')
}

//RTSP transcoding method
function rtspRequestHandle (ws, req) {
  console.log('rtsp request handle')
  const stream = webSocketStream(ws, {
    binary: true,
    browserBufferTimeout: 1000000
  },
  {
    browserBufferTimeout: 1000000
  })
  let url = req.query.url
  console.log('rtsp url:', url)
  try {
    ffmpeg(url)
      .addInputOption('-rtsp_transport', 'tcp', '-buffer_size', '102400') // Here you can add some RTSP optimized parameters
      .outputOptions([
        '-fflags',
        'nobuffer',
        '-tune',
        'zerolatency'
      ])
      .on('start', function () {
        console.log(url, 'Stream started.')
      })
      .on('codecData', function () {
        console.log(url, 'Stream codecData.')
      })
      .on('error', function (err) {
        console.log(url, 'An error occured: ', err.message)
      })
      .on('end', function () {
        console.log(url, 'Stream end!')
      })
      .outputFormat('flv').videoCodec('copy').noAudio().pipe(stream)
  } catch (error) {
    console.log(error)
  }
}

export default videoServer


    


    The rendering process parses the video stream and plays the video through flv.js

    


    <template>&#xA;  <div class="video">&#xA;    <video class="video-box" ref="player"></video>&#xA;  </div>&#xA;</template>&#xA;&#xA;<code class="echappe-js">&lt;script&gt;&amp;#xA;  import flvjs from &amp;#x27;flv.js&amp;#x27;&amp;#xA;  export default {&amp;#xA;    name: &amp;#x27;videopage&amp;#x27;,&amp;#xA;    props: {&amp;#xA;      rtsp: String&amp;#xA;    },&amp;#xA;    data () {&amp;#xA;      return {&amp;#xA;        player: null&amp;#xA;      }&amp;#xA;    },&amp;#xA;    mounted () {&amp;#xA;      console.log(flvjs.isSupported())&amp;#xA;      if (flvjs.isSupported()) {&amp;#xA;        let video = this.$refs.player&amp;#xA;        console.log(video)&amp;#xA;        if (video) {&amp;#xA;          this.player = flvjs.createPlayer({&amp;#xA;            type: &amp;#x27;flv&amp;#x27;,&amp;#xA;            isLive: true,&amp;#xA;            url: &amp;#x27;ws://localhost:8888/rtsp/?url=&amp;#x27; &amp;#x2B; this.rtsp&amp;#xA;          }, {&amp;#xA;            enableStashBuffer: true&amp;#xA;          })&amp;#xA;          console.log(this.player)&amp;#xA;          this.player.attachMediaElement(video)&amp;#xA;          try {&amp;#xA;            this.player.load()&amp;#xA;            this.player.play()&amp;#xA;          } catch (error) {&amp;#xA;            console.log(error)&amp;#xA;          }&amp;#xA;        }&amp;#xA;      }&amp;#xA;    },&amp;#xA;    methods: {&amp;#xA;      getCurrentFrame () {&amp;#xA;        let video = this.$refs.player&amp;#xA;        let scale = 1&amp;#xA;        let canvas = document.createElement(&amp;#x27;canvas&amp;#x27;)&amp;#xA;        canvas.width = video.videoWidth * scale&amp;#xA;        canvas.height = video.videoHeight * scale&amp;#xA;        canvas.getContext(&amp;#x27;2d&amp;#x27;).drawImage(video, 0, 0, canvas.width, canvas.height)&amp;#xA;        return canvas.toDataURL(&amp;#x27;image/png&amp;#x27;)&amp;#xA;      }&amp;#xA;    },&amp;#xA;    beforeDestroy () {&amp;#xA;      this.player &amp;amp;&amp;amp; this.player.destory &amp;amp;&amp;amp; this.player.destory()&amp;#xA;    }&amp;#xA;  }&amp;#xA;&lt;/script&gt;&#xA;&#xA;&#xA;

    &#xA;

    Then there will be a delay of about 3s when playing, and the delay will increase with the playing time

    &#xA;

    There will be a delay of 10 minutes in the later period

    &#xA;

    Is there any way to control this delay time

    &#xA;

    Or is there any other decoding scheme that can be used ?

    &#xA;

    Solutions that can support electron

    &#xA;

  • Why is ffmpeg not working under systemd timer

    5 juin 2020, par Syed Umair

    i am running a script to take screen shots from a video with ffmpeg it is working if a run it by have but not working when run by the systemd timer

    &#xA;&#xA;

    [Unit]&#xA;Description= take ss  &#xA;&#xA;[Service]&#xA;Type=simple&#xA;ExecStart=/var/www/run.sh&#xA;StandardError=journal&#xA;User=root&#xA;

    &#xA;&#xA;

    and the timer

    &#xA;&#xA;

    [Unit]&#xA;Description= take ss  &#xA;&#xA;[Timer]&#xA;OnCalendar=*:0/15&#xA;Persistent=true&#xA;&#xA;[Install]&#xA;WantedBy=timers.target&#xA;

    &#xA;&#xA;

    this is the code in the bash script

    &#xA;&#xA;

    for ($thum = 0; $thum &lt;= 7; $thum&#x2B;&#x2B;)&#xA;        {&#xA;            $count = $thum * 200;&#xA;            shell_exec("ffmpeg -ss $count -i $file -vframes 1 -q:v 1 $thum.jpg");&#xA;        }&#xA;

    &#xA;&#xA;

    the $file is the full path to the file

    &#xA;

  • FFmpeg for Aws Lambda Services connect command

    26 décembre 2018, par maniram

    I am using ffmpeg Services but my question ffmpeg connect to AWs Lambda Services Api and command how to connect this service.
    bellow command ffmpeg how to connect Aws lambda.

    WITHOUT AD CMD=> ffmpeg -probesize 100M -analyzeduration 20M -re -i "http://18.196.88.36:8080/hls/zola-gixoce-wuri-zayacu.m3u8" -strict -2 -c:v libx264 -pix_fmt yuv420p -c:a aac -map 0:0 -map 0:1 -ar 44100 -ab 128k -ac 2 -b:v 2567k -flags +global_header -bsf:a aac_adtstoasc -bufsize 1000k -f flv "rtmp ://a.rtmp.youtube.com/live2/8wm3-meku-7qgj-eyg8"