
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (37)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
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 -
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 (...)
Sur d’autres sites (3262)
-
Write frame without decoding it ?
24 août 2016, par AramI’m trying to use dranger tutorials for writing a webcam h264 streamed video directly to a file without decoding and encoding it (ffmpeg 3.0/3.1 library). But I’m a bit lost on how do I need to populate the AVFormatContext pointer for the av_write_frame once I get the corresponding AVPacket.
Trying to clarify. What I want to do is this
1. Open webcam stream in h264
2. Read a frame
3. Save it to a file without decoding and encoding it.Copy pasting the code from the tutorial :
#include
#include <libavutil></libavutil>pixfmt.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <libavutil></libavutil>avconfig.h>
#include <libswscale></libswscale>swscale.h>
#include <libavformat></libavformat>avformat.h>
int main(int argc, char *argv[]) {
av_register_all();
avcodec_register_all();
avformat_network_init();
AVFormatContext *pFormatCtx = avformat_alloc_context();
// Camera comes from argv[1]
avformat_open_input(&pFormatCtx, argv[1], NULL, NULL);
avformat_find_stream_info(pFormatCtx, NULL);
av_dump_format(pFormatCtx, 0, argv[1], 0);
int video_stream_idx = -1;
for (int i = 0; i < pFormatCtx->nb_streams; i++) {
if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
video_stream_idx = i;
break;
}
}
AVCodecContext *pCodecContext = NULL;
AVCodecContext *pCodecContextOrig = NULL;
pCodecContextOrig = pFormatCtx->streams[video_stream_idx]->codec;
AVCodec *pCodec;
pCodec = avcodec_find_decoder(pCodecContextOrig->codec_id);
pCodecContext = avcodec_alloc_context3(pCodec);
avcodec_copy_context(pCodecContext, pCodecContextOrig);
avcodec_open2(pCodecContext, pCodec, NULL);
AVFrame *pFrame = av_frame_alloc();
AVFrame *pFrameRGB = av_frame_alloc();
uint8_t *buffer = NULL;
int buffer_size = avpicture_get_size(AV_PIX_FMT_RGB24, pCodecContext->width,
pCodecContext->height);
buffer = (uint8_t *)av_malloc(buffer_size * sizeof(uint8_t));
// fill buffer
avpicture_fill((AVPicture *)pFrameRGB, buffer, AV_PIX_FMT_RGB24,
pCodecContext->width, pCodecContext->height);
struct SwsContext *sws_ctx = NULL;
int frame_finished = 0;
AVPacket packet;
// Size(src), fmt(src), Size(dst), fmt(dst) .. flags
sws_ctx = sws_getContext(pCodecContext->width, pCodecContext->height,
pCodecContext->pix_fmt, pCodecContext->width,
pCodecContext->height, AV_PIX_FMT_RGB24,
SWS_BILINEAR, NULL, NULL, NULL);
AVFormatContext *out_fmt_ctx;
avformat_write_header(out_fmt_ctx, NULL);
int i = 0;
while (i < 100 && (av_read_frame(pFormatCtx, &packet) >= 0)) {
// Want to write these frames to disk
i++;
}
av_write_trailer(out_fmt_ctx);
av_free(buffer);
av_free(pFrameRGB);
av_free(pFrame);
avcodec_close(pCodecContext);
avcodec_close(pCodecContextOrig);
avformat_close_input(&pFormatCtx);
return 0;
}I think a lot of stuff of this code can be removed. I’m trying to learn :).
Linking against
-lavutil -lavformat -lavcodec -lz -lavutil -lm -lswscale
-
Backslash in Ruby String and Special FFmpeg Characters
26 novembre 2016, par valii2334I enter a string in my xcode project and I send it via api to my rails application where I need to put the string over a picture.
Let’s say that in xcode (iOS app) I type the string /\%" ’ . The string it’s set in rails ( a field of an object of type string ) like this /\%\" ’ . But the problem is that in convert % and ’ are special characters and I need to prefix them with \ to work (like ruby does with " and \).
The convert command it’s this :command = "convert image.jpg -gravity North -pointsize 40 -fill '#FFFFFF' -annotate +0+50 '#{@text}' image2.jpg"
@text should contain a string such image2.jpg will contain /\%" ’
This is just an example with this special characters. It should display any string entered in iOS no metter what language.
-
lavu : Add a video section to Doxygen documentation
10 novembre 2016, par Vittorio Giovaralavu : Add a video section to Doxygen documentation
Fill it with AVStereo3D and AVDisplayMatrix documentation.
Apply the necessary changes to make verbatim code look good in doxygen.Signed-off-by : Vittorio Giovara <vittorio.giovara@gmail.com>