
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 (73)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users.
Sur d’autres sites (8988)
-
FFmpeg encoding live audio to aac issue
12 juillet 2015, par Ruurd AdemaI’m trying to encode live raw audio coming from a Blackmagic Decklink input card to a mov file with AAC encoding.
The issue is that the audio sounds distorted and plays to fast.
I created the software based on a couple of examples/tutorials including the Dranger tutorial and examples on Github (and of course the examples in the FFmpeg codebase).
Honestly, at this moment I don’t exactly know what the cause of the problem is. I’m thinking about PTS/DTS values or a timebase mismatch (because of the too fast playout), I tried a lot of things, including working with an av_audio_fifo.
- When outputting to the mov file with the AV_CODEC_ID_PCM_S16LE codec, everything works well
- When outputting to the mov file with the AV_CODEC_ID_AAC codec, the problems occur
- When writing RAW audio VLC media info shows :
Type : Audio, Codec : PCM S16 LE (sowt), Language : English, Channels : Stereo, Sample rate : 48000 Hz, Bits per sample. - When writing with AAC codec VLC media info shows :
Type : Audio, Codec : MPEG AAC Audio (mp4a), Language : English, Channels : Stereo, Sample rate : 48000 Hz.
Any idea(s) of what’s causing the problems ?
Code
// Create output context
output_filename = "/root/movies/encoder_debug.mov";
output_format_name = "mov";
if (avformat_alloc_output_context2(&output_fmt_ctx, NULL, output_format_name, output_filename) < 0)
{
printf("[ERROR] Unable to allocate output format context for output: %s\n", output_filename);
}
// Create audio output stream
static AVStream *encoder_add_audio_stream(AVFormatContext *oc, enum AVCodecID codec_id)
{
AVCodecContext *c;
AVCodec *codec;
AVStream *st;
st = avformat_new_stream(oc, NULL);
if (!st)
{
printf("[ERROR] Could not allocate new audio stream!\n");
exit(-1);
}
c = st->codec;
c->codec_id = codec_id;
c->codec_type = AVMEDIA_TYPE_AUDIO;
c->sample_fmt = AV_SAMPLE_FMT_S16;
c->sample_rate = decklink_config()->audio_samplerate;
c->channels = decklink_config()->audio_channel_count;
c->channel_layout = av_get_default_channel_layout(decklink_config()->audio_channel_count);
c->time_base.den = decklink_config()->audio_samplerate;
c->time_base.num = 1;
if (codec_id == AV_CODEC_ID_AAC)
{
c->bit_rate = 96000;
//c->profile = FF_PROFILE_AAC_MAIN; //FIXME Generates error: "Unable to set the AOT 1: Invalid config"
// Allow the use of the experimental AAC encoder
c->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
}
// Some formats want stream headers to be seperate (global?)
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
{
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
}
codec = avcodec_find_encoder(c->codec_id);
if (!codec)
{
printf("[ERROR] Audio codec not found\n");
exit(-1);
}
if (avcodec_open2(c, codec, NULL) < 0)
{
printf("[ERROR] Could not open audio codec\n");
exit(-1);
}
return st;
}
// En then, at every incoming frame this function gets called:
void encoder_handle_incoming_frame(IDeckLinkVideoInputFrame *videoframe, IDeckLinkAudioInputPacket *audiopacket)
{
void *pixels = NULL;
int pitch = 0;
int got_packet = 0;
void *audiopacket_data = NULL;
long audiopacket_sample_count = 0;
long audiopacket_size = 0;
long audiopacket_channel_count = 2;
if (audiopacket)
{
AVPacket pkt = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
AVFrame *frame;
BMDTimeValue audio_pts;
int requested_size;
static int last_pts1, last_pts2 = 0;
audiopacket_sample_count = audiopacket->GetSampleFrameCount();
audiopacket_channel_count = decklink_config()->audio_channel_count;
audiopacket_size = audiopacket_sample_count * (decklink_config()->audio_sampletype/8) * audiopacket_channel_count;
audiopacket->GetBytes(&audiopacket_data);
av_init_packet(&pkt);
printf("\n=== Audiopacket: %d ===\n", audio_stream->codec->frame_number);
if (AUDIO_TYPE == AV_CODEC_ID_PCM_S16LE)
{
audiopacket->GetPacketTime(&audio_pts, audio_stream->time_base.den);
pkt.pts = audio_pts;
pkt.dts = pkt.pts;
pkt.flags |= AV_PKT_FLAG_KEY; // TODO: Make sure if this still applies
pkt.stream_index = audio_stream->index;
pkt.data = (uint8_t *)audiopacket_data;
pkt.size = audiopacket_size;
printf("[PACKET] size: %d\n", pkt.size);
printf("[PACKET] pts: %li\n", pkt.pts);
printf("[PACKET] pts delta: %li\n", pkt.pts - last_pts2);
printf("[PACKET] duration: %d\n", pkt.duration);
last_pts2 = pkt.pts;
av_interleaved_write_frame(output_fmt_ctx, &pkt);
}
else if (AUDIO_TYPE == AV_CODEC_ID_AAC)
{
frame = av_frame_alloc();
frame->format = audio_stream->codec->sample_fmt;
frame->channel_layout = audio_stream->codec->channel_layout;
frame->sample_rate = audio_stream->codec->sample_rate;
frame->nb_samples = audiopacket_sample_count;
requested_size = av_samples_get_buffer_size(NULL, audio_stream->codec->channels, audio_stream->codec->frame_size, audio_stream->codec->sample_fmt, 1);
audiopacket->GetPacketTime(&audio_pts, audio_stream->time_base.den);
printf("[DEBUG] Sample format: %d\n", frame->format);
printf("[DEBUG] Channel layout: %li\n", frame->channel_layout);
printf("[DEBUG] Sample rate: %d\n", frame->sample_rate);
printf("[DEBUG] NB Samples: %d\n", frame->nb_samples);
printf("[DEBUG] Datasize: %li\n", audiopacket_size);
printf("[DEBUG] Requested datasize: %d\n", requested_size);
printf("[DEBUG] Too less/much: %li\n", audiopacket_size - requested_size);
printf("[DEBUG] Framesize: %d\n", audio_stream->codec->frame_size);
printf("[DEBUG] Audio pts: %li\n", audio_pts);
printf("[DEBUG] Audio pts delta: %li\n", audio_pts - last_pts1);
last_pts1 = audio_pts;
frame->pts = audio_pts;
if (avcodec_fill_audio_frame(frame, audiopacket_channel_count, audio_stream->codec->sample_fmt, (const uint8_t *)audiopacket_data, audiopacket_size, 0) < 0)
{
printf("[ERROR] Filling audioframe failed!\n");
exit(-1);
}
got_packet = 0;
if (avcodec_encode_audio2(audio_stream->codec, &pkt, frame, &got_packet) != 0)
{
printf("[ERROR] Encoding audio failed\n");
}
if (got_packet)
{
pkt.stream_index = audio_stream->index;
pkt.flags |= AV_PKT_FLAG_KEY;
//printf("[PACKET] size: %d\n", pkt.size);
//printf("[PACKET] pts: %li\n", pkt.pts);
//printf("[PACKET] pts delta: %li\n", pkt.pts - last_pts2);
//printf("[PACKET] duration: %d\n", pkt.duration);
//printf("[PACKET] timebase codec: %d/%d\n", audio_stream->codec->time_base.num, audio_stream->codec->time_base.den);
//printf("[PACKET] timebase stream: %d/%d\n", audio_stream->time_base.num, audio_stream->time_base.den);
last_pts2 = pkt.pts;
av_interleaved_write_frame(output_fmt_ctx, &pkt);
}
av_frame_free(&frame);
}
av_free_packet(&pkt);
}
else
{
printf("[WARNING] No audiopacket received!\n");
}
static int count = 0;
count++;
} -
ffmpeg compilation issue on Windows phone 8.1
24 février 2017, par Mirko PuliafitoTaking a look at Build ffmpeg for windows phone 8
I was able to compile ffmpeg on Windows phone 8using these steps :My configuration
OS : Windows 8.1 VS : Ultimate 2013 Update 3 (If armasm fails, msvcdis110.dll missing download it from dllsearch ) Mingw (be sure that "link" and "cl" commands point to MS "link" and "cl") FFmpeg 2.1.5
Follow prerequisites listed here : https://ffmpeg.org/platform.html#Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows
-) Download c99toc89 : https://github.com/libav/c99-to-c89/downloads/. Be sure all files from c99toc89 are in Mingw PATH (copy in /bin)
-) FFMPEG requires stdint.h and inttypes.h headers standardized as a part of C99. Unfortunately, Visual Studio does not include these files. Fortunately, there is a project that fixes this issue. Download the latest version and unpack it to Visual Studio includes (C :\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include).
-) Launch cmd and "c :\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat x86_arm" and then msys
-) configure :
./configure --toolchain=msvc \
--disable-programs \
--disable-network \
--disable-protocols \
--extra-cflags="-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -D_M_ARM -D_WINAPI_FAMILY=WINAPIFAMILY_APP" \
--enable-cross-compile \
--target-os=win32 \
--arch=arm \
--as=armasm \
--cpu=armv7 \
--disable-yasm \
--extra-ldflags="-MACHINE:ARM" \
--disable-dxva2 \
--disable-asm \
--disable-docI was able to get .a static libs but I wasn’t able to generate an app using it. I have problems while linking for kernel32.lib and libcmt.lib misses.
Anyone ?
-
ffmpeg include issue - some functions are missing
9 septembre 2014, par ThomasI try to follow and adapt this example to convert a video thanks to FFMPEG but some function seems to be missing like :
int avcodec_open ( AVCodecContext * avctx, AVCodec * codec)
When I go in the doc to see where it come from, I find it in the file
libavcodec/avcodec.h
which is included in my program#include "libavcodec/avcodec.h"
(in the top of my.h
file).Given this, I don’t understand why Qt throw me this error :
../../Dev/Joker/libs/PhVideo/PhVideoEncoder.cpp:360:6: error: use of undeclared identifier 'avcodec_open'
if (avcodec_open(c, codec) < 0) {