
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (44)
-
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 (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (8262)
-
Wav file conversion/resampling options in C#
7 juin 2021, par oceansmovingBackground :


Trying to convert various wav files to a format that is accepted by the game CS:GO.
So as you can see below in the source code for a VB application that is successfully doing this (https://github.com/SilentSys/SLAM/blob/master/SLAM/Form1.vb), it's supposed to be :


- 

- Mono
- 16 Bit
- 22050hz








Private Sub FFMPEG_ConvertAndTrim(inpath As String, outpath As String, samplerate As Integer, channels As Integer, starttrim As Double, length As Double, volume As Double)
 Dim convert As New FFMpegConverter()
 convert.ExtractFFmpeg()

 Dim trimstring As String
 If length > 0 Then
 trimstring = String.Format("-ss {0} -t {1} ", starttrim.ToString("F5", Globalization.CultureInfo.InvariantCulture), length.ToString("F5", Globalization.CultureInfo.InvariantCulture))
 End If

 Dim command As String = String.Format("-i ""{0}"" -n -f wav -flags bitexact -map_metadata -1 -vn -acodec pcm_s16le -ar {1} -ac {2} {3}-af ""volume={4}"" ""{5}""", Path.GetFullPath(inpath), samplerate, channels, trimstring, volume.ToString("F5", Globalization.CultureInfo.InvariantCulture), Path.GetFullPath(outpath))
 convert.Invoke(command)
 End Sub



Now, the thing is I have very little experience with VB, and as it is C# I am trying to learn I don't want this to be a showstopper.


I have been able, in various ways to convert files that seem to be the correct format and can be played by normal media players, but is not accepted by the game, like the files converted with VB.


The different methods I've been trying without success :


int outRate = 22050;



using (var reader = new MediaFoundationReader(inFile))
 {
 var outFormat = new WaveFormat(outRate, 1);
 using (var resampler = new WaveFormatConversionStream(outFormat, reader))
 {
 WaveFileWriter.CreateWaveFile(outFile, resampler);
 }
 }



Next one gives me an error that everyone is referring to the LT version of the package to solve, that in turn requires license...


var ffMpeg = new FFMpegConverter();

 String args = $"-i '{@inFile}' -n -f wav -flags bitexact -map_metadata -1 -vn -acodec pcm_s16le -ar {outRate} -ac 1 '{@outFile}'";
 ffMpeg.Invoke(args);



Another


using (WaveFileReader reader = new WaveFileReader(inFile))
 {
 var outFormat = new WaveFormat(outRate, 1);
 using (var resampler = new MediaFoundationResampler(reader, outFormat))
 {
 WaveFileWriter.CreateWaveFile(outFile, resampler);
 }
 }



Another


FileStream fileStream = new FileStream(inFile, FileMode.Open);
 WaveFormat waveFormat = new WaveFormat(22050, 16, 1);
 var reader = new RawSourceWaveStream(fileStream, waveFormat);
 using (WaveStream convertedStream = WaveFormatConversionStream.CreatePcmStream(reader))
 {
 WaveFileWriter.CreateWaveFile(outFile, convertedStream);
 }
 fileStream.Close();



-
(issue) ffmpeg - usage of map & map_metadata options for correctly setting stream metadata & copying attachments
1er mai 2022, par deep_rootedUsing ffmpeg, I need to encode a series of video files with video, audio, subtitle and attachment streams (5 fonts). I would like to have all the streams in my output file while having fresh metadata for the audio and video streams (not copied from input).


However I see that ffmpeg is quite troublesome in metadata management. Because it retains all input file metadata by default, including audio, video bitrate, file size etc. This is undesirable.


After a lot of digging, I came up with the following solution which should work :


ffmpeg -i input.mkv -map_metadata 0:s:t -map 0 -c:v libx264 -c:a libopus output.mkv



The command above should copy all the streams, but will only copy metadata of the attachment files, since without attachment metadata, attachment streams can not be copied. This method skips copying audio, video metadata.


But this does not work. It shows the following error :




[matroska @ 000001d5fa6ad5c0] Attachment stream 3 has no filename tag.
Could not write header for output file #0 (incorrect codec parameters ?) : Invalid argument
Error initializing output stream 0:0 —




For some strange reason, it says Attachment stream 3 (first font file) has no filename tag. If no
map_metadata
option is used & only-map 0
is used, there is no error. So I tried setting the font file name with-metadata:s:3 filename="test.ttf"
. This solved the issue at hand but brought the same issue for next font stream (s#4).

Font Attachments have two metadata : (1) filename, (2) mimetype. It did not raise any issue for 2nd metadata. Honestly, it should not raise any issue for 1st metadata either, since these info should have been copied with
-map_metadata 0:s:t
Now of course I don't want to manually set all the font name, rather I would like to know a correct approach for this problem.

I have of course tried
-map_metadata -1
. But same problem. Since no metadata is copied, it raises the same error that it can't copy the attachment streams without filename.

-
Big question of Target size, or video bitrate must be specified when using two-pass
14 juillet 2022, par RojojunI tried to solve the error which is Target size, or video bitrate must be specified when using two-pass.


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


Please give me some tips of solving the problem !


@Service
public class ThumbnailService {

 public HashMap exportThumbnail(File file) throws Exception {
 // file is from controller and form-data
 //String inputPath = "Users/hojunna/Download/my/";
 //String outputPath = "/usr/local/video/thumbnail/";

 String ffmpegBasePath = "/opt/homebrew/bin/";
 FFmpeg ffmpeg = new FFmpeg(ffmpegBasePath+"ffmpeg"); 
 FFprobe ffprobe = new FFprobe(ffmpegBasePath+"ffprobe"); 
 
 FFmpegBuilder builder = new FFmpegBuilder()
 .setInput("/Users/hojunna/Desktop/" + file) 
 //.overrideOutputFiles(true) 
 //.addExtraArgs("-ss", "00:00:01") 
 .addOutput("/Users/hojunna/Desktop/test.jpg") 
 .setFrames(1)
 .setVideoFilter("select='gte(n\\,10)',scale=200:-1")
 .done();

 FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe); 
 executor.createJob(builder).run(); 
 executor.createTwoPassJob(builder).run(); 

 HashMap resultMap = new HashMap();
 return resultMap;
 }
}