
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (62)
-
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...) -
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 -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)
Sur d’autres sites (6375)
-
When generating a video from images and adding audio the video isn't playable
1er août 2017, par randommmanSo I have a bunch of images in a folder, with the following structure :
image-0.png
image-1.png
image-2.pngSometimes the folder can have just 1 image which will be saved as :
image-0.png
My code to generate the video and to add the audio
// create the file
using (WaveFileReader wf = new WaveFileReader(Audio))
{
// the files
OldVideo = "old.avi";
NewVideo = "video.avi";
Audio = "sound.wav";
// Get the time of the audio and divide by images
time = wf.TotalTime.TotalSeconds;
mimtime = time / imagescount;
ffmpegPath = "ffmpeg.exe";
ffmpegParams = " -r 1/" + mimtime + " -i " + ImagesFolder + "image-%d.png -t " + time + " -y -vf scale=1280:-2 " + OldVideo;
ffmaudioParams = " -i " + OldVideo + " -i " + Audio + " -c copy -shortest " + NewVideo;
}
using (Process ffmpeg = new Process())
{
//Generate video
ffmpegstartInfo = new ProcessStartInfo();
ffmpegstartInfo.FileName = ffmpegPath;
ffmpegstartInfo.Arguments = ffmpegParams;
ffmpegstartInfo.RedirectStandardOutput = true;
ffmpegstartInfo.RedirectStandardError = true;
ffmpegstartInfo.UseShellExecute = false;
ffmpegstartInfo.CreateNoWindow = true;
ffmpeg.StartInfo.FileName = ffmpegPath;
ffmpeg.StartInfo.Arguments = ffmpegParams;
ffmpeg.StartInfo = ffmpegstartInfo;
ffmpeg.Start();
ffmpeg.WaitForExit(30000);
/*ffmpeg.StartInfo.FileName = "cmd.exe";
ffmpeg.StartInfo.Arguments = "/k " + ffmpegPath + " " + ffmpegParams;
ffmpeg.Start();
ffmpeg.WaitForExit(30000);*/
}
using (Process ffmaudio = new Process())
{
//Add audio to video
ffmaudiostartInfo = new ProcessStartInfo();
ffmaudiostartInfo.FileName = ffmpegPath;
ffmaudiostartInfo.Arguments = ffmaudioParams;
ffmaudiostartInfo.RedirectStandardOutput = true;
ffmaudiostartInfo.RedirectStandardError = true;
ffmaudiostartInfo.UseShellExecute = false;
ffmaudiostartInfo.CreateNoWindow = true;
ffmaudio.StartInfo.FileName = ffmpegPath;
ffmaudio.StartInfo.Arguments = ffmaudioParams;
ffmaudio.StartInfo = ffmaudiostartInfo;
ffmaudio.Start();
ffmaudio.WaitForExit(30000);
/*ffmaudio.StartInfo.FileName = "cmd.exe";
ffmaudio.StartInfo.Arguments = "/k " + ffmpegPath + " " + ffmaudioParams;
ffmaudio.Start();
ffmaudio.WaitForExit(30000);*/
}So, what my code does, with the
wavfilereader
it gets the total length of my audio file, and then splits that time up by the number of images I have, so I can generate a video with the images split equally. Then I generate the video to a file called ’old.avi’, which is then used with my wav file to generate a new file called video.avi (which I am trying to have the generated video and audio together)My problem is when I generate the video it becomes uplayable. It claims to be (for example) 1 minute 50 seconds long, but once I click it, it won’t play. It just becomes unplayable, as you can see below
http://i.imgur.com/tsck2NX.gifv
I am using C# with process and Winforms, which opens the cmd line to run ffmpeg, with the 2 commands called above with the named variables below :
ffmpegParams;
ffmaudioParams;Which has all the commands I am using
-r 1/ (audio length /divided by total images) so they're equal
-t (to limit to the total time which is the audio's total seconds)
... I am using more as you can see in my code aboveHow can I fix my problem, that I have described ?
CMD line when generating the video :
ffmpeg version N-86848-g03a9e6f Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 68.100 / 55. 68.100
libavcodec 57.102.100 / 57.102.100
libavformat 57. 76.100 / 57. 76.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 95.100 / 6. 95.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, image2, from 'C:\Users\Laptop\Documents\program/images/image-%d.png':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgba(pc), 800x800, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[mpeg4 @ 00000000024f44a0] bitrate tolerance 4000000 too small for bitrate 200000, overriding
Output #0, avi, to 'C:\Users\Laptop\Documents\program/old.avi':
Metadata:
ISFT : Lavf57.76.100
Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x1280, q=2-31, 200 kb/s, 0.01 fps, 0.01 tbn, 0.01 tbc
Metadata:
encoder : Lavc57.102.100 mpeg4
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 1 fps=0.0 q=6.8 Lsize= 46kB time=00:01:37.57 bitrate= 3.9kbits/s speed=1.43e+003x
video:41kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 13.641467%When adding the audio to the video
ffmpeg version N-86848-g03a9e6f Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 68.100 / 55. 68.100
libavcodec 57.102.100 / 57.102.100
libavformat 57. 76.100 / 57. 76.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 95.100 / 6. 95.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, avi, from 'C:\Users\Laptop\Documents\program/old.avi':
Metadata:
encoder : Lavf57.76.100
Duration: 00:01:37.58, start: 0.000000, bitrate: 3 kb/s
Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 1280x1280 [SAR 1:1 DAR 1:1], 0.01 fps, 0.01 tbr, 0.01 tbn, 40 tbc
Guessed Channel Layout for Input Stream #1.0 : mono
Input #1, wav, from 'C:\Users\Laptop\Documents\program/audio.wav':
Duration: 00:01:37.57, bitrate: 352 kb/s
Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s
Output #0, avi, to 'C:\Users\Laptop\Documents\program/video.avi':
Metadata:
ISFT : Lavf57.76.100
Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 1280x1280 [SAR 1:1 DAR 1:1], q=2-31, 0.01 fps, 0.01 tbr, 0.01 tbn, 0.01 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=-1.0 Lsize= 55kB time=00:01:37.57 bitrate= 4.6kbits/s speed=1.95e+005x
video:41kB audio:4kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 21.946869% -
aaccoder : rewrite PNS implementation
6 septembre 2015, par Rostislav Pehlivanovaaccoder : rewrite PNS implementation
This commit rewrites the PNS implementation and significantly
improves sonic quality.The previous implementation marked an incredibly big amount
of SFBs to predict when there was no need for this and this
resulted in quite a large amount of artifacts. Also the
quantization was incorrect (av_clip(4+log2f(...))) which
led to 3x the intensity for PNS values leading to even more
artifacts.This commit rewrites the PNS search function and introduces
a major change : the PNS values are synthesized and are compared
to the current coefficients in addition to passing through
the revised checks to see whether PNS can be used.This decreases distortions and makes the current PNS implementation
mainly focused on replacing any low-power non-zero bands as well
as adding any zeroed bands back.The current encoder’s performance is enough (especially with
IS) so PNS isn’t really required except to fill in the occasional
few bands as well as extend any zeroed high frequency, so this
combination which is already enabled by default works
to get as much quality as it can within the bits allowed.Signed-off-by : Rostislav Pehlivanov <atomnuker@gmail.com>
-
aacenc_pred : rework the way prediction is done
29 août 2015, par Rostislav Pehlivanovaacenc_pred : rework the way prediction is done
This commit completely alters the algorithm of prediction.
The original commit which introduced prediction was completely
incorrect to even remotely care about what the actual coefficients
contain or whether any options were enabled. Not my actual fault.This commit treats prediction the way the decoder does and expects
to do : like lossy encryption. Everything related to prediction now
happens at the very end but just before quantization and encoding
of coefficients. On the decoder side, prediction happens before
anything has had a chance to even access the coefficients.Also the original implementation had problems because it actually
touched the band_type of special bands which already had their
scalefactor indices marked and it’s a wonder the asserion wasn’t
triggered when transmitting those.Overall, this now drastically increases audio quality and you should
think about enabling it if you don’t plan on playing anything encoded
on really old low power ultra-embedded devices since they might not
support decoding of prediction or AAC-Main. Though the specifications
were written ages ago and as times change so do the FLOPS.Signed-off-by : Rostislav Pehlivanov <atomnuker@gmail.com>