Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (57)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (8321)

  • How to Convert video into mp3 using ffmpeg in nodejs and angular and save converted audio into the database

    2 septembre 2021, par Amir Shahzad

    This is nodejs server side code

    


    const express = require('express');
const ffmpeg  = require('fluent-ffmpeg');
const fileUpload = require('express-fileupload');
const mongoose = require('mongoose');
const cors   = require('cors')
const app = express();
const Video = require('./models/video');
mongoose.connect('mongodb://localhost:27017/YoutubeApp', {
    useNewUrlParser: true,
    useUnifiedTopology: true,
});
const db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error'));
db.once('open', () => {
   console.log('Data Base Connected Successfully!');
});

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');

app.post('/mp4tomp3', (req, res) => {
const data = new Video({
     mp4: req.body.mp4
});
res.contentType('video/avi');
res.attachment('output.mp3');
req.files.mp4val.mv("temp/" + req.body, function(err) {
    if(err){
        res.sendStatus(500).send(err)
    }else{
        console.log("Fiel Uploaded Successfully.!");
    }
});
// Convertin Mp4 To Avi
ffmpeg('temp/' + req.files.mp4val.mp4)
.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')
 })


    


    Here i want to get input from the user with input tag and then want to convert video into audio and save into the database but i not know how i can do this

    


    This is video model file

    


    const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const videoSchema = new Schema({
    mp4: String,
});
module.exports = mongoose.model("Videos", videoSchema);


    


    **This is Typescript code in angular client side that handle user input and select video **

    


    import { ThrowStmt } from '@angular/compiler';
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { VideoConversionService } from 'src/services/video-conversion.service';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {

   submitted =false;
   form! : FormGroup
   data:any

   constructor(private formBuilder: FormBuilder,
       private videoService: VideoConversionService){}

   creatForm(){
    this.form = this.formBuilder.group({
    mp4: ['', Validators.required],
  });
  }
   ngOnInit(): void {
   this.creatForm();

  }


  convertVideo(){
    this.submitted = true
    this.videoService.conversion(this.form.value).subscribe(res => {
    this.data = res;
 })
 }

 }


    


    I do not know how to create logic to do that (convert video into audio using angular framework)

    


    This is app.component.html file where i want to get video from the user using input field

    


    <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;

    But my code is not working and video is not converting into audio

    &#xA;

    This is my video service file where i calling nodejs api to perform the task

    &#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;

    Please anyone can solve my problem Thanks in advance

    &#xA;

  • ffmpeg jpeg stream to webm only creates a file .webm with 1 frame (snapshot) or empty .webm file (mjpeg)

    14 novembre 2016, par moeiscool

    my problem is that when i try to turn a series of jpegs into a webm video. I either get a webm file with a single frame or a webm file with nothing in it (0 kb).

    var fs = require('fs');
    var path = require('path');

    var outStream = fs.createWriteStream(__dirname+'/output.webm');
    var ffmpeg = require('fluent-ffmpeg');

    this one is a mjpeg stream URL. it produces a file with nothing.

    //var proc = new ffmpeg({source:'http://xxx.xxx.xxx.xxx/goform/stream?cmd=get&amp;channel=0',timeout:0})

    this one is a snapshot URL. it produces a file with a single frame.

    var proc = new ffmpeg({source:'http://xxx.xxx.xxx.xxx/snapshot/view0.jpg',timeout:0})

    .fromFormat('mjpeg')
    .size('2048x1536')
    .toFormat('webm')
    .withVideoBitrate('800k')
    .withFps(20)

    I have tried to use pipe instead but no dice :(

    //.pipe(outStream,{end:false});
    .writeToStream(outStream,{end:false})

    any help is appreciated.

    at this point i am up for using a basic shell command with exec but when i try that i just get errors also. Yes, it goes without saying I am a noob.

    Side note :

    I have tried things like zoneminder but it just breaks with our cameras and the number of cameras. so i am making a bare bones solution to record them. With our current cloud service we are missing very important moments and its costing more in energy and time.

  • How to Convert video into mp3 format using ffmpeg in nodejs and angular and then save converted audio into the database

    2 septembre 2021, par Amir Shahzad

    This is nodejs server side file

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const ffmpeg  = require(&#x27;fluent-ffmpeg&#x27;);&#xA;const fileUpload = require(&#x27;express-fileupload&#x27;);&#xA;const mongoose = require(&#x27;mongoose&#x27;);&#xA;const cors   = require(&#x27;cors&#x27;)&#xA;const app = express();&#xA;const Video = require(&#x27;./models/video&#x27;);&#xA;mongoose.connect(&#x27;mongodb://localhost:27017/YoutubeApp&#x27;, {&#xA;    useNewUrlParser: true,&#xA;    useUnifiedTopology: true,&#xA;});&#xA;const db = mongoose.connection;&#xA;db.on(&#x27;error&#x27;, console.error.bind(console, &#x27;connection error&#x27;));&#xA;db.once(&#x27;open&#x27;, () => {&#xA;   console.log(&#x27;Data Base Connected Successfully!&#x27;);&#xA;});&#xA;&#xA;app.use(fileUpload({&#xA;   useTempFiles: true,&#xA;   tempFileDir: &#x27;temp/&#x27;&#xA;}));&#xA;app.use(express.json());&#xA;app.use(express.urlencoded({ extended: true }));&#xA;app.use(cors({ origin: &#x27;http://localhost:4200&#x27; }));&#xA;&#xA;&#xA;ffmpeg.setFfmpegPath(&#x27;/usr/bin/ffmpeg&#x27;);&#xA;&#xA;app.post(&#x27;/mp4tomp3&#x27;, (req, res) => {&#xA;  convertdata = req.body;&#xA;  console.log(&#x27;path of innput is&#x27;, req.body);&#xA;  function convert(input, output, callback) {&#xA;     ffmpeg(input)&#xA;         .output(output)&#xA;         .on(&#x27;end&#x27;, function() {                    &#xA;             console.log(&#x27;conversion ended&#x27;);&#xA;             callback(null);&#xA;           }).on(&#x27;error&#x27;, function(err){&#xA;              console.log(&#x27;error: &#x27;, err.code, err.msg);&#xA;              callback(err);&#xA;           }).run();&#xA;      }&#xA;     convert(convertdata, &#x27;./temp/output.mp3&#x27;, function(err){&#xA;        if(!err) {&#xA;          console.log(&#x27;conversion complete&#x27;);&#xA;&#xA; &#xA;     }&#xA; })&#xA;&#xA; app.listen(3000, () => {&#xA;    console.log(&#x27;Server Start On Port 3000&#x27;)&#xA; })&#xA;

    &#xA;

    In Convert function i not know how i can get input by the user i'm new in angular Please anyone can solve this out thanks in advance

    &#xA;

    This is video model file

    &#xA;

    const mongoose = require("mongoose");&#xA;const Schema = mongoose.Schema;&#xA;&#xA;const videoSchema = new Schema({&#xA;    mp4: String,&#xA;});&#xA;module.exports = mongoose.model("Videos", videoSchema);&#xA;

    &#xA;

    **This is Typescript code in angular client side that handle user input and select video **

    &#xA;

    import { ThrowStmt } from &#x27;@angular/compiler&#x27;;&#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;   constructor(private formBuilder: FormBuilder,&#xA;       private videoService: VideoConversionService){}&#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; })&#xA; }&#xA;&#xA; }&#xA;

    &#xA;

    I do not know how to create logic to do that (convert video into audio using angular framework)

    &#xA;

    This is app.component.html file where i want to get video from the user using input field

    &#xA;

    <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;

    But my code is not working and video is not converting into audio

    &#xA;

    This is my video service file where i calling nodejs api to perform the task

    &#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;

    Please anyone can solve my problem Thanks in advance

    &#xA;