Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Autres articles (75)

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

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

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

  • How to use ffmpeg to convert video into the audio format with nodejs and angular in web app

    31 août 2021, par Amir Shahzad

    I want to convert the video into the audio format using ffmpeg in nodejs but I not know how I can implement it in the angular app with nodejs.

    


    This is my nodejs code

    


      const express = require('express');
  const ffmpeg  = require('fluent-ffmpeg');
  const fileUpload = require('express-fileupload');
  const cors   = require('cors')
  const app = express();

  app.use(fileUpload({
     useTempFiles: true,
     tempFileDir: 'temp/'
  }));
  app.use(express.json());
  app.use(express.urlencoded({ extended: true }));
  app.use(cors({ origin: 'http://localhost:4200' }));

  ffmpeg.setFfmpegPath('/usr/bin/ffmpeg');

  // Converting mp4 to audio
  app.post('/mp4tomp3', (req, res) => {
     res.contentType('video/avi');
     res.attachment('output.mp3');
     req.files.mp4.mv("temp/" + req.files.mp4.name , function(err) {
      if(err){
        res.sendStatus(500).send(err)
    }else{
        console.log("Fiel Uploaded Successfully.!");
    }
   });
     ffmpeg('temp/' + req.files.mp4.name)
       .toFormat('mp3')
       .on('end', function() {
            console.log('Done');
    })
   .on('error', function(err){
         console.log('An Error Occured' + err.message)
    })
    .pipe(res, {end: true})
  })

  app.listen(3000, () => {
    console.log('Server Start On Port 3000')
  })


    


    This code is working good when I use index.html file in the nodejs app but its give an error while I remove index.html file and use angular app for frontend then it give error in nodejs mp4 not defined and name mv is not defined Please tell me how I can implement it using angular framework

    


    This is my app.component.html file

    


       <div class="container">&#xA;     <h1>Video Proccessing App</h1>&#xA;     <form>&#xA;        <input type="file" formcontrolname="mp4" />&#xA;         <input type="submit" value="Convert" />&#xA;     </form>&#xA;  </div>&#xA;  &#xA;

    &#xA;

    This is my app.component.ts file

    &#xA;

         import { Component, OnInit } from &#x27;@angular/core&#x27;;&#xA;     import { FormBuilder, FormGroup, Validators } from &#x27;@angular/forms&#x27;;&#xA;     import { VideoConversionService } from &#x27;src/services/video-conversion.service&#x27;;&#xA;&#xA;     @Component({&#xA;        selector: &#x27;app-root&#x27;,&#xA;        templateUrl: &#x27;./app.component.html&#x27;,&#xA;        styleUrls: [&#x27;./app.component.css&#x27;]&#xA;     })&#xA;     export class AppComponent implements OnInit {&#xA;&#xA;         submitted =false;&#xA;         form! : FormGroup&#xA;         data:any&#xA;&#xA;&#xA;        constructor(private formBuilder: FormBuilder,&#xA;        private videoService: VideoConversionService){}&#xA;&#xA;&#xA;       creatForm(){&#xA;          this.form = this.formBuilder.group({&#xA;          mp4: [&#x27;&#x27;, Validators.required],&#xA;       });&#xA;      }&#xA;      ngOnInit(): void {&#xA;         this.creatForm();&#xA;&#xA;      }&#xA;&#xA;&#xA;      convertVideo(){&#xA;          this.submitted = true&#xA;          this.videoService.conversion(this.form.value).subscribe(res => {&#xA;          this.data = res;&#xA;         // console.log(this.data)&#xA;         //console.log(this.form.value)&#xA;     })&#xA;     }&#xA;&#xA;     }&#xA;

    &#xA;

    This is my service file for handling the backend api in my angular app

    &#xA;

    import { Injectable } from &#x27;@angular/core&#x27;;&#xA;import { HttpClient  } from &#x27;@angular/common/http&#x27;;&#xA;@Injectable({&#xA;  providedIn: &#x27;root&#x27;&#xA;})&#xA;export class VideoConversionService {&#xA;&#xA;constructor(private httpClient: HttpClient) { }&#xA;&#xA;conversion(data: any){&#xA;   return this.httpClient.post(&#x27;http://localhost:3000/mp4tomp3&#x27;, data)&#xA;}&#xA;}&#xA;

    &#xA;

    This is Screenshot of chrome error

    &#xA;

    while i click on convert button then chrome give that error

    &#xA;

    This is the screenshot of the nodejs app error while I click on the convert button

    &#xA;

    enter image description here

    &#xA;

  • ffmpeg Hardware acceleration (hw accel) has poor performance on Hololens 1

    12 avril 2021, par Dimitris

    I am building a library in C++ (dll) for decoding video h264 format. The problem is that on CPU is faster than GPU (hw accel).

    &#xA;

    In the CPU, the execution time is about 1200 micro secs and the total time on dll is 2600 micro.

    &#xA;

    In the GPU, the execution time is less, about 200 micro secs but transfer from GPU to CPU (RAM) has extra time, about 1100-1300 micro secs and the total time is 4200 micro. I am using the d3d11va/cuda hw accel device. That's all is not a problem on a PC, but I need the dll for the Hololens app (with poor performance) and I need to decode video on 30 fps in 1080p.

    &#xA;

    My code is based on this tutorial from ffmpeg github repository.

    &#xA;

    Do you have any suggestions on how to avoid the command av_hwframe_transfer_data(sw_frame, frame, 0) cause the bottleneck in the Hololens is about the transfer from GPU to CPU ?

    &#xA;

    Thank you

    &#xA;

  • Python Docker SDK long command to container [duplicate]

    2 avril 2021, par Neil Bernard

    I need to send a fairly long command using python docker SDK

    &#xA;

    ffmpeg -f lavfi -re -i smptebars=duration=60:size=1280x720:rate=30 -f lavfi -re -i sine=frequency=1000:duration=60:sample_rate=44100 -pix_fmt yuv420p -c:v libx264 -b:v 1000k -g 30 -keyint_min 120 -profile:v baseline -preset veryfast -f mpegts "srt://127.0.0.1:4200?pkt_size=1316"&#xA;

    &#xA;

    I have an example where you ned to wrap each element in double quotes.

    &#xA;

    container1 = client.containers.run("alpine", ["echo", "hello", "world"],name=&#x27;autotest&#x27;, detach=True)&#xA;

    &#xA;

    2 Questions

    &#xA;

    Is there an elegant way to do this ?&#xA;If not how do I handle the bits that already have quotes ?

    &#xA;