
Recherche avancée
Autres articles (34)
-
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 (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
ANNEXE : Les extensions, plugins SPIP des canaux
11 février 2010, parUn plugin est un ajout fonctionnel au noyau principal de SPIP. MediaSPIP consiste en un choix délibéré de plugins existant ou pas auparavant dans la communauté SPIP, qui ont pour certains nécessité soit leur création de A à Z, soit des ajouts de fonctionnalités.
Les extensions que MediaSPIP nécessite pour fonctionner
Depuis la version 2.1.0, SPIP permet d’ajouter des plugins dans le répertoire extensions/.
Les "extensions" ne sont ni plus ni moins que des plugins dont la particularité est qu’ils se (...)
Sur d’autres sites (5833)
-
error when add arabic text to video ffmpeg c#
28 décembre 2020, par Fath Bakrii want to add Arabic annotation or text to video, i use ffmpeg version 4.3.1 in win 32 bit, here my code in c# :


private string AddVideo_Annotation(string text,int X,int Y)
 {
 try
 {

 string FFmpegPath = Utils.GetEXE_FFmpegPath();
 string path = Utils.GetProgramPath();
 //store outcome of process
 var errors = new StringBuilder();
 var output = new StringBuilder();
 var hadErrors = false;

 Process pdfprocess = new Process();

 
 //pdfprocess.StartInfo.LoadUserProfile = true;
 pdfprocess.StartInfo.RedirectStandardOutput = true;
 pdfprocess.StartInfo.RedirectStandardError = true;
 pdfprocess.StartInfo.UseShellExecute = false;
 
 pdfprocess.StartInfo.FileName = FFmpegPath;
 //text_shaping=1
 pdfprocess.StartInfo.Arguments = "-i \""+filePath+ "\" -vf -enable-libfribidi drawtext=\"text_shaping=1:text=\'" + text+ "\':x=" + X+":y="+Y+ ":fontsize=24:fontcolor=Red\" -c:a copy \"" + path + "\\out.mp4\"";
 
 //pdfprocess.StartInfo.WorkingDirectory = @"C:\Program Files\LibreOffice\program\";
 pdfprocess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

 pdfprocess.EnableRaisingEvents = true;

 // capture normal output
 pdfprocess.OutputDataReceived += (s, d) => {
 output.Append(d.Data);
 };

 // Capture error output
 pdfprocess.ErrorDataReceived += (s, d) => {
 if (!hadErrors)
 {
 hadErrors = !String.IsNullOrEmpty(d.Data);
 }
 errors.Append(d.Data);
 };
 pdfprocess.Start();
 pdfprocess.BeginErrorReadLine();
 pdfprocess.BeginOutputReadLine();
 try
 {
 while (pdfprocess.MainWindowHandle == IntPtr.Zero)
 {
 // Discard cached information about the process
 // because MainWindowHandle might be cached.
 pdfprocess.Refresh();
 
 Thread.Sleep(200);

 }
 }
 catch { }
 Thread.Sleep(2000);
 pdfprocess.WaitForExit();
 while ((Process.GetProcessesByName("ffmpeg").Length > 0))
 {
 Thread.Sleep(200);
 }


 string stderr = errors.ToString();

 if (pdfprocess.ExitCode != 0)
 {
 //MessageBox.Show("error:" + stderr);

 throw new Exception("FFmpeg.exe has exit wit code " + pdfprocess.ExitCode+"\n"+ stderr);
 }
 return path + "\\out"+new FileInfo( filePath).Extension;
 }
 catch(Exception ex)
 {
 TXT_AnnotationText.Text = ex.Message + "\n" + ex.StackTrace.ToString();
 MessageBox.Show(ex.Message + "\n" + ex.StackTrace.ToString());
 throw ex;
 }
 }




i get this error message :


FFmpeg.exe has exit wit code 1
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 10.2.1 (GCC) 20200726 configuration : —enable-gpl —enable-version3 —enable-sdl2 —enable-fontconfig —enable-gnutls —enable-iconv —enable-libass —enable-libdav1d —enable-libbluray —enable-libfreetype —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-libopus —enable-libshine —enable-libsnappy —enable-libsoxr —enable-libsrt —enable-libtheora —enable-libtwolame —enable-libvpx —enable-libwavpack —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxml2 —enable-libzimg —enable-lzma —enable-zlib —enable-gmp —enable-libvidstab —enable-libvmaf —enable-libvorbis —enable-libvo-amrwbenc —enable-libmysofa —enable-libspeex —enable-libxvid —enable-libaom —enable-libgsm —disable-w32threads —enable-libmfx —enable-ffnvcodec —enable-cuda-llvm —enable-cuvid —enable-d3d11va —enable-nvenc —enable-nvdec —enable-dxva2 —enable-avisynth —enable-libopenmpt —enable-amf libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D :\a.mp4' : Metadata : major_brand : mp42 minor_version : 0 compatible_brands : isommp42 creation_time : 2020-12-02T01:57:02.000000Z Duration : 00:01:37.70, start : 0.000000, bitrate : 125 kb/s Stream #0:0(eng) : Video : h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1280x662 [SAR 1:1 DAR 640:331], 124 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc (default) Metadata : creation_time : 2020-12-02T01:57:03.000000Z handler_name : Mainconcept MP4 Video Media Handler encoder : AVC Coding[NULL @ 05d306c0] Unable to find a suitable output format for 'drawtext=text_shaping=1:text='ظٹظ„ظٹظٹظ„ ظٹظ„ظٹط¨ظ„':x=200:y=200:fontsize=24:fontcolor=Red'drawtext=text_shaping=1:text='ظٹظ„ظٹظٹظ„ ظٹظ„ظٹط¨ظ„':x=200:y=200:fontsize=24:fontcolor=Red : Invalid argument
at EasyWhatsappSender.UserControls.UControl_VideoAudioPreview_Annotation.AddVideo_Annotation(String text, Int32 X, Int32 Y) in C :\Users\FathBakri\Documents\Visual Studio 2017\Projects\MediaViewer\UserControls\UControl_VideoAudioPreview_Annotation.cs:line 239


the error happen when i use text_shaping=1 , if i omit it and use Arabic text it display in symbols and not correct
how to fix it. Thanks for help

-
how to fix "FFmpeg cannot edit existing files in-place."-Problem in Java
7 juillet 2019, par SuioneI am trying to write an audio file to an existing videofile. Unfortunately I get the Logmessage, that I cannot edit existing files in-place.
I have found some threads about the so called muxing between video and audio, but none of them could help me out really. Maybe some one of you can.
Further this isn`t my could either. I am only the one who needs to use it, so I have to fix it.Thanks for your help
String[] args = { FFMPEG_FILE.getAbsolutePath(), "-y", "-i", videoPath, "-ss", String.valueOf(-offset.toFrames() / 50.0f), "-i", audioPath, "-c", "copy", "-map", "0:v", "-map","1:a", "-bsf:v", "h264_mp4toannexb","-r", String.valueOf(project.getFramerate()), "-shortest",outputPath };
ProcessBuilder pb = new ProcessBuilder(args).inheritIO();
Process p = pb.start();
int exit = p.waitFor();
if (exit != 0) {
throw new IOException("ffmpeg terminated with a failure");
}EDIT : As someone commented outputPath was same same as videopath. So switched it to another, so this problem would not appear again. But I still have no sound in my outputvideos. I give you the LOG-information, so maybe you can read something out of it.
INFO: start ffmpeg: [C:\Program Files\ffmpeg\bin\ffmpeg.exe, -y, -i, C:\Users\USERNAME\Desktop\Test_Workflow\1.mkv, -ss, 0.0, -i, C:\Users\USERNAME\Desktop\Test\resources/videos/P1000501.MP4\audio.ogg, -c, copy, -map, 0:v, -map, 1:a, -bsf:v, h264_mp4toannexb, -r, 25, -shortest, C:\Users\USERNAME\Desktop\Test\testoutput.mp4]
ffmpeg version N-92087-gdcbd89e000 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20180813
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 19.101 / 56. 19.101
libavcodec 58. 31.102 / 58. 31.102
libavformat 58. 18.104 / 58. 18.104
libavdevice 58. 4.105 / 58. 4.105
libavfilter 7. 33.100 / 7. 33.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Input #0, matroska,webm, from 'C:\Users\USERNAME\Desktop\Test_Workflow\1.mkv':
Metadata:
ENCODER : Lavf56.4.101
Duration: 00:00:04.60, start: 0.080000, bitrate: 1377 kb/s
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Input #1, ogg, from 'C:\Users\USERNAME\Desktop\Test\resources/videos/P1000501.MP4\audio.ogg':
Duration: 00:04:20.65, start: 0.000000, bitrate: 86 kb/s
Stream #1:0(und): Audio: vorbis, 48000 Hz, stereo, fltp, 112 kb/s
Metadata:
CREATION_TIME : 2018-11-09T13:20:07.000000Z
LANGUAGE : und
ENCODER : Lavc58.31.102 libvorbis
MAJOR_BRAND : mp42
MINOR_VERSION : 1
COMPATIBLE_BRANDS: mp42avc1
[mp4 @ 000001e67c0a00c0] track 1: codec frame size is not set
Output #0, mp4, to 'C:\Users\USERNAME\Desktop\Test\testoutput.mp4':
Metadata:
encoder : Lavf58.18.104
Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
Stream #0:1(und): Audio: vorbis (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 112 kb/s
Metadata:
CREATION_TIME : 2018-11-09T13:20:07.000000Z
LANGUAGE : und
ENCODER : Lavc58.31.102 libvorbis
MAJOR_BRAND : mp42
MINOR_VERSION : 1
COMPATIBLE_BRANDS: mp42avc1
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 113 fps=0.0 q=-1.0 Lsize= 824kB time=00:00:04.41 bitrate=1530.8kbits/s speed= 634x
video:772kB audio:43kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 1.092082% -
How to read percentage from ffmpeg command in java ?
23 juillet 2019, par Prasab RI am trying to convert video file to specific format by executing ffmpeg command. In that process I want to read percentage by using timepattern format. Somehow I am not able to do it.
I have tried using the below code. Specially I am getting null in the while loop condition.
import java.io.*;
import java.util.Scanner;
import java.util.regex.Pattern;
class Test {
public static void main(String[] args) throws IOException {
ProcessBuilder pb = new ProcessBuilder("ffmpeg","-i","in.webm","out.mp4");
final Process p = pb.start();
new Thread() {
public void run() {
Scanner sc = new Scanner(p.getErrorStream());
// Find duration
Pattern durPattern = Pattern.compile("(?<=Duration: )[^,]*");
String dur = sc.findWithinHorizon(durPattern, 0);
if (dur == null)
throw new RuntimeException("Could not parse duration.");
String[] hms = dur.split(":");
double totalSecs = Integer.parseInt(hms[0]) * 3600
+ Integer.parseInt(hms[1]) * 60
+ Double.parseDouble(hms[2]);
System.out.println("Total duration: " + totalSecs + " seconds.");
// Find time as long as possible.
Pattern timePattern = Pattern.compile("(?<=time=)[\\d.]*");
String match;
while (null != (match = sc.findWithinHorizon(timePattern, 0))) {
double progress = Double.parseDouble(match) / totalSecs;
System.out.printf("Progress: %.2f%%%n", progress * 100);
}
}
}.start();
}
}I am expecting a value in the while condition, but it coming as null.
enter code here