
Recherche avancée
Autres articles (104)
-
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 -
Configuration spécifique d’Apache
4 février 2011, parModules spécifiques
Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
Création d’un (...) -
Personnaliser l’affichage de mon Médiaspip
27 mai 2013Vous pouvez modifier la configuration du squelette afin de personnaliser votre Médiaspip Voir aussi plus d’informations en suivant ce lien
Comment supprimer le nombre de vues d’affichage d’un média ?
Administrer > Gestion du squelette > Pages des articles et médias Cocher dans "Informations non affichées sur les pages de médias" les paramètres que vous ne souhaitez pas afficher.
Comment supprimer le titre de mon Médiaspip dans le bandeau horizontal ?
Administrer > Gestion du squelette > (...)
Sur d’autres sites (7778)
-
avfilter/vf_lut3d : add x86-optimized tetrahedral interpolation
6 octobre 2021, par Mark Reidavfilter/vf_lut3d : add x86-optimized tetrahedral interpolation
I spotted an interesting pattern that I didn't see before that leads to the implementation being faster.
The bit shifting table I was using before is no longer needed, and was able to remove quite a few lines.
I also add use of FMA on the AVX2 version.f32 1920x1080 1 thread with prelut
c impl
1434012700 UNITS in lut3d->interp, 1 runs, 0 skips
1434035335 UNITS in lut3d->interp, 2 runs, 0 skips
1423615347 UNITS in lut3d->interp, 4 runs, 0 skips
1426268863 UNITS in lut3d->interp, 8 runs, 0 skipssse2
905484420 UNITS in lut3d->interp, 1 runs, 0 skips
905659010 UNITS in lut3d->interp, 2 runs, 0 skips
915167140 UNITS in lut3d->interp, 4 runs, 0 skips
915834222 UNITS in lut3d->interp, 8 runs, 0 skipsavx
574794860 UNITS in lut3d->interp, 1 runs, 0 skips
581035090 UNITS in lut3d->interp, 2 runs, 0 skips
584116720 UNITS in lut3d->interp, 4 runs, 0 skips
581460290 UNITS in lut3d->interp, 8 runs, 0 skipsavx2
301698880 UNITS in lut3d->interp, 1 runs, 0 skips
301982880 UNITS in lut3d->interp, 2 runs, 0 skips
306962430 UNITS in lut3d->interp, 4 runs, 0 skips
305472025 UNITS in lut3d->interp, 8 runs, 0 skipsgbrap16 1920x1080 1 thread with prelut
c impl
1480894840 UNITS in lut3d->interp, 1 runs, 0 skips
1502922990 UNITS in lut3d->interp, 2 runs, 0 skips
1496114307 UNITS in lut3d->interp, 4 runs, 0 skips
1492554551 UNITS in lut3d->interp, 8 runs, 0 skipssse2
980777180 UNITS in lut3d->interp, 1 runs, 0 skips
986121520 UNITS in lut3d->interp, 2 runs, 0 skips
986489840 UNITS in lut3d->interp, 4 runs, 0 skips
998832248 UNITS in lut3d->interp, 8 runs, 0 skipsavx
622212360 UNITS in lut3d->interp, 1 runs, 0 skips
622981160 UNITS in lut3d->interp, 2 runs, 0 skips
645396315 UNITS in lut3d->interp, 4 runs, 0 skips
641057075 UNITS in lut3d->interp, 8 runs, 0 skipsavx2
321336400 UNITS in lut3d->interp, 1 runs, 0 skips
321268920 UNITS in lut3d->interp, 2 runs, 0 skips
323459895 UNITS in lut3d->interp, 4 runs, 0 skips
324949967 UNITS in lut3d->interp, 8 runs, 0 skips -
Decoding AAC audio with ffmpeg
21 janvier 2021, par Michael BrownI'm trying to decode an AAC audio stream in an ADTS container, which is streamed from an external hardware H264 encoder.


I've parsed out the ADTS and it tells me I've got a 2 channel, 44100 AAC Main profile frame. I setup the extra data bytes for the ffmpeg decoder and decode the frame successfully ? as follows :


(pseudo c++ code)


setup the decoder :


avcodec_find_decoder(codec_id);
avcodec_alloc_context3(context->codec);
avcodec_open2(context->av_codec_context, context->codec, nullptr);
av_init_packet(&context->av_raw_packet);



setup the extra data bytes :


// AOT_MAIN, 44.1kHz, Stereo
// 00001010 00010000
// extradata = 0x0A, 0X10
memcpy(context->av_codec_context->extradata, extradata, extradataLength);
avcodec_open2(context->av_codec_context, context->codec, nullptr);



then decode the frame :


// decode frame
const int len = avcodec_decode_audio4(context->av_codec_context, context->frame, &got_frame, &context->av_raw_packet);
*sampleRate = context->av_codec_context->sample_rate;
*sampleFormat = context->av_codec_context->sample_format;
*bitsPerSample = av_get_bytes_per_sample(context->av_codec_context->sample_fmt) * 8;
*channels = context->av_codec_context->channels;
*channelLayout = context->av_codec_context->channelLayout;
// get frame
*outDataSize = av_samples_get_buffer_size(nullptr, context->av_codec_context->channels, context->frame->nb_samples, context->av_codec_context->sample_fmt, 1);



The decoded frame :


// array of 8192 bytes, context info is as expected:
context->av_codec_context->channels = 2
context->av_codec_context->channelLayout = 3 (AV_CH_LAYOUT_STEREO)
context->frame->sample_fmt = 8 (AV_SAMPLE_FMT_FLTP) // float, planar
context->frame->sample_rate = 44100



Now as I understand it each frame in the raw format for 32 bit will be 4 bytes per sample, and each channel will be interleaved (so every 4th byte is the alternating channel). That leaves me with 1024 samples for each channel (8192 / 32 bits / 2 channels).


I've tried exporting multiple frames of this data to a file, and importing as a raw file (32-bit float, 2 channel 44100Hz, little endian) in Audacity to sanity check. Instead of music, all I get is noise and the detected length of the audio is way longer than I would have expected (5 seconds dumped to file, but Audacity says 22.5 seconds). I've tried a variety of import format settings. What am I likely doing wrong here ?


I'm a little new to working with audio, so I may be misunderstanding something.


Edit : I tried panning the audio to the right channel, and its reflected in the data. It also looks like a repeating pattern exactly 1024 samples apart, which indicates to me a programming error with a buffer not getting overwritten after the first sample.



-
How to pass through complex command line arguments in Process.Arguments ?
5 juin 2015, par Louis de la VeritéIn C#, I have a complex set of arguments to pass through to
Process.Arguments
. I have circumvented the problem by using a one-line script of compiled Powershell. The exact "train" of arguments is :ffmpeg -framerate $fr -f image2 -i $temp\JPEG%01d -c:v libx264 -threads $threads -crf $encqual $video_out
Problematic arguments are the
-i
(with the JPEG%01 pattern) & the-c
argument. I have tried double escaping, but it’s not working any way I try. I don’t like the/<arg>: <val></val></arg>
notation because it conflicts with the-c:v
. As mentioned, I got it working by pass it off to PowerShell, but that’s a hack. The directory also gets parsed because it has spaces.ERROR :
"Unable to find a suitable output format for ’C :\Program’
"C :\Program" Invalid argument.CODE :
Process proc = new Process();
// proc.StartInfo = _fw.CreateProcessStartInfo4Ffmpeg(
pathTempDir, output);
proc.StartInfo = _fw.CreateProcessStartInfo4AviGen(pathTempDir, output);
proc.Start();
// doesn't work yet
public ProcessStartInfo CreateProcessStartInfo4Ffmpeg(string tempFile,
string output)
{
string args = FormCmdArgsForFfmpeg(this, tempFile, output);
ProcessStartInfo psi = CreateProcessStartInfo4Ffmpeg(this, args);
return psi;
}
public static ProcessStartInfo CreateProcessStartInfo4Ffmpeg(
FfmpegWrapper fw, string args)
{
string sExePath = clsRegistry.regInfo.FfmpegExePath;
ProcessStartInfo pi = new ProcessStartInfo(sExePath);
pi.UseShellExecute = false;
pi.CreateNoWindow = false;
pi.WindowStyle = ProcessWindowStyle.Normal;
pi.Arguments = String.Copy(args);
string sCmdFmtdMsg = string.Format("Command: ",
sExePath, pi.Arguments);
return pi;
} // end CreateProcessStartInfo4AviGen()
// N.B. doesn't work yet; args prob
public static string FormCmdArgsForFfmpeg(FfmpegWrapper fw,
string tempDir, string output)
{
/* -framerate $framerate -f image2 -i $temp_dir_jpgs\JPEG%01d
-c:v libx264 -threads $threads -crf $encode_quality $video_out
*/
string sFmtdArg2 = "-{0} \"{1}\" ";
string sFmtdArg1 = "-{0} ";
string sArgs = String.Empty;
string sout = null;
string pathInput = Path.Combine(tempDir, "JPEG%01d");
StringBuilder sb = new StringBuilder("");
sb.Append(string.Format(sFmtdArg2, "framerate", fw.framerate));
sb.Append(string.Format(sFmtdArg2, "f", "image2"));
sb.Append(string.Format(sFmtdArg2, "i", pathInput));
sb.Append(string.Format(sFmtdArg2, "c:v", "libx264"));
sb.Append(string.Format(sFmtdArg2, "threads", fw.threads) );
sb.Append(string.Format(sFmtdArg2, "crf", fw.encode_quality));
sb.Append(output);
sout = sb.ToString();
return sout;
}