
Recherche avancée
Autres articles (100)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.
Sur d’autres sites (10100)
-
Converting mp4 audio & video for JavaScript's MediaSource API
10 janvier 2020, par CrayzzitSo I have two files.
frag_bunny.mp4
andraw.mp4
(you can download them in a tar on my Google drive). Thefrag_bunny.mp4
works perfectly when I use it with the JavaScript’s MediaSource API. But it’s not the case withraw.mp4
, why is that ?Here’s the
mediainfo
offrag_bunny.mp4
:General
Complete name : frag_bunny.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/avc1/iso5)
File size : 5.27 MiB
Duration : 1 min 0 s
Overall bit rate : 734 kb/s
Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3
Format settings : 2 Ref Frames
Format settings, CABAC : No
Format settings, ReFrames : 2 frames
Format settings, GOP : M=1, N=64
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1 min 0 s
Bit rate : 613 kb/s
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 23.976 (23976/1000) FPS
Minimum frame rate : 7.317 FPS
Maximum frame rate : 24.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.111
Stream size : 4.39 MiB (83%)
Language : English
Color range : Limited
Color primaries : BT.601 NTSC
Transfer characteristics : BT.709
Matrix coefficients : BT.601
Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : mp4a-40-2
Duration : 1 min 0 s
Bit rate mode : Constant
Bit rate : 64.0 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 22.05 kHz
Frame rate : 21.533 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 478 KiB (9%)
Language : English
Other #1
ID : 3
Type : Hint
Format : RTP
Codec ID : rtp
Duration : 1 min 0 s
Language : English
Other #2
ID : 4
Type : Hint
Format : RTP
Codec ID : rtp
Duration : 1 min 0 s
Language : EnglishAnd same for
raw.mp4
:General
Complete name : raw.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/iso2/avc1/mp41)
File size : 16.9 MiB
Duration : 3 min 32 s
Overall bit rate : 668 kb/s
Writing application : Lavf57.83.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3 min 32 s
Bit rate : 532 kb/s
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.092
Stream size : 13.4 MiB (80%)
Writing library : x264 core 152 r2854 e9a5903
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : mp4a-40-2
Duration : 3 min 32 s
Bit rate mode : Constant
Bit rate : 132 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 3.30 MiB (20%)
Default : Yes
Alternate group : 1And in my js, I’m using this codec :
...addSourceBuffer('video/mp4; codecs="avc1.42c00d,mp4a.40.2"')
-
Converting mp4 audio & video for HTML5
10 janvier 2020, par CrayzzitSo I have two files.
frag_bunny.mp4
andraw.mp4
(you can download them in a tar on my Google drive). Thefrag_bunny.mp4
works perfectly when I use it with the MediaSource’s JavaScript API. But it’s not the case withraw.mp4
, why is that ?Here’s the
mediainfo
offrag_bunny.mp4
:General
Complete name : frag_bunny.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/avc1/iso5)
File size : 5.27 MiB
Duration : 1 min 0 s
Overall bit rate : 734 kb/s
Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3
Format settings : 2 Ref Frames
Format settings, CABAC : No
Format settings, ReFrames : 2 frames
Format settings, GOP : M=1, N=64
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1 min 0 s
Bit rate : 613 kb/s
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 23.976 (23976/1000) FPS
Minimum frame rate : 7.317 FPS
Maximum frame rate : 24.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.111
Stream size : 4.39 MiB (83%)
Language : English
Color range : Limited
Color primaries : BT.601 NTSC
Transfer characteristics : BT.709
Matrix coefficients : BT.601
Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : mp4a-40-2
Duration : 1 min 0 s
Bit rate mode : Constant
Bit rate : 64.0 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 22.05 kHz
Frame rate : 21.533 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 478 KiB (9%)
Language : English
Other #1
ID : 3
Type : Hint
Format : RTP
Codec ID : rtp
Duration : 1 min 0 s
Language : English
Other #2
ID : 4
Type : Hint
Format : RTP
Codec ID : rtp
Duration : 1 min 0 s
Language : EnglishAnd same for
raw.mp4
:General
Complete name : raw.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/iso2/avc1/mp41)
File size : 16.9 MiB
Duration : 3 min 32 s
Overall bit rate : 668 kb/s
Writing application : Lavf57.83.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3 min 32 s
Bit rate : 532 kb/s
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.092
Stream size : 13.4 MiB (80%)
Writing library : x264 core 152 r2854 e9a5903
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : mp4a-40-2
Duration : 3 min 32 s
Bit rate mode : Constant
Bit rate : 132 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 3.30 MiB (20%)
Default : Yes
Alternate group : 1 -
avcodec_find_encoder_by_name() returns NULL
27 décembre 2019, par GiuTorI’m trying to compile the following example I found on ffmpeg documentation :
/*
* Copyright (c) 2001 Fabrice Bellard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
// compile with gcc -o encode_video encode_video.c -lavutil -lavcodec -lz -lm
/**
* @file
* video encoding with libavcodec API example
*
* @example encode_video.c
*/
#include
#include
#include
#include <libavcodec></libavcodec>avcodec.h>
#include <libavutil></libavutil>opt.h>
#include <libavutil></libavutil>imgutils.h>
static void encode(AVCodecContext *enc_ctx, AVFrame *frame, AVPacket *pkt,
FILE *outfile)
{
int ret;
/* send the frame to the encoder */
if (frame)
printf("Send frame %3"PRId64"\n", frame->pts);
ret = avcodec_send_frame(enc_ctx, frame);
if (ret < 0) {
fprintf(stderr, "Error sending a frame for encoding\n");
exit(1);
}
while (ret >= 0) {
ret = avcodec_receive_packet(enc_ctx, pkt);
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
return;
else if (ret < 0) {
fprintf(stderr, "Error during encoding\n");
exit(1);
}
printf("Write packet %3"PRId64" (size=%5d)\n", pkt->pts, pkt->size);
fwrite(pkt->data, 1, pkt->size, outfile);
av_packet_unref(pkt);
}
}
int main(int argc, char **argv)
{
const char *filename, *codec_name;
const AVCodec *codec;
AVCodecContext *c= NULL;
int i, ret, x, y;
FILE *f;
AVFrame *frame;
AVPacket *pkt;
uint8_t endcode[] = { 0, 0, 1, 0xb7 };
if (argc <= 2) {
fprintf(stderr, "Usage: %s <output file="file"> <codec>\n", argv[0]);
exit(0);
}
filename = argv[1];
codec_name = argv[2];
/* find the mpeg1video encoder */
codec = avcodec_find_encoder_by_name(codec_name);
if (!codec) {
fprintf(stderr, "Codec '%s' not found\n", codec_name);
exit(1);
}
c = avcodec_alloc_context3(codec);
if (!c) {
fprintf(stderr, "Could not allocate video codec context\n");
exit(1);
}
pkt = av_packet_alloc();
if (!pkt)
exit(1);
/* put sample parameters */
c->bit_rate = 400000;
/* resolution must be a multiple of two */
c->width = 352;
c->height = 288;
/* frames per second */
c->time_base = (AVRational){1, 25};
c->framerate = (AVRational){25, 1};
/* emit one intra frame every ten frames
* check frame pict_type before passing frame
* to encoder, if frame->pict_type is AV_PICTURE_TYPE_I
* then gop_size is ignored and the output of encoder
* will always be I frame irrespective to gop_size
*/
c->gop_size = 10;
c->max_b_frames = 1;
c->pix_fmt = AV_PIX_FMT_YUV420P;
if (codec->id == AV_CODEC_ID_H264)
av_opt_set(c->priv_data, "preset", "slow", 0);
/* open it */
ret = avcodec_open2(c, codec, NULL);
if (ret < 0) {
fprintf(stderr, "Could not open codec: %s\n", av_err2str(ret));
exit(1);
}
f = fopen(filename, "wb");
if (!f) {
fprintf(stderr, "Could not open %s\n", filename);
exit(1);
}
frame = av_frame_alloc();
if (!frame) {
fprintf(stderr, "Could not allocate video frame\n");
exit(1);
}
frame->format = c->pix_fmt;
frame->width = c->width;
frame->height = c->height;
ret = av_frame_get_buffer(frame, 32);
if (ret < 0) {
fprintf(stderr, "Could not allocate the video frame data\n");
exit(1);
}
/* encode 1 second of video */
for (i = 0; i < 25; i++) {
fflush(stdout);
/* make sure the frame data is writable */
ret = av_frame_make_writable(frame);
if (ret < 0)
exit(1);
/* prepare a dummy image */
/* Y */
for (y = 0; y < c->height; y++) {
for (x = 0; x < c->width; x++) {
frame->data[0][y * frame->linesize[0] + x] = x + y + i * 3;
}
}
/* Cb and Cr */
for (y = 0; y < c->height/2; y++) {
for (x = 0; x < c->width/2; x++) {
frame->data[1][y * frame->linesize[1] + x] = 128 + y + i * 2;
frame->data[2][y * frame->linesize[2] + x] = 64 + x + i * 5;
}
}
frame->pts = i;
/* encode the image */
encode(c, frame, pkt, f);
}
/* flush the encoder */
encode(c, NULL, pkt, f);
/* add sequence end code to have a real MPEG file */
if (codec->id == AV_CODEC_ID_MPEG1VIDEO || codec->id == AV_CODEC_ID_MPEG2VIDEO)
fwrite(endcode, 1, sizeof(endcode), f);
fclose(f);
avcodec_free_context(&c);
av_frame_free(&frame);
av_packet_free(&pkt);
return 0;
}
</codec></output>ffmpeg -codecs return a bunch of codecs among which libx264 and libx265. When I run the above code I get NULL from avcodec_find_encoder_by_name() :
gt@gt-Aspire-E1-570 : /libav$ ./encode_video pippo libx264
Codec ’libx264’ not found
gt@gt-Aspire-E1-570 : /libav$ ./encode_video pippo x264
Codec ’x264’ not found
gt@gt-Aspire-E1-570 : /libav$ ./encode_video pippo H264
Codec ’H264’ not found
gt@gt-Aspire-E1-570 : /libav$Can someone help please ?
Thanks