Recherche avancée

Médias (91)

Autres articles (82)

  • Emballe Médias : Mettre en ligne simplement des documents

    29 octobre 2010, par

    Le plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
    Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
    D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...)

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

  • 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

    


    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) => {
  convertdata = req.body;
  console.log('path of innput is', req.body);
  function convert(input, output, callback) {
     ffmpeg(input)
         .output(output)
         .on('end', function() {                    
             console.log('conversion ended');
             callback(null);
           }).on('error', function(err){
              console.log('error: ', err.code, err.msg);
              callback(err);
           }).run();
      }
     convert(convertdata, './temp/output.mp3', function(err){
        if(!err) {
          console.log('conversion complete');

 
     }
 })

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


    


    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

    


    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;

  • expected end of line but found unknown token

    17 juin 2017, par Denzil Williams

    Ok so after days of searching, here I am. I am new to ffmpeg, applescript, and terminal.

    I want to use ffmpeg to batch convert a group of selected files in any folder. I was successful in doing this by opening the terminal at the folder location and using this code :

    for f in *.flv; do ffmpeg -i "$f" -acodec libmp3lame -b:a 256k "${f%.flv}.mp3" &amp;&amp; rm "$f"; done

    which finds all flv files, and converts it to 256 bit rate mp3, then deletes the original files.

    Now I want it to be more automated, so I looked into creating a service. I tried running an apple script through automator, which I want it to open the terminal at the folder location the file then run the code to convert the files. Here’s the code I attempted :

    tell application "Finder" to set currentFolder to target of front Finder window as text
    set theWin to currentFolder's POSIX path

    tell application "Terminal"
       if not (exists window 1) then reopen
       activate
       do script "cd " &amp; quoted form of theWin &amp; ";clear" in window 1
       tell application "Terminal"
           do script "for f in *.flv; do ffmpeg -i "$f" -acodec libmp3lame -b:a 256k "${f%.flv}.mp3" &amp;&amp; rm "$f"; done"
       end tell
    end tell

    The first part of code opens up terminal at the folder location just fine. But when I add the part with the ffmpeg code it crashes. The error is apparently with the "$", those are what light up as the error, the error message says "Expected end of line, but found unknown token". Looking for some assistance please. I need the "$" because those are what make the loop work for renaming the files and such.

  • Big question of Target size, or video bitrate must be specified when using two-pass

    14 juillet 2022, par Rojojun

    I tried to solve the error which is Target size, or video bitrate must be specified when using two-pass.

    &#xA;

    But I couldn't find how to solve it and how to find path of video exactly I attached my code below this post

    &#xA;

    Please give me some tips of solving the problem !

    &#xA;

    @Service&#xA;public class ThumbnailService {&#xA;&#xA;    public HashMap exportThumbnail(File file) throws Exception {&#xA;        // file is from controller and form-data&#xA;        //String inputPath = "Users/hojunna/Download/my/";&#xA;        //String outputPath = "/usr/local/video/thumbnail/";&#xA;&#xA;        String ffmpegBasePath = "/opt/homebrew/bin/";&#xA;        FFmpeg ffmpeg = new FFmpeg(ffmpegBasePath&#x2B;"ffmpeg");        &#xA;        FFprobe ffprobe = new FFprobe(ffmpegBasePath&#x2B;"ffprobe");    &#xA;        &#xA;        FFmpegBuilder builder = new FFmpegBuilder()&#xA;                .setInput("/Users/hojunna/Desktop/" &#x2B; file)                         &#xA;                //.overrideOutputFiles(true)                    &#xA;                //.addExtraArgs("-ss", "00:00:01")          &#xA;                .addOutput("/Users/hojunna/Desktop/test.jpg")       &#xA;                .setFrames(1)&#xA;                .setVideoFilter("select=&#x27;gte(n\\,10)&#x27;,scale=200:-1")&#xA;                .done();&#xA;&#xA;        FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);      &#xA;        executor.createJob(builder).run();                                  &#xA;        executor.createTwoPassJob(builder).run();                           &#xA;&#xA;        HashMap resultMap = new HashMap();&#xA;        return resultMap;&#xA;    }&#xA;}&#xA;

    &#xA;