
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (28)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
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 -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (3200)
-
avcodec/hw_base_encode : add FF_HW_ prefix for two enums
25 mai 2024, par Tong Wuavcodec/hw_base_encode : add FF_HW_ prefix for two enums
PICTURE_TYPE_* and FLAG_* are added FF_HW_ prefix after being moved to
base layer.Signed-off-by : Tong Wu <tong1.wu@intel.com>
- [DH] libavcodec/hw_base_encode.h
- [DH] libavcodec/vaapi_encode.c
- [DH] libavcodec/vaapi_encode_av1.c
- [DH] libavcodec/vaapi_encode_h264.c
- [DH] libavcodec/vaapi_encode_h265.c
- [DH] libavcodec/vaapi_encode_mjpeg.c
- [DH] libavcodec/vaapi_encode_mpeg2.c
- [DH] libavcodec/vaapi_encode_vp8.c
- [DH] libavcodec/vaapi_encode_vp9.c
-
FFMPEG- Duration of audio file is inaccurate
17 septembre 2015, par Tony ThanI have video file (mp4). I want to detach audio stream (AAC format) from that file and save in PC.
With below code, Generated aac file canplay now on KM player, but can not play on VLC player. Information of duration displays on player is wrong.
Please help me with this problem.err = avformat_open_input(input_format_context, filename, NULL, NULL);
if (err < 0) {
return err;
}
/* If not enough info to get the stream parameters, we decode the
first frames to get it. (used in mpeg case for example) */
ret = avformat_find_stream_info(*input_format_context, 0);
if (ret < 0) {
av_log(NULL, AV_LOG_FATAL, "%s: could not find codec parameters\n", filename);
return ret;
}
/* dump the file content */
av_dump_format(*input_format_context, 0, filename, 0);
for (size_t i = 0; i < (*input_format_context)->nb_streams; i++) {
AVStream *st = (*input_format_context)->streams[i];
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
*input_codec_context = st->codec;
*input_audio_stream = st;
FILE *file = NULL;
file = fopen("C:\\Users\\MyPC\\Downloads\\Test.aac", "wb");
AVPacket reading_packet;
av_init_packet(&reading_packet);
while (av_read_frame(*input_format_context, &reading_packet) == 0) {
if (reading_packet.stream_index == (int) i) {
uint8_t adts_header[7];
unsigned int obj_type = 0;
unsigned int num_data_block = (reading_packet.size)/1024;
int rate_idx = st->codec->sample_rate, channels = st->codec->channels;
uint16_t frame_length;
// include the header length also
frame_length = reading_packet.size + 7;
/* We want the same metadata */
/* Generate ADTS header */
if(adts_header == NULL) return -1;
/* Sync point over a full byte */
adts_header[0] = 0xFF;
/* Sync point continued over first 4 bits + static 4 bits
* (ID, layer, protection)*/
adts_header[1] = 0xF1;
/* Object type over first 2 bits */
adts_header[2] = obj_type << 6;
/* rate index over next 4 bits */
adts_header[2] |= (rate_idx << 2);
/* channels over last 2 bits */
adts_header[2] |= (channels & 0x4) >> 2;
/* channels continued over next 2 bits + 4 bits at zero */
adts_header[3] = (channels & 0x3) << 6;
/* frame size over last 2 bits */
adts_header[3] |= (frame_length & 0x1800) >> 11;
/* frame size continued over full byte */
adts_header[4] = (frame_length & 0x1FF8) >> 3;
/* frame size continued first 3 bits */
adts_header[5] = (frame_length & 0x7) << 5;
/* buffer fullness (0x7FF for VBR) over 5 last bits*/
adts_header[5] |= 0x1F;
/* buffer fullness (0x7FF for VBR) continued over 6 first bits + 2 zeros
* number of raw data blocks */
adts_header[6] = 0xFA;
adts_header[6] |= num_data_block & 0x03; // Set raw Data blocks.
fwrite(adts_header, 1, 7, file);
fwrite(reading_packet.data, 1, reading_packet.size, file);
}
av_free_packet(&reading_packet);
}
fclose(file);
return 0;
}
} -
ffmpeg : Cover image for video
15 avril 2014, par Michael HerrmannI have a video file
video.mp4
with sound (file information and download links below). I also have an imagecover.png
which contains a logo and a caption for the video. I want to create a new video which starts by showingcover.png
, then blends in the first frame ofvideo.mp4
within one second, then continues to playvideo.mp4
.My failed attempt :
I used ffmpeg to extract the first frame of
video.mp4
into image filefirst_frame.png
. I then created videofade.mp4
with a transition fromcover.png
tofirst_frame.png
:ffmpeg -loop 1 -i cover.png -r 24 -loop 1 -i first_frame.png -r 24 -filter_complex "[1:v][0:v]blend=all_expr='A*(if(gte(T,1),1,T/1))+B*(1-(if(gte(T,1),1,T/1)))'" -t 2 fade.mp4
I then wanted to simply concatenate
fade.mp4
andvideo.mp4
to produce the desired result. I created a filemylist.txt
with the following contents :file 'fade.mp4'
file 'video.mp4'Then I issued the following command to
ffmpeg
:ffmpeg -f concat -i mylist.txt -c copy out.mp4
Unfortunately, this produced a lot of warnings of the following form :
[concat @ 00000000003580e0] Invalid stream index 1:01:24.05 bitrate= 136.3kbits/s
The resulting video
out.mp4
does correctly start withfade.mp4
, but unfortunately continues with completely random colour patterns when it comes to playingvideo.mp4
.File information for
video.mp4
:- Stream 0 :
- Type : Video
- Codec : H264 - MPEG-4 AVC (part10) (avc1)
- Resolution : 800x600
- Frame rate : 24
- Decoded format : Planar 4:2:0 YUV
- Stream 1 :
- Type : Audio
- Codec : MPEG Audio layer 1/2/3 (mpga)
- Channels : Mono
- Sample rate : 16000 Hz
- Bitrate : 24 kb/s
File information for
cover.png
:- Resolution : 800x600
Links to files :
video.mp4
: https://www.dropbox.com/s/ci5wlz7abn232go/video.mp4cover.png
: https://www.dropbox.com/s/8eeon1j213s6l5x/cover.pngfirst_frame.mp4
: https://www.dropbox.com/s/hrxzcdjki0b9xqt/first_frame.pngfade.mp4
: https://www.dropbox.com/s/ohuf98xn3gmkniq/fade.mp4mylist.txt
: https://www.dropbox.com/s/kjqnzsa50uslqcr/mylist.txtout.mp4
: https://www.dropbox.com/s/0h27z7ahjg3pbbw/out.mp4
- Stream 0 :