
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (78)
-
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. -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (6706)
-
ffmpeg and php - generating thumbnail
25 février 2014, par stinkysGTII've never used ffmpeg before, but it seemed rather straight forward. I already have a script that handles the uploaded file and stores all of the relative data into the database, but I'm not able to generate a thumbnail. I don't get an error either, I even checked the error_log on the server and there was nothing. The command I'm trying to use is :
shell_exec("/usr/bin/ffmpeg -i files/clipcanvas_14348_offline.mp4 -r 1 -s 1024x576 -f image2 -vframes 1 files/thumb_test.jpg");
I will change the static file names with variables once I get it working because the videos that will be thumbnailed are uploaded through a form.
I tried using the solution from this page :
ffmpeg Getting image or thumbnail from video error
But I'm not having any luck. Could it somehow be possible it's because it's on a sub domain ?
-
Cannot decode H.264 stream (Annex.B) using FFmpeg
15 décembre 2014, par user849642Recently I’m writing a client of a IP camera providing H.264 stream. I’m now using FFmpeg 2.1.1 to decode the stream provided by the camera.
Here’s some code of the application :
Initialization :
private unsafe void InitFFmpeg()
{
FFmpeg.avcodec_register_all();
var codec = FFmpeg.avcodec_find_decoder(AVCodecID.AV_CODEC_ID_H264);
avcodec = (IntPtr)codec;
var ctx=FFmpeg.avcodec_alloc_context3(avcodec);
avcontext = (IntPtr)ctx;
ctx->codec = avcodec;
ctx->pix_fmt = AVPixelFormat.PIX_FMT_YUV420P;
ctx->flags2 |= 0x00008000;//CODEC_FLAG2_CHUNKS
var options = IntPtr.Zero;
int result = FFmpeg.avcodec_open2(avcontext, avcodec, ref options);
avframe = FFmpeg.av_frame_alloc();
avparser = FFmpeg.av_parser_init(AVCodecID.AV_CODEC_ID_H264);
FFmpeg.av_init_packet(ref avpacket);
inBuffer = Marshal.AllocHGlobal(300 * 1024);
}Decoding :
private void Decode(byte[] data, int size)
{
IntPtr pOut = IntPtr.Zero;
int outLen = 0;
Marshal.Copy(data, 0, inBuffer, size);
int gotPicture = 0;
var rs = FFmpeg.av_parser_parse2(avparser, avcontext, ref pOut, ref outLen, inBuffer, size, 0, 0, 0);
if (outLen <= 0 || pOut.ToInt32() <= 0)
{
//no enough data to construct a frame, return and receive next NAL unit.
return;
}
avpacket.data = pOut;
avpacket.size = outLen;
avpacket.flags |= PacketFlags.Key;
var len = FFmpeg.avcodec_decode_video2(avcontext, avframe, ref gotPicture, ref avpacket);
Console.WriteLine("avcodec_decode_video2 returned " + len);
if (gotPicture != 0)
{
//some YUV to RGB stuff
}
}With the code above, I can get some output like :
NAL unit 1: resolution=1280x720, key-frame=True, size=26.
NAL unit 2: resolution=1280x720, key-frame=False, size=8.
NAL unit 3: resolution=1280x720, key-frame=False, size=97222.
NAL unit 4: resolution=1280x720, key-frame=False, size=14129.
avcodec_decode_video2 returned 1
NAL unit 5: resolution=1280x720, key-frame=False, size=12522.
NAL unit 6: resolution=1280x720, key-frame=False, size=12352.
avcodec_decode_video2 returned 1
NAL unit 7: resolution=1280x720, key-frame=False, size=12291.
NAL unit 8: resolution=1280x720, key-frame=False, size=12182.From the ouput I can see the parser can recognize the NAL units sent by the camera and can construct frames from them.
NAL unit 1 to 4 are slices of a key frame containing SPS/PPS, and the following 2 NAL units form a normal frame.
And the avcodec_decode_video2 function doesn’t produce any error, but just keep returning 1 and gotPicture is alway 0.
If I clear AVCodecContext.flags2, it starts to complain that the packet I provided contains no frame :
NAL unit 100: resolution=1280x720, frame-rate=0, key-frame=True, size=26.
NAL unit 101: resolution=1280x720, frame-rate=0, key-frame=False, size=8.
NAL unit 102: resolution=1280x720, frame-rate=0, key-frame=False, size=96927.
NAL unit 103: resolution=1280x720, frame-rate=0, key-frame=False, size=17149.
[h264 @ 01423440] no frame!
avcodec_decode_video2 returned -1094995529
NAL unit 104: resolution=1280x720, frame-rate=0, key-frame=False, size=12636.
NAL unit 105: resolution=1280x720, frame-rate=0, key-frame=False, size=12338.
[h264 @ 01423440] no frame!If I write the raw stream to a file, I can use FFmpeg to mux the stream to an mp4 container, and can play the mp4 file with any player.
The raw data I received is something like :
00 00 00 01 67 42 00 28 E9 00 A0 0B 75 C4 80 03 6E E8 00 CD FE 60 0D 88 10 94
00 00 00 01 68 CE 31 52
00 00 00 01 65 88 81 00 06 66 36 25 11 21 2C 04 3B 81 E1 80 00 85 4B 23 9F 71...
... -
lavf/mpegts : apply misc option description fixes
14 août 2015, par Stefano Sabatini