
Recherche avancée
Médias (1)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (54)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (7344)
-
doc/fftools-common-opts : document ffmpeg -h bsf=bitstream_filter_name
8 juin 2019, par Jun Zhao -
How to print the video meta output by the browser version of ffmpeg.wasm to the console of Google Chrome ?
17 janvier 2021, par helloAlI would like to ask about how to use the browser version of ffmpeg.wasm.


Through my investigation, I know that the following command can be used to output the video metadata to a file in the terminal of windows or mac.


ffmpeg -i testvideo.mp4 -f ffmetadata testoutput.txt



and then I can get this matadata like this :



I want to parse the metadata of the video through the browser, and then print the metadata to the Google console (or output to a file). At present, I know that the browser version of ffmpeg.wasm can achieve this function, but I have looked at its examples, which does not involve this part of the content. (https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/examples/browser/image2video.html)


But I want to print it to the console of Google Chrome through the browser version(usage:brower) of ffmpeg.wasm (https://github.com/ffmpegwasm/ffmpeg.wasm).
So I want to ask you how to achieve this, thank you.


-
FLAC created using libavformat/avcodec doesn't contain meta information
20 février 2024, par Brad MitchellI have a bit of code where I needed to convert PCM16LE to a FLAC which is simple enough. I've managed to do this, however, the generated FLAC file does not contain the duration of the file.


i.e. ffmpeg -i on a file showing the details :


Input #0, flac, from 'test.linear_l.flac':
 Metadata:
 encoder : Lavf57.25.100
 Duration: N/A, start: 0.000000, bitrate: N/A
 Stream #0:0: Audio: flac, 16000 Hz, stereo, s16



The code I'm using to convert from PCM 16 consists of the following calls :


AVFormatContext* ofmt_ctx = NULL;
avformat_alloc_output_context2(&ofmt_ctx, nullptr, nullptr, outputFile);
if (!ofmt_ctx)
{
ERROR("Unable to create output context for file: " << outputFile);
return ERROR;
}

// FLAC code
AVCodec* encoder = avcodec_find_encoder(AV_CODEC_ID_FLAC);
if (!encoder)
{
avformat_free_context(ofmt_ctx);
ERROR("FLAC encoder not found for file: " << outputFile);
return ERROR;
}

AVStream* flacStream = avformat_new_stream(ofmt_ctx, encoder);
if (!flacStream)
{
avformat_free_context(ofmt_ctx);
ERROR("Could not create new flac stream for file: " << outputFile);
return ERROR;
}

AVCodecContext* enc_ctx = flacStream->codec;
enc_ctx->sample_fmt = AV_SAMPLE_FMT_S16;
enc_ctx->sample_rate = sampleRate;
enc_ctx->channels = theMaxChannels;
enc_ctx->bit_rate = 0;

flacStream->time_base.den = enc_ctx->sample_rate;
flacStream->time_base.num = 1;

if (avcodec_open2(enc_ctx, encoder, nullptr) < 0)
{
avformat_free_context(ofmt_ctx);
ERROR("Could not open codec context for file: " << outputFile);
return ERROR;
}

if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;


if (avio_open(&ofmt_ctx->pb, outputFile, AVIO_FLAG_WRITE) < 0)
{
avformat_free_context(ofmt_ctx);
ERROR("Could not open FLAC output file: " << outputFile);
return ERROR;
}

if (avformat_write_header(ofmt_ctx, nullptr) < 0)
{
avformat_free_context(ofmt_ctx);
ERROR("Could not write FLAC file header for file: " << outputFile);
return ERROR;
}

AVPacket pkt;
av_init_packet(&pkt);
pkt.data = NULL;
pkt.size = 0;

AVFrame* frame = av_frame_alloc();
frame->nb_samples = enc_ctx->frame_size;
frame->format = enc_ctx->sample_fmt;
frame->channel_layout = enc_ctx->channel_layout;

int buffer_size = av_samples_get_buffer_size(NULL, enc_ctx->channels, enc_ctx->frame_size, enc_ctx->sample_fmt, 0);
if (buffer_size < 0)
{
avformat_free_context(ofmt_ctx);
ERROR("Could not get sample buffer size");
return ERROR;
}
uint16_t* samples = (uint16_t*)av_malloc(buffer_size);
if (!samples)
{
avformat_free_context(ofmt_ctx);
ERROR("Could not allocate " << buffer_size << " bytes for samples buffer");
return ERROR;
}

int ret = 0;

/* setup the data pointers in the AVFrame */
ret = avcodec_fill_audio_frame(frame, enc_ctx->channels, enc_ctx->sample_fmt, (const uint8_t*)samples, buffer_size, 0);```



For each block of RAW PCM16 LE data :


int got_output = 0;
frame->pts = pts;
pts+= (bytesRead/2);
ret = avcodec_encode_audio2(enc_ctx, &pkt, frame, &got_output);
if (got_output) 
{
av_interleaved_write_frame(ofmt_ctx, &pkt);
av_packet_unref(&pkt);
}```



Then finish off :


av_write_trailer(ofmt_ctx);
for (i = 0; i < ofmt_ctx->nb_streams; i++)
{
avcodec_close(ofmt_ctx->streams[i]->codec);
}
if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE))
avio_closep(&ofmt_ctx->pb);
avformat_free_context(ofmt_ctx); 
av_freep(&samples);
av_frame_free(&frame);



I'm sure I'm just missing something simple. I've tried looking at examples and doco but there isn't anything explicitly about encoding to a flac file etc in this case unless I'm missing it.