
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (63)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)
Sur d’autres sites (9815)
-
Gstreamer AAC encoding no more supported ?
22 juillet 2016, par Gianksi’d like to include AAC as one of the compatible formats in my app but i’m having troubles with its encoding.
FAAC seems to be missing in GStreamer-1.0 Debian-derived packages (see Ubuntu) and the main reason for that (if i got it correctly) is the presence of avenc_aac (Lunchpad bugreport) as a replacement.I’ve tried the following :
gst-launch-1.0 filesrc location="src.avi" ! tee name=t t.! queue ! decodebin ! progressreport ! x264enc ! mux. t.! queue ! decodebin ! audioconvert ! audioresample ! avenc_aac compliance=-2 ! mux. avmux_mpegts name=mux ! filesink location=/tmp/test.avi
It hangs prerolling with :
ERROR libav :0:: AAC bitstream not in ADTS format and extradata missing
Using mpegtsmux instead of avmux_mpegts seems to work since the file is created but it results with no working audio (with some players it’s completely unplayable).
This is the trace of mplayer :
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
[aac @ 0x7f2860d6c3c0]channel element 3.15 is not allocated
[aac @ 0x7f2860d6c3c0]Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7f2860d6c3c0]Inconsistent channel configuration.
[aac @ 0x7f2860d6c3c0]get_buffer() failed
[aac @ 0x7f2860d6c3c0]Assuming an incorrectly encoded 7.1 channel layout instead of a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the specification instead.
[aac @ 0x7f2860d6c3c0]Reserved bit set.
[aac @ 0x7f2860d6c3c0]Number of bands (20) exceeds limit (14).
[aac @ 0x7f2860d6c3c0]invalid band type
[aac @ 0x7f2860d6c3c0]More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7f2860d6c3c0]Reserved bit set.
[aac @ 0x7f2860d6c3c0]Number of bands (45) exceeds limit (28).
Unknown/missing audio format -> no sound
ADecoder init failed :(
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, floatle, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [pulse] 44100Hz 2ch floatle (4 bytes per sample)
Starting playback...
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Channel coupling not yet implemented, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: Failed to decode frame: Bitstream value not allowed by specification
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [vdpau] 640x480 => 640x480 Planar YV12
A:3602.2 V:3600.0 A-V: 2.143 ct: 0.000 3/ 3 ??% ??% ??,?% 0 0
FAAD: error: Array index out of range, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Unexpected fill element with SBR data, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Channel coupling not yet implemented, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: PCE shall be the first element in a frame, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: Failed to decode frame: Invalid number of channels
A:3602.2 V:3600.1 A-V: 2.063 ct: 0.000 4/ 4 ??% ??% ??,?% 0 0These the messages produced by VLC (10 seconds of playback) :
ts info: MPEG-4 descriptor not found for pid 0x42 type 0xf
core error: option sub-original-fps does not exist
subtitle warning: failed to recognize subtitle type
core error: no suitable demux module for `file/subtitle:///tmp//test.avi.idx'
avcodec info: Using NVIDIA VDPAU Driver Shared Library 361.42 Tue Mar 22 17:29:16 PDT 2016 for hardware decoding.
core warning: VoutDisplayEvent 'pictures invalid'
core warning: VoutDisplayEvent 'pictures invalid'
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio warning: ADTS CRC not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: ADTS CRC not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supportedUsing the error of the hanging pipeline I’ve finally discovered that avenc_aac should be told in such way to output the data NOT in RAW AAC but in ADTS AAC, the point is that i’ve no idea how to do that with Gstreamer. See here, bottom of the page : FFMPEG Ticket
At this point since i’ve found no documentation seems right to say we have no support for AAC encoding in GStreamer... which isn’t true, i guess ! (IMHO anyway seems strange the missing of FAAC if AVENC_AAC requires all the time to be set in experimental mode)
Can someone propose a working pipeline for this ?
UPDATE
After some more research i’ve found (via gst-inspect on avenc_aac) what i’m probably looking for but i don’t know how to setup it as needed.
Have a look at stream-format :Pad Templates:
SRC template: 'src'
Availability: Always
Capabilities:
audio/mpeg
channels: [ 1, 6 ]
rate: [ 4000, 96000 ]
mpegversion: 4
stream-format: raw
base-profile: lcThanks
-
Screen Capture with FFMPEG and Google Native Client
18 juillet 2016, par Mohammad Abu MusaI am building a screen recorder that is based on Native Client for Google, I have ffmpeg installed and ready but I do not have experience programming in ffmpeg. so I am looking for tips to understand how to build this recorder.
My goal is to make a screen recorder and export videos as webm files, I have all the required libraries I just could not find any code examples to hack on
This is what I achieved so far
#define __STDC_LIMIT_MACROS
#include
#include <iostream>
#include
#include
#include <sstream>
#include
#include <vector>
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/var_dictionary.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_console.h"
#include "ppapi/cpp/input_event.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/rect.h"
#include "ppapi/cpp/var.h"
#include "ppapi/cpp/var_array_buffer.h"
// Begin File IO headers
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/ppb_file_io.h"
#include "ppapi/cpp/directory_entry.h"
#include "ppapi/cpp/file_io.h"
#include "ppapi/cpp/file_ref.h"
#include "ppapi/cpp/file_system.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/message_loop.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/var.h"
#include "ppapi/cpp/var_array.h"
#include "ppapi/utility/completion_callback_factory.h"
#include "ppapi/utility/threading/simple_thread.h"
#ifndef INT32_MAX
#define INT32_MAX (0x7FFFFFFF)
#endif
#ifdef WIN32
#undef min
#undef max
#undef PostMessage
// Allow 'this' in initializer list
#pragma warning(disable : 4355)
#endif
namespace {
typedef std::vector StringVector;
}
//End File IO headers
extern "C" {
#include <libavcodec></libavcodec>avcodec.h>
#include <libswscale></libswscale>swscale.h>
#include <libavformat></libavformat>avformat.h>
#include <libavutil></libavutil>imgutils.h>
}
const char* file_name = "/file.txt";
const char* video_name = "/video.mpeg";
const char* file_text = "Echo from NaCl: ";
/**
* Pixel formats and codecs
*/
static const AVPixelFormat sourcePixelFormat = AV_PIX_FMT_BGR24;
static const AVPixelFormat destPixelFormat = AV_PIX_FMT_YUV420P;
static const AVCodecID destCodec = AV_CODEC_ID_MPEG2VIDEO;
class RecorderInstance: public pp::Instance {
public:
explicit RecorderInstance(PP_Instance instance) :
pp::Instance(instance), callback_factory_(this), file_system_(this,
PP_FILESYSTEMTYPE_LOCALPERSISTENT), file_system_ready_(
false), file_thread_(this) {
}
virtual ~RecorderInstance() {
file_thread_.Join();
}
virtual bool Init(uint32_t /*argc*/, const char * /*argn*/[],
const char * /*argv*/[]) {
file_thread_.Start();
file_thread_.message_loop().PostWork(
callback_factory_.NewCallback(
&RecorderInstance::OpenFileSystem));
avcodec_register_all(); // mandatory to register ffmpeg functions
return true;
}
private:
pp::CompletionCallbackFactory<recorderinstance> callback_factory_;
pp::FileSystem file_system_;
// Indicates whether file_system_ was opened successfully. We only read/write
// this on the file_thread_.
bool file_system_ready_;
pp::SimpleThread file_thread_;
virtual void HandleMessage(const pp::Var& var_message) {
if (!var_message.is_dictionary()) {
LogToConsole(PP_LOGLEVEL_ERROR, pp::Var("Invalid message!"));
return;
}
pp::VarDictionary dict_message(var_message);
std::string command = dict_message.Get("message").AsString();
if (command == "sendFrame") {
pp::VarArrayBuffer data(dict_message.Get("data"));
uint width = 600;
uint height = 800;
uint8_t endcode[] = { 0, 0, 1, 0xb7 };
/**
* Create an encoder and open it
*/
avcodec_register_all();
AVCodec *h264encoder = avcodec_find_encoder(destCodec);
AVCodecContext *h264encoderContext = avcodec_alloc_context3(
h264encoder);
h264encoderContext->pix_fmt = destPixelFormat;
h264encoderContext->width = width;
h264encoderContext->height = height;
if (avcodec_open2(h264encoderContext, h264encoder, NULL) < 0) {
ShowErrorMessage("Cannot open codec" ,-1);
return;
}
/**
* Create a stream
*/
AVFormatContext *cv2avFormatContext = avformat_alloc_context();
AVStream *h264outputstream = avformat_new_stream(cv2avFormatContext,
h264encoder);
AVFrame *sourceAvFrame = av_frame_alloc(), *destAvFrame =
av_frame_alloc();
int got_frame;
FILE* videoOutFile = fopen("video", "wb");
/**
* Prepare the conversion context
*/
SwsContext *bgr2yuvcontext = sws_getContext(width, height,
sourcePixelFormat, width, height, destPixelFormat,
SWS_BICUBIC, NULL, NULL, NULL);
int framesToEncode = 100;
/**
* Convert and encode frames
*/
for (uint i = 0; i < framesToEncode; i++) {
/**
* Allocate source frame, i.e. input to sws_scale()
*/
av_image_alloc(sourceAvFrame->data, sourceAvFrame->linesize,
width, height, sourcePixelFormat, 1);
/**
* Copy image data into AVFrame from cv::Mat
*/
for (uint32_t h = 0; h < height; h++)
memcpy(
&(sourceAvFrame->data[0][h
* sourceAvFrame->linesize[0]]),
&(data), width * 3);
/**
* Allocate destination frame, i.e. output from sws_scale()
*/
av_image_alloc(destAvFrame->data, destAvFrame->linesize, width,
height, destPixelFormat, 1);
sws_scale(bgr2yuvcontext, sourceAvFrame->data,
sourceAvFrame->linesize, 0, height, destAvFrame->data,
destAvFrame->linesize);
sws_freeContext(bgr2yuvcontext);
/**
* Prepare an AVPacket and set buffer to NULL so that it'll be allocated by FFmpeg
*/
AVPacket avEncodedPacket;
av_init_packet(&avEncodedPacket);
avEncodedPacket.data = NULL;
avEncodedPacket.size = 0;
destAvFrame->pts = i;
avcodec_encode_video2(h264encoderContext, &avEncodedPacket,
destAvFrame, &got_frame);
if (got_frame) {
ShowErrorMessage(
"Encoded a frame of size \n",-1); //+ (string)avEncodedPacket.size + "\n");
if (fwrite(avEncodedPacket.data, 1, avEncodedPacket.size,
videoOutFile) < (unsigned) avEncodedPacket.size)
ShowErrorMessage(
"Could not write all \n",-1);
//+ avEncodedPacket.size
//+ " bytes, but will continue..\n"
fflush(videoOutFile);
}
/**
* Per-frame cleanup
*/
av_packet_free_side_data(&avEncodedPacket);
av_free_packet(&avEncodedPacket);
av_freep(sourceAvFrame->data);
av_frame_free(&sourceAvFrame);
av_freep(destAvFrame->data);
av_frame_free(&destAvFrame);
}
fwrite(endcode, 1, sizeof(endcode), videoOutFile);
fclose(videoOutFile);
/**
* Final cleanup
*/
avformat_free_context(cv2avFormatContext);
avcodec_close(h264encoderContext);
avcodec_free_context(&h264encoderContext);
} else if (command == "createFile") {
file_thread_.message_loop().PostWork(
callback_factory_.NewCallback(&RecorderInstance::Save,
file_name, file_text));
}
}
void OpenFileSystem(int32_t /* result */) {
int32_t rv = file_system_.Open(1024 * 1024, pp::BlockUntilComplete());
if (rv == PP_OK) {
file_system_ready_ = true;
// Notify the user interface that we're ready
ShowStatusMessage("STORAGE READY");
} else {
ShowErrorMessage("Failed to open file system", rv);
}
}
void Save(int32_t /* result */, const std::string& file_name,
const std::string& file_contents) {
if (!file_system_ready_) {
ShowErrorMessage("File system is not open", PP_ERROR_FAILED);
return;
}
pp::FileRef ref(file_system_, file_name.c_str());
pp::FileIO file(this);
int32_t open_result = file.Open(ref,
PP_FILEOPENFLAG_WRITE | PP_FILEOPENFLAG_CREATE
| PP_FILEOPENFLAG_TRUNCATE, pp::BlockUntilComplete());
if (open_result != PP_OK) {
ShowErrorMessage("File open for write failed", open_result);
return;
}
// We have truncated the file to 0 bytes. So we need only write if
// file_contents is non-empty.
if (!file_contents.empty()) {
if (file_contents.length() > INT32_MAX) {
ShowErrorMessage("File too big", PP_ERROR_FILETOOBIG);
return;
}
int64_t offset = 0;
int32_t bytes_written = 0;
do {
bytes_written = file.Write(offset,
file_contents.data() + offset, file_contents.length(),
pp::BlockUntilComplete());
if (bytes_written > 0) {
offset += bytes_written;
} else {
ShowErrorMessage("File write failed", bytes_written);
return;
}
} while (bytes_written
< static_cast(file_contents.length()));
}
// All bytes have been written, flush the write buffer to complete
int32_t flush_result = file.Flush(pp::BlockUntilComplete());
if (flush_result != PP_OK) {
ShowErrorMessage("File fail to flush", flush_result);
return;
}
ShowStatusMessage("Save success");
}
/// Encapsulates our simple javascript communication protocol
void ShowErrorMessage(const std::string& message, int32_t result) {
std::stringstream ss;
ss << "ERROR: " << message << " -- Error #: " << result << "\n";
PostMessage(ss.str());
}
void ShowStatusMessage(const std::string& message) {
std::stringstream ss;
ss << "LOG: " << message << "\n";
PostMessage(ss.str());
}
};
class RecorderModule: public pp::Module {
public:
RecorderModule() :
pp::Module() {
}
virtual ~RecorderModule() {
}
virtual pp::Instance* CreateInstance(PP_Instance instance) {
return new RecorderInstance(instance);
}
};
namespace pp {
/**
* This function is an entry point to a NaCl application.
* It must be implemented.
*/
Module* CreateModule() {
return new RecorderModule();
}
} // namespace pp
</recorderinstance></vector></sstream></iostream> -
Merge pull request #3454 from Coggle/master
31 juillet 2016, par blueimpMerge pull request #3454 from Coggle/master
use AMD module naming as suggested by jquery site