
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (63)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (12923)
-
C# FFMPEG : Code bugs out and stops producing media files
24 mai 2020, par HamezI've made a joke program in C# that uses ffmpeg to edit videos with different effects such as stuttering. I've finished 3 effects so far and each of them work on their own but as soon as I put one after another
e.g. fx.CrashStutter(0, 2); fx.CrashBeep(2, 2); fx.Wow(4, 2);

The code breaks and no longer produces photo/video files but once I stop debugging the file it was supposed to be processing appears. I've used a system where it loops over trying to execute a command to create a text file as a marker for when ffmpeg is done processing a file. The debug console also repeatedly says "The process tried to write to a nonexistent pipe."


Here's the code for all 3 effects :



public void Wow(double start, double duration)
 {
 if (fxstart == true)
 {
 //MessageBox.Show("WowFX Duration" + duration);
 string folderName = ("W_s" + start);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("mkdir " + folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cd " + folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("ffmpeg -ss " + start + " -t " + (duration / 6) + " -i " + source + " a.mp4");
 //wait until a.mp4 appears
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\a.txt") == false)
 {
 /*aha got a live one!*/FXcmd.StandardInput.WriteLine(" echo a > a.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -i a.mp4 -vf reverse -af areverse b.mp4");
 //wait until b.mp4 appears
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\b.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo b > b.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -ss " + start + " -t " + (duration / 3) + " -i " + source + " c.mp4");
 //wait until c.mp4 appears
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\c.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo c > c.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -i c.mp4 -vf reverse -af areverse d.mp4");
 //wait until d.mp4 appears
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\d.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo d > d.txt");
 System.Threading.Thread.Sleep(1500);
 }
 string[] concatList = { "file 'a.mp4'", "file 'b.mp4'", "file 'c.mp4'", "file 'd.mp4'" };
 //FXcmd.StandardInput.Write("del a.txt, b.txt, c.txt, d.txt");
 //System.Threading.Thread.Sleep(1000);
 System.IO.File.WriteAllLines(("FxSource(Temporary)\\" + folderName + "\\concatList.txt"), concatList);
 System.Threading.Thread.Sleep(1500);
 FXcmd.StandardInput.WriteLine("ffmpeg -f concat -i concatList.txt -c copy " + folderName + ".mp4");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\" + "1.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo 1 > 1.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("copy " + folderName + ".mp4 ..");
 while (File.Exists("FxSource(Temporary)\\" + folderName + ".mp4") == false)
 {
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("cd ..");
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cls");
 FXcmd.StandardInput.Flush();
 }
 }
 public void CrashStutter(int start, int duration)
 {
 if (fxstart == true)
 {
 string folderName = ("Cs_s" + start);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("mkdir " + folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cd " + folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("ffmpeg -ss " + start + " -t 0.1" + " -i " + source + " a.mp4");
 System.Threading.Thread.Sleep(100);
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\a.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo a > a.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -stream_loop "+10*duration+" -i a.mp4 "+folderName+".mp4");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\" + "1.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo 1 > 1.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("copy " + folderName + ".mp4 ..");
 while (File.Exists("FxSource(Temporary)\\" + folderName + ".mp4") == false)
 {
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("cd ..");
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cls");
 FXcmd.StandardInput.Flush();
 }
 }
 public void CrashBeep(int start, int duration)
 {
 //this effect cannot last longer than 7 seconds
 double contrast = 25;
 double red = 0.75;
 if (fxstart == true)
 {
 string folderName = ("Cb_s" + start);
 FXcmd.StandardInput.WriteLine("mkdir " + folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cd " + folderName);
 System.Threading.Thread.Sleep(100);
 /*gets stuck*/FXcmd.StandardInput.WriteLine("ffmpeg -i "+source+ " -vf fps=1 a.jpg");
 System.Threading.Thread.Sleep(100);
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\a.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo a > a.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -i a.jpg -vf eq=contrast="+contrast+" b.jpg");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\b.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo b > b.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -i b.jpg -vf colorbalance=rm=" + red + " c.jpg");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\c.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo > c.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -loop 1 -i c.jpg -c:v libx264 -t "+ duration +" -pix_fmt yuv420p -vf scale=1920:1080 d.mp4");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\d.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo d > d.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("cd ..");
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("copy beep.mp3 "+folderName+"/beep.mp3");
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cd "+folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("ffmpeg -i beep.mp3 -ss 0 -t " + duration + " e.mp3");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\e.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo e > e.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -i d.mp4 -i e.mp3 -c copy -map 0:v:0 -map 1:a:0 " + folderName + ".mp4");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\" + "1.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo 1 > 1.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("copy " + folderName + ".mp4 ..");
 while (File.Exists("FxSource(Temporary)\\" + folderName + ".mp4") == false)
 {
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("cd ..");
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cls");
 FXcmd.StandardInput.Flush();
 }
 }




Any suggestions ? Thanks !


-
FFMPEG Concat DNxHD-Files : wrong duration of output-file
4 mai 2020, par ThomasI have AVID-DNxHD-files created by Ikegami EditCamHD and FFMPEG-coded DNxHD-Files.



Ikegami-Files are 1080/25psF at 185MBit/sec (10Bit). FFMPEG-Files are crated with this command :



ffmpeg -loop 1 -i c:\pics\VideoNichtVorhanden.jpg -s 1920x1080 -r 25 -t 92.8 -c:v dnxhd -b:v 185M -pix_fmt yuv422p10le d:\MissingFiles\missing_0001.mov




ffprobe from Ikegami-file :



{
 "streams": [
 {
 "index": 0,
 "codec_name": "dnxhd",
 "codec_long_name": "VC3\/DNxHD",
 "profile": "DNXHD",
 "codec_type": "video",
 "codec_time_base": "1\/25",
 "codec_tag_string": "[0][0][0][0]",
 "codec_tag": "0x0000",
 "width": 1920,
 "height": 1080,
 "coded_width": 1920,
 "coded_height": 1088,
 "has_b_frames": 0,
 "sample_aspect_ratio": "1:1",
 "display_aspect_ratio": "16:9",
 "pix_fmt": "yuv422p10le",
 "level": -99,
 "color_space": "bt709",
 "field_order": "tt",
 "refs": 1,
 "r_frame_rate": "25\/1",
 "avg_frame_rate": "25\/1",
 "time_base": "1\/25",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 827,
 "duration": "33.080000",
 "bits_per_raw_sample": "10",
 "disposition": {
 "default": 0,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0
 },
 "tags": {
 "file_package_umid": "0x060A2B340101010101010F0013000000D6F21F070302074C060E2B347F7F2A80",
 "file_package_name": "File Package",
 "track_name": "V1"
 }
 },
 {
 "index": 1,
 "codec_type": "data",
 "codec_tag_string": "[0][0][0][0]",
 "codec_tag": "0x0000",
 "r_frame_rate": "0\/0",
 "avg_frame_rate": "0\/0",
 "time_base": "1\/90000",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 2977200,
 "duration": "33.080000",
 "disposition": {
 "default": 0,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0
 },
 "tags": {
 "file_package_umid": "0x060A2B34010101010101080013000000D6F21F070276074C060E2B347F7F2A80",
 "track_name": "A1",
 "data_type": "audio"
 }
 },
 {
 "index": 2,
 "codec_type": "data",
 "codec_tag_string": "[0][0][0][0]",
 "codec_tag": "0x0000",
 "r_frame_rate": "0\/0",
 "avg_frame_rate": "0\/0",
 "time_base": "1\/90000",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 2977200,
 "duration": "33.080000",
 "disposition": {
 "default": 0,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0
 },
 "tags": {
 "file_package_umid": "0x060A2B34010101010101080013000000D6F21F07028A074C060E2B347F7F2A80",
 "track_name": "A2",
 "data_type": "audio"
 }
 }
 ],
 "format": {
 "filename": "G:\\MXF-sortiert\\Ikegami\\2018-04-10\\V\\MULTI_NN17GN0V\\NN17GN0V.0001.MXF",
 "nb_streams": 3,
 "nb_programs": 0,
 "format_name": "mxf",
 "format_long_name": "MXF (Material eXchange Format)",
 "start_time": "0.000000",
 "duration": "33.080000",
 "size": "761004264",
 "bit_rate": "184039725",
 "probe_score": 100,
 "tags": {
 "operational_pattern_ul": "060e2b34.04010102.0d010201.10030000",
 "uid": "caf0bf8e-ff07-b34d-9616-bc3e7bd32d54",
 "generation_uid": "fb90769f-a46d-d546-983d-dda63339a8fd",
 "company_name": "Ikegami",
 "product_name": "HDN-X10",
 "product_version": "1.30d",
 "product_uid": "3e2189d7-294b-4612-8243-1b1990e14055",
 "modification_date": "2018-04-10T05:57:59.788000Z",
 "material_package_umid": "0x060A2B340101010101010F0013000000D6F21F070262074C060E2B347F7F2A80",
 "material_package_name": "01047",
 "timecode": "01:23:17:03"
 }
 }
}




ffprobe from ffmpeg-coded-file :



{
 "streams": [
 {
 "index": 0,
 "codec_name": "dnxhd",
 "codec_long_name": "VC3\/DNxHD",
 "profile": "DNXHD",
 "codec_type": "video",
 "codec_time_base": "1\/25",
 "codec_tag_string": "AVdn",
 "codec_tag": "0x6e645641",
 "width": 1920,
 "height": 1080,
 "coded_width": 1920,
 "coded_height": 1088,
 "has_b_frames": 0,
 "sample_aspect_ratio": "1:1",
 "display_aspect_ratio": "16:9",
 "pix_fmt": "yuv422p10le",
 "level": -99,
 "color_range": "tv",
 "color_space": "bt709",
 "refs": 1,
 "r_frame_rate": "25\/1",
 "avg_frame_rate": "25\/1",
 "time_base": "1\/12800",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 1187840,
 "duration": "92.800000",
 "bit_rate": "183500800",
 "bits_per_raw_sample": "10",
 "nb_frames": "2320",
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0
 },
 "tags": {
 "handler_name": "VideoHandler",
 "encoder": "Lavc58.54.100 dnxhd"
 }
 }
 ],
 "format": {
 "filename": "G:\\MXF-sortiert\\Ikegami\\2018-04-10\\V\\MULTI_NN1EUS0V\\MXF\\NN1EUS0V.0001.mov",
 "nb_streams": 1,
 "nb_programs": 0,
 "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
 "format_long_name": "QuickTime \/ MOV",
 "start_time": "0.000000",
 "duration": "92.800000",
 "size": "2128619444",
 "bit_rate": "183501676",
 "probe_score": 100,
 "tags": {
 "major_brand": "qt ",
 "minor_version": "512",
 "compatible_brands": "qt ",
 "encoder": "Lavf58.29.100"
 }
 }
}




When I concat for example one .mxf with one .mov and another .mxf at the end, the duration is frong (about 26 Miuntes when it should be some 4 Minutes or so) and VLC-Player gives a Framerate of a very slow framerate and the video does not play the ffmpeg coded part.



ffprobe from concat-output :



{
 "streams": [
 {
 "index": 0,
 "codec_name": "dnxhd",
 "codec_long_name": "VC3\/DNxHD",
 "profile": "DNXHD",
 "codec_type": "video",
 "codec_time_base": "20268137\/1351040",
 "codec_tag_string": "AVdn",
 "codec_tag": "0x6e645641",
 "width": 1920,
 "height": 1080,
 "coded_width": 1920,
 "coded_height": 1088,
 "has_b_frames": 0,
 "sample_aspect_ratio": "1:1",
 "display_aspect_ratio": "16:9",
 "pix_fmt": "yuv422p10le",
 "level": -99,
 "color_range": "tv",
 "color_space": "bt709",
 "refs": 1,
 "r_frame_rate": "25\/1",
 "avg_frame_rate": "1351040\/20268137",
 "time_base": "1\/12800",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 1216088220,
 "duration": "95006.892188",
 "bit_rate": "489252",
 "bits_per_raw_sample": "10",
 "nb_frames": "6333",
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0
 },
 "tags": {
 "handler_name": "VideoHandler"
 }
 }
 ],
 "format": {
 "filename": "G:\\MXF-sortiert\\Ikegami\\2018-04-10\\V\\NN1EUS0V_MIES.mov",
 "nb_streams": 1,
 "nb_programs": 0,
 "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
 "format_long_name": "QuickTime \/ MOV",
 "start_time": "0.000000",
 "duration": "95006.893000",
 "size": "5810367616",
 "bit_rate": "489258",
 "probe_score": 100,
 "tags": {
 "major_brand": "qt ",
 "minor_version": "512",
 "compatible_brands": "qt ",
 "encoder": "Lavf58.29.100"
 }
 }
}




The Ikegami and ffmpeg-coded files for themselves are playing great and do show the correct fps in VLC.



I can see in the probe-logs the



"codec_time_base": "20268137\/1351040"




and



"avg_frame_rate": "1351040\/20268137"




What is going wrong here ? How can I improve the coding-part and / or the concat to get a good result ? Is it only possible with re-encode instead of c:v copy ?



Any help welcome, thanks in advance,



tom


-
ffprobe returning video stream data twice
15 novembre 2015, par GeorgeKatI’m trying to return specific values from ffprobe :
ffprobe -v error -select_streams V:0 -show_entries stream=index,width,height,sample_aspect_ratio,display_aspect_ratio:format=duration -of default=noprint_wrappers=1:nokey=1 test.MTS
The stream values in the output are repeated :
0
1920
1080
1:1
16:9
0
1920
1080
1:1
16:9
116.640000The format value is not repeated.
If I strip the printer values to see what’s going on :ffprobe -v error -select_streams V:0 -show_entries stream=index,width,height,sample_aspect_ratio,display_aspect_ratio:format=duration test.MTS
I see a section called [PROGRAM] with stream 0 repeated within it :
[PROGRAM]
[STREAM]
index=0
width=1920
height=1080
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
[/STREAM]
[/PROGRAM]
[STREAM]
index=0
width=1920
height=1080
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
[/STREAM]
[FORMAT]
duration=116.640000
[/FORMAT]Can someone please help me to return only the video stream 0 values once ?