
Recherche avancée
Autres articles (23)
-
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...) -
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation" -
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)
Sur d’autres sites (6461)
-
Command failed ffmpeg in Lambda function (Node js)
14 février 2019, par ArunI am trying to convert a video file to an audio file inside the lambda function. But I keep getting FFmpeg command failed error. I put FFmpeg binary exe file inside the project directory. but still, I am getting the same error. I tried this ( Lambda not connecting to ffmpeg ) but my issue is not solving yet. Any helps ?? thanks,
Here is my lambda function code
process.env.PATH = process.env.PATH + ':/tmp/';
process.env['FFMPEG_PATH'] = '/tmp/ffmpeg';
const BIN_PATH = process.env['LAMBDA_TASK_ROOT'];
process.env['PATH'] = process.env['PATH'] + ':' + BIN_PATH;
const fs = require('fs');
const AWS = require('aws-sdk');
AWS.config.update({
region : 'us-east-2'
});
const s3 = new AWS.S3({apiVersion: '2006-03-01'});
exports.handler = (event, context, callback) => {
require('child_process').exec(
'cp /var/task/ffmpeg /tmp/.; chmod 755 /tmp/ffmpeg;',
function (error, stdout, stderr) {
if (error) {
console.log('Erro occured',error);
} else {
var ffmpeg = require('ffmpeg');
var params = {
Bucket: "bucket_name",
Key: event.Records[0].s3.object.key
};
s3.getObject(params, function(err, data) {
if (err) {
console.log("Error", err);
}
fs.writeFile("/tmp/vid.mp4", data.Body, function (err) {
if (err) console.log(err.code, "-", err.message);
return callback(err);
}, function() {
try {
var stats = fs.statSync("/tmp/vid.mp4");
console.log("size of the file1 ", stats["size"]);
try {
console.log("Yeah");
var process = new ffmpeg('/tmp/vid.mp4');
process.then(function (video) {
// Callback mode
console.log("video function ", video);
video.fnExtractSoundToMP3('/tmp/video.mp3', function (error, file) {
if (!error)
console.log('Audio file: ' + file);
else console.log('error video ', error);
});
}, function (err) {
console.log('Error: ' + err);
});
} catch (e) {
console.log(e.code);
console.log(e.msg);
}
} catch (e) {
console.log("file is not complete", e);
}
});
return callback(err);
});
}
}
)
}Error message
{ Error: Command failed: ffmpeg -i /tmp/vid.mp4 -vn -ar 44100 -ac 2 -ab 192 -f mp3 /tmp/video.mp3
at ChildProcess.exithandler (child_process.js:275:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
killed: false,
code: null,
signal: 'SIGSEGV',
cmd: 'ffmpeg -i /tmp/vid.mp4 -vn -ar 44100 -ac 2 -ab 192 -f mp3 /tmp/video.mp3' } -
Concatenation and Transcoding of MPEG-TS files FFMPEG
20 décembre 2020, par SquawkBirdiesI have a DVR which records over-the-air TV and saves the recordings in the MPEG-TS format, splitting each episode across multiple files, each 500 MB in size.



To simplify archiving, I have been trying to write a shell script to automate the process of concatenating the files together and transcoding them into a more common video format, like h.264.



Here are the steps I have performed so far :



- 

- I wanted to make sure that the files I was getting were valid in the first place. To test this, each section was transcoded in Handbrake before being merged using ffmpeg's concat command. This worked, but was manual and added an annoying black frame between each section.
- I wrote a shell script to find all the sections of an episode in a folder and put the file names into a text file that the concat demuxer could parse.
- Tested this command :











ffmpeg -hide_banner -f concat -i video_files_tmp.txt -c:v libx264 -pix_fmt yuv420p -c:a aac $2$OUTPUT_FILE_NAME








During the transcode, this would throw many warnings and errors, such as "PES packet size mismatch". At some point, it would warn that more than 1,000 frame were skipped. When the output was played, it would skip frames and result in a file where the video froze partway through but the audio continued playing. I tried adding -vsync 0 to the output as well.



- 

- Then, tried splitting the concatenation and transcode into two steps :







ffmpeg -hide_banner -f concat -i video_files_tmp.txt -c copy output_tmp.ts
ffmpeg -hide_banner -i output_tmp.ts -c:v libx265 -pix_fmt yuv420p -c:a aac $2$OUTPUT_FILE_NAME








This did basically the same thing as before.



- 

- Tried using the libx265 encoder instead. Same result.
- Then, I tried just playing the concatenated MPEG-TS file directly, which also would freeze at some point during the playback.







I was wondering about what ffmpeg flags or options to set to get this working, or other options I could try ? Thanks !


-
How can I get duration of a video in java program using ffmpeg ?
4 mars 2019, par J JainI want to get duration of video and save it to database. I am running a java program to convert video into mp4 format, after conversion I want to get the duration of video.
[How to extract duration time from ffmpeg output ?
I have gone threw this link, that command is running well in cmd, but it is giving ’exit code = 1’ with java program.
Here is code :-
String videoDuration = "" ;
List args1 = new ArrayList() ;args1.add("ffmpeg");
args1.add("-i");
args1.add(videoFilePath.getAbsolutePath());
args1.add("2>&1");
args1.add("|");
args1.add("grep");
args1.add("Duration");
args1.add("|");
// args.add("awk");
// args.add("'" + "{print $2}" + "'");
// args.add("|");
args1.add("tr");
args1.add("-d");
args1.add(",");
String argsString = String.join(" ", args1);
try
{
Process process1 = Runtime.getRuntime().exec(argsString);
logger.debug(strMethod + " Process started and in wait mode");
process1.waitFor();
logger.debug(strMethod + " Process completed wait mode");
// FIXME: Add a logger increment to get the progress to 100%.
int exitCode = process1.exitValue();
if (exitCode != 0)
{
throw new RuntimeException("FFmpeg exec failed - exit code:" + exitCode);
}
else
{
videoDuration = process1.getOutputStream().toString();
}
}
catch (IOException e)
{
e.printStackTrace();
new RuntimeException("Unable to start FFmpeg executable.");
}
catch (InterruptedException e)
{
e.printStackTrace();
new RuntimeException("FFmpeg run interrupted.");
}
catch (Exception ex)
{
ex.printStackTrace();
}
return videoDuration;Updated Code :-
List<string> args1 = new ArrayList<string>();
args1.add("ffprobe");
args1.add("-i");
args1.add(videoFilePath.getAbsolutePath());
args1.add("-show_entries");
args1.add("format=duration");
args1.add("-v");
args1.add("quiet");
args1.add("-of");
args1.add("csv=\"p=0\"");
args1.add("-sexagesimal");
String argsString = String.join(" ", args1);
try
{
Process process1 = Runtime.getRuntime().exec(argsString);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
</string></string>