
Recherche avancée
Autres articles (35)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne 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 (...) -
Utilisation et configuration du script
19 janvier 2011, parInformations spécifiques à la distribution Debian
Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
Récupération du script
Le script d’installation peut être récupéré de deux manières différentes.
Via svn en utilisant la commande pour récupérer le code source à jour :
svn co (...) -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (6167)
-
How to split a .mkv file into sounds and vedio file ?
13 février 2020, par Ken YipI have a mkv file which contain 3 streams. I use ffprobe to get the info of my mkv file.
ffprobe ./demo/test2.mkv
I got this output
Input #0, matroska,webm, from './demo/test2.mkv':
Metadata:
encoder : libebml v0.7.7 + libmatroska v0.8.1
creation_time : 2011-02-16T16:06:17.000000Z
Duration: 00:03:41.08, start: 0.000000, bitrate: 1363 kb/s
Stream #0:0: Video: rv40, yuv420p, 720x480, SAR 1:1 DAR 3:2, 29.97 tbr, 1k tbn, 1k tbc (default)
Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp (default)
Stream #0:2: Audio: aac (LC), 48000 Hz, stereo, fltpThe audio streams should be vocal and background music. I would like to extract them from the video.
I have try to do so with those command
ffmpeg -i ./demo/test2.mkv -map_channel 0.1.0 -y ch0.wav -map_channel 0.2.0 -y ch1.wav
However, it output the same audio file. Is there any mistake I have made ? Thanks a lot.
-
Pass argument through .bat file to .exe file that converted by 'PyInstaller'
23 novembre 2019, par Ayoub OcarinaI got an error when passing arguments through .bat file to .exe file that converted by PyInstaller
In my python script I import the following libraries :import time
from contextlib import closing
from PIL import Image
import subprocess
from audiotsm import phasevocoder
from audiotsm.io.wav import WavReader, WavWriter
from scipy.io import wavfile
import numpy as np
import re
import math
from shutil import copyfile, rmtree
import os
import argparse
from pytube import YouTube
import cv2
from datetime import datetime
import datetime
import os.path
import shutil
import webbrowserand this is my .bat file content :
mode con: cols=100 lines=40
@echo off
COLOR 0A
title VideoCuts
:LOOP
if "%~1"=="" goto :END
ShortCut.exe --input_file "%~1" --silent_threshold 0.1 --silent_speed 9999999.00 --frame_margin 5 --sample_rate 48000 --frame_quality 1 --output_file "%~n1_%date:~-10,2%%date:~-7,2%%date:~-4,4%_%time:~0,2%%time:~3,2%%time:~6,2%_videocuts.mp4"
pauseI also tested using this .bat file :
ShortCut.exe --input_file="%~1" --silent_threshold=0.1 --silent_speed=9999999.00 --frame_margin=5 --sample_rate=48000 --frame_quality=1 --output_file="videocuts.mp4"
-
After downloading the file i got 0 byte file size, I dont know how to solve this error ? [closed]
7 octobre 2024, par Saurabh ChauhanThis is the handler function which converts a given format to another format but when i provide additional options(like trim audio,bitrate,codec,sample rate etc) to audio and video then it gives me 0 byte file after converting and if i do not include additional options then it gave me correct file.


Please look into this and provide me solution.


const handleConvert = async () => {

 if (!ffmpeg) return;

 setConverting(true);

 for (let uploadedFile of uploadedFiles) {
 const { file } = uploadedFile;
 const fileNameWithoutExtension = getFileNameWithoutExtension(file.name);
 const inputFile = file.name;
 let outputFile;
 let outputFormat;
 const { bitrate, channels, codec, sampleRate, trimStart, trimEnd, volume } = optionsdata;

 try {
 await ffmpeg.writeFile(inputFile, await fetchFile(file));
 let command = ['-i', inputFile];
 // Handle audio conversion with advanced options
> if (supportedAudioFormats.some(ext => file.name.endsWith(ext)) || supportedVideoFormats.some(ext => file.name.endsWith(ext))) {
 outputFile = `${fileNameWithoutExtension}.${audioFormat}`;
 outputFormat = audioFormat;

 // Add trim options if they exist
 if (trimStart && trimEnd) {
 command.push('-ss', trimStart, '-to', trimEnd);
 } else if (trimStart) {
 command.push('-ss', trimStart);
 }

 // Adjust volume if specified
 if (volume && volume !== 'no change') {
 command.push('-filter:a', `volume=${volume}`);
 }
 
 // Apply advanced audio settings like codec, bitrate, and channels
 if (codec) {
 command.push('-c:a', codec);
 }
 if (bitrate) {
 command.push('-b:a', `${bitrate}k`);
 }
> if (channels && channels !== 'no change') {
 command.push('-ac', channels === 'mono' ? '1' : '2');
 }
 if (sampleRate && sampleRate !== 'no change') {
 command.push('-ar', sampleRate);
 }

 // Add output file to the command
 command.push(outputFile);
 console.log('Command Array:', command);
 // Execute FFmpeg command
 await ffmpeg.exec(command);

 } else if (supportedImageFormats.some(ext => file.name.endsWith(ext))) {
 // Image conversion logic
 outputFile = `${fileNameWithoutExtension}.${imageFormat}`;
 outputFormat = imageFormat;
 command.push(outputFile);
 await ffmpeg.exec(command);

 } else if (supportedSubtitleFormats.some(ext => file.name.endsWith(ext))) {
 // Subtitle conversion logic
 outputFile = `${fileNameWithoutExtension}.${subtitleFormat}`;
 outputFormat = subtitleFormat;
 command.push(outputFile);
 await ffmpeg.exec(command);

 } else {
 console.error('Unsupported file type: ', file.name);
 continue; // Skip unsupported files
 }
 // Create Blob and URL for the converted file
 const data = await ffmpeg.readFile(outputFile);
 const convertedBlob = new Blob([data.buffer], {
 type: outputFormat === 'png' ? 'image/png' : `audio/${outputFormat}` || `text/vtt`,
 });
 const convertedUrl = URL.createObjectURL(convertedBlob);

 setConvertedFiles((prevFiles) => [
 ...prevFiles,
 { name: outputFile, url: convertedUrl, format: outputFormat },
 ]);
 } catch (error) {
 console.error('Conversion error:', error);
 }
 }

 setConversionFinished(true);
 setConverting(false);
 setoptionsdata({
 'codec':'',
 'bitrate':'',
 'channels':'',
 'volume':'',
 'sampleRate':'',
 'trimStart':'',
 'trimEnd':''
 });
};