
Recherche avancée
Autres articles (52)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.
Sur d’autres sites (10039)
-
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();



-
Turn two sets of images into a single comparison video
20 janvier 2021, par bmvanity8723I have two folders with the exact same number of images : "folder1" and "folder2".


I want to take these images, convert them into two videos and have them rendered in the same video file. Think of it like a comparison video that's rendered side-by-side in the same file.


I can use ffmpeg to turn the still images into videos, but this will have one file for each video :


ffmpeg -start_number 0 -i "folder1/image-%06d.png" -c:v libx264 -vf "format=yuv420p" video1.mp4

ffmpeg -start_number 0 -i "folder2/image-%06d.png" -c:v libx264 -vf "format=yuv420p" video2.mp4



If I want to have both videos rendered side-by-side in the same file I would have to re-encode them, which means quality loss.


Is there a way to do this without the quality loss from reencoding ?


Or are there other tools other than ffmpeg that can do this work ?


-
ffmpeg works but gstreamer does not work for rtsp camera
11 janvier 2021, par Jinmo ChongI'm using Nvidia Jetson Tx2 device.


With the following command, I can connect and capture an image with ffmpeg.


$/usr/bin/ffmpeg -y -frames 1 snapshot.png -rtsp_transport tcp -i rtsp://admin:admin@192.168.10.131/1/profile





ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
 configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
 libavutil 55. 78.100 / 55. 78.100
 libavcodec 57.107.100 / 57.107.100
 libavformat 57. 83.100 / 57. 83.100
 libavdevice 57. 10.100 / 57. 10.100
 libavfilter 6.107.100 / 6.107.100
 libavresample 3. 7. 0 / 3. 7. 0
 libswscale 4. 8.100 / 4. 8.100
 libswresample 2. 9.100 / 2. 9.100
 libpostproc 54. 7.100 / 54. 7.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://admin:admin@192.168.10.131/1/profile':
 Metadata:
 title : SDP Descrption
 comment : SDP Description
 Duration: N/A, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1920x1080, 25 fps, 30 tbr, 90k tbn, 50 tbc
 Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
 Stream #0:2: Data: none
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
[swscaler @ 0x55a8f70c70] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55a8f70c70] No accelerated colorspace conversion found from yuv420p to rgb24.
Output #0, image2, to 'snapshot.png':
 Metadata:
 title : SDP Descrption
 comment : SDP Description
 encoder : Lavf57.83.100
 Stream #0:0: Video: png, rgb24, 1920x1080, q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc
 Metadata:
 encoder : Lavc57.107.100 png
frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.03 bitrate=N/A dup=1 drop=1 speed=0.066x 
video:1982kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown







But with gstreamer, (I'm using version 1.14.5) I am not able to access the rtsp feed.


$gst-launch-1.0 uridecodebin uri=rtsp://admin:admin@192.168.10.131/1/profile ! fakesink





Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://admin:admin@192.168.10.131/1/profile
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (request) SETUP stream 1
Progress: (request) SETUP stream 2
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Could not read from resource.
Additional debug info:
gstrtspsrc.c(5917): gst_rtsp_src_receive_response (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Could not receive message. (Timeout while waiting for server response)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...







I have also removed gstreamer-ugly pkg but it still does not work !


ref : https://forums.developer.nvidia.com/t/rtsp-gstreamer-simple-recieve-and-store-in-file/157535/12


Let me know if you can help me ! Thanks !