
Recherche avancée
Médias (91)
-
Valkaama DVD Cover Outside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Valkaama DVD Cover Inside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (20)
-
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 -
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 (...)
-
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (3520)
-
How do you encode raw pcm_f32le audio to AAC encoded audio with FFmpeg (C/C++) ?
22 janvier 2020, par Suhail DoshiI am trying to encode raw audio (pcm_f32le) to AAC encoded audio. One thing I’ve noticed is that I can accomplish this via the CLI tool :
ffmpeg -f f32le -ar 48000 -ac 2 -c:a pcm_f32le -i out.raw out.m4a -y
This plays just fine and decodes fine.
The steps I’ve taken :
-
When I am using the C example code : https://ffmpeg.org/doxygen/3.4/encode_audio_8c-example.html and switch the encoder to
codec = avcodec_find_encoder(AV_CODEC_ID_AAC);
-
Output the various sample formats associated with AAC, it only provides FLTP. That assumes a planar/interleaved format.
-
This page seems to provide the various supported input formats per codec.
This is confusing because I don’t think my raw captured audio is interleaved. I’ve certainly tried passing it through and it doesn’t work as intended.
It will stay stuck here with this ret code indefinitely after calling
avcodec_receive_packet
:AVERROR(EAGAIN): output is not available in the current state - user must try to send input
Questions :
-
How can I modify the example code from FFmpeg to convert pcm_f32le raw audio to AAC encoded audio ?
-
Why is the CLI tool able to ?
-
I am using libsoundio to capture raw audio from Linux’s Dummy Output. I wonder how I could get a planar format to pass through to get AAC encoded audio.
-
If AAC is not a possibility, is doing so with MP3 ?
-
-
FFmpeg : replacing audio in live video stream
28 janvier 2020, par MathijsI’m using FFmpeg to encode and live-stream video captured through a DeckLink capture card. The video from the card comes with an audio stream, but I want to replace the audio stream with another. This other audio stream originates from the same source but is ran through an audio processor that adds a fixed delay. The audio is fed back in the pc that runs FFmpeg through a virtual soundcard (audio over IP, but to Windows it looks like a sound card).
I know how to compensate for this fixed delay, but the issue is that audio and video drift slowly out of sync as the stream runs. I’m assuming this is due to the small difference in clock speeds between the virtual soundcard and the DeckLink card.
I’ve tried the vsync option and the aresample filter in FFmpeg in an attempt to get audio and video to stay synced. However I haven’t succeeded in this yet. Is there a way to make FFmpeg resample the audio and/or drop/dup frames in order to get both streams to stay in sync ?
Currently I’m running this command, which fails to stay in sync.
ffmpeg.exe -f dshow -i audio="WNIP Input 1 (Wheatstone Network Audio (WDM))" -itsoffset 2.3 -f decklink -thread_queue_size 128 -i "DeckLink SDI (3)" -filter_complex "[1:v:0]bwdif,format=yuv420p,setdar=16/9,scale=-1:576:flags=bicubic[vidout];[0:a:0]aresample=min_comp=0.02:comp_duration=15:max_soft_comp=0.005[audioout]" -c:v libx264 -preset slow -crf 25 -maxrate 1200k -bufsize 2400k -map "[vidout]:0" -map "[audioout]:0" -vsync 1 -r 50 -g 90 -keyint_min 90 -sc_threshold 0 -c:a libfdk_aac -b:a 192k -ac 2 -f flv "rtmp://somewhere"
-
swr_convert float planar to S16
8 janvier 2020, par Kevin KouketsuHow convert using libav API
AV_SAMPLE_FMT_FLTP
toAV_SAMPLE_FMT_S16
I’m trying to figure out how to resample and encode PCM (captured from Microphone) 44.1KHz to AAC 48.0KHz
That’s my resampler initializer :
void initialize_resampler(SwrContext*& resamplerCtx, AVCodecContext* encoder, AVFrame*& rawResampledAudioFrame, AVStream* audioFormatStream)
{
int nb_samples = (encoder->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) ? encoder->sample_rate : encoder->frame_size;
int encoderFrameSize = encoder->channels * av_get_bytes_per_sample(encoder->sample_fmt) * encoder->frame_size;
rawResampledAudioFrame = allocate_audioframe(encoder->sample_fmt, encoder->channel_layout, encoder->sample_rate, nb_samples);
// Copy the stream parameters to the muxer
check(avcodec_parameters_from_context(audioFormatStream->codecpar, encoder));
// Create resampler context
resamplerCtx = swr_alloc();
if (resamplerCtx == nullptr)
throw std::runtime_error("Could not allocate resampler context");
// Set options
check(av_opt_set_int(resamplerCtx, "in_channel_count", 2, 0));
check(av_opt_set_int(resamplerCtx, "in_sample_rate", 44100, 0));
check(av_opt_set_sample_fmt(resamplerCtx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0));
check(av_opt_set_int(resamplerCtx, "out_channel_count", encoder->channels, 0));
check(av_opt_set_int(resamplerCtx, "out_sample_rate", encoder->sample_rate, 0));
check(av_opt_set_sample_fmt(resamplerCtx, "out_sample_fmt", encoder->sample_fmt, 0));
// initialize the resampling context
check(swr_init(resamplerCtx));
}And for resample I’ve this code :
AVPacket pkt{};
while (true)
{
AVPacket input_packet;
av_init_packet(&input_packet);
check(av_read_frame(inputContext, &input_packet));
check(avcodec_send_packet(decoderContext, &input_packet));
check(avcodec_receive_frame(decoderContext, decodedFrame));
// WHAT DO HERE swr_convert(resamplerContext, )
av_packet_unref(&input_packet);
av_init_packet(&pkt);
auto in_stream = inputContext->streams[pkt.stream_index];
auto out_stream = outputContext->streams[pkt.stream_index];
pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));
pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));
pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
pkt.pos = -1;
check(avcodec_send_frame(encoderContext, decodedFrame));
check(avcodec_receive_packet(encoderContext, &pkt));
check(av_interleaved_write_frame(outputContext, &pkt));
av_packet_unref(&pkt);
}REading the docs I can’t figure out what exactly I need to pass to function. I have this code to encode PCM to MP2 (output is
AV_SAMPLE_FMT_S16
)const uint8_t* inPtr[] { const_cast<const>(&pcmData[0]), nullptr, nullptr,nullptr,nullptr,nullptr,nullptr,nullptr };
uint8_t* outPtr[] { &resampledAudioData[0], nullptr, nullptr,nullptr,nullptr,nullptr,nullptr,nullptr };
int resampledSamplesCount{ swr_convert(
resamplerCtx,
outPtr,
maxResampledSamplesCount,
inPtr,
inputSampleCount) };
// Negativo indica erro.
check(resampledSamplesCount);
</const>pcmData is raw data from input
AVPacket
(PCM)What I get here is : MP2 isn’t planar so it uses the same outPtr[0] different from plannar which needs two valid pointers to same writable data. But what I need to pass to inPtr, for example ?
When I try to use the same code, ffmpeg try to write on outPtr[1] which is nullptr.