
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 (96)
-
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 (...) -
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 (...) -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (7106)
-
EventHandler while changing frame using ffmpeg.exe
7 juin 2015, par Abdur RahimReading a video file using
ffmpeg.exe
inC#.
Is there any good wrapper which can fire an event while changing a frame and
keep a pointer of the frame ?Or how can I generate own eventHandler on that specific event i.e. changing of frames.
-
WASAPI resampling
30 juin 2013, par magingaxI am trying to play 24bit/48000 Hz audio on PC. my PC seems not support 32bit sample (event GetMixFormat return 32bit/44100Hz device)
So I'm trying to convert 24bit/4800Hz audio into 16bit/44100Hz
but It sound like noise.
sample audio file 'titan.wav' is 24bit/48000Hz s32 format
below is sample code#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
#include
#include <iostream>
#include "Mmdeviceapi.h"
#include "Audioclient.h"
#include "Endpointvolume.h"
using namespace std;
extern "C"
{
#include <libavformat></libavformat>avformat.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <libswscale></libswscale>swscale.h>
#include <libavutil></libavutil>opt.h>
#include <libavutil></libavutil>channel_layout.h>
#include <libavutil></libavutil>samplefmt.h>
#include <libswresample></libswresample>swresample.h>
}
#define MAX_AUDIO_FRAME_SIZE 192000
#define REFTIMES_PER_SEC 10000000 // 1 sec 100ns
#define REFTIMES_PERMILLISEC 10000
const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
const IID IID_IAudioClient = __uuidof(IAudioClient);
const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient);
int alloc_samples_array_and_data(uint8_t*** data, int *linesize, int nb_channels,int nb_samples, enum AVSampleFormat sample_fmt, int align)
{
int nb_planes = av_sample_fmt_is_planar(sample_fmt) ? nb_channels : 1;
*data = (uint8_t**)av_malloc(sizeof(*data) * nb_planes);
return av_samples_alloc(*data, linesize, nb_channels,nb_samples, sample_fmt, align);
}
int main()
{
HRESULT hr;
REFERENCE_TIME buf_duration_request = REFTIMES_PER_SEC;
REFERENCE_TIME buf_duration_actual;
IMMDeviceEnumerator *pEnumerator = NULL;
IMMDevice *pDevice = NULL;
IAudioClient *pAudioClient = NULL;
IAudioRenderClient *pRenderClient = NULL;
IAudioEndpointVolume *endpoint_vol = NULL;
WAVEFORMATEX *fmt = NULL;
UINT32 frame_total = 0; // total frames in buffer
UINT32 frame_avail = 0; // available frame number in buffer
UINT32 frame_fill = 0; // filled frames
BYTE *pData = NULL;
FILE *file_audio = NULL;
BYTE *buf = NULL;
DWORD flags = 0;
CoInitializeEx(NULL,COINIT_MULTITHREADED);
CoCreateInstance (CLSID_MMDeviceEnumerator,NULL,CLSCTX_ALL,IID_IMMDeviceEnumerator, (void**)&pEnumerator);
pEnumerator->GetDefaultAudioEndpoint(eRender, eConsole, &pDevice);
pDevice->Activate(IID_IAudioClient, CLSCTX_ALL, NULL, (void**)&pAudioClient);
pDevice->Activate(__uuidof(IAudioEndpointVolume),CLSCTX_ALL,NULL,(void**)&endpoint_vol);
pAudioClient->GetMixFormat((WAVEFORMATEX**)&fmt);
fmt->wFormatTag = WAVE_FORMAT_PCM;
fmt->nChannels = 2 ;
fmt->nSamplesPerSec = 44100;
fmt->wBitsPerSample = 16;
fmt->nBlockAlign = fmt->nChannels * (fmt->wBitsPerSample/8);
fmt->nAvgBytesPerSec = fmt->nSamplesPerSec * fmt->nBlockAlign;
fmt->cbSize = 0;
WAVEFORMATEX* closest_format = NULL;
hr = pAudioClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, fmt ,&closest_format);
hr = pAudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED, NULL ,buf_duration_request,0, fmt ,NULL);
hr = pAudioClient->GetBufferSize(&frame_total);
hr = pAudioClient->GetService(IID_IAudioRenderClient,(void**)&pRenderClient);
int file_size = 0;
int buf_size = 44100 * 4;
int read_ret = 0;
int read_acc = 0;
fopen_s(&file_audio,"E:\\MOVIE\\titan.wav","rb");
fseek (file_audio , 0 , SEEK_END);
file_size = ftell (file_audio);
rewind (file_audio);
buf = (BYTE*) malloc(buf_size);
pRenderClient->GetBuffer(frame_total,&pData);
read_ret = fread(buf,1,buf_size,file_audio);
read_acc += read_ret;
memcpy(pData,buf,buf_size);
pRenderClient->ReleaseBuffer(frame_total,flags);
buf_duration_actual = (double) REFTIMES_PER_SEC * frame_total / fmt->nSamplesPerSec;
pAudioClient->Start();
//-- resample
uint8_t** src_data;
uint8_t** dst_data;
int src_bufsize = 0;
int dst_bufsize = 0;
int src_linesize = 0;
int dst_linesize = 0;
int src_nb_channels = 0;
int dst_nb_channels = 0;
int src_nb_samples = 1024;
int dst_nb_samples = 0;
int max_dst_nb_samples = 0;
int ret = 0;
SwrContext* swr_ctx = NULL;
swr_ctx = swr_alloc();
av_opt_set_int (swr_ctx,"in_channel_layout" , AV_CH_LAYOUT_MONO, 0);
av_opt_set_int (swr_ctx,"in_sample_rate" , 48000,0);
av_opt_set_sample_fmt (swr_ctx,"in_sample_fmt" , AV_SAMPLE_FMT_S32, 0);
av_opt_set_int (swr_ctx,"out_channel_layout", AV_CH_LAYOUT_STEREO, 0);
av_opt_set_int (swr_ctx,"out_sample_rate" , 44100,0);
av_opt_set_sample_fmt (swr_ctx,"out_sample_fmt" , AV_SAMPLE_FMT_S16, 0);
ret = swr_init(swr_ctx);
src_nb_channels = av_get_channel_layout_nb_channels(AV_CH_LAYOUT_MONO);
src_nb_samples = src_nb_channels * 48000;
dst_nb_samples = av_rescale_rnd(src_nb_samples, 44100,48000,AV_ROUND_UP);
max_dst_nb_samples = dst_nb_samples;
alloc_samples_array_and_data(&src_data,&src_linesize,src_nb_channels,src_nb_samples, AV_SAMPLE_FMT_S32,0);
dst_nb_channels = av_get_channel_layout_nb_channels(AV_CH_LAYOUT_STEREO);
alloc_samples_array_and_data(&dst_data,&dst_linesize,dst_nb_channels,dst_nb_samples, AV_SAMPLE_FMT_S16,0);
//-- end resample
while (read_acc < file_size)
{
Sleep(buf_duration_actual/REFTIMES_PERMILLISEC/2);
pAudioClient->GetCurrentPadding(&frame_fill);
frame_avail = frame_total - frame_fill;
dst_nb_samples = frame_avail;
src_nb_samples = av_rescale_rnd(dst_nb_samples,48000,44100,AV_ROUND_UP);
src_bufsize = av_samples_get_buffer_size(&src_linesize,src_nb_channels,src_nb_samples,AV_SAMPLE_FMT_S32,1);
cout<<"FILLED:"<GetBuffer(frame_avail, &pData );
read_ret = fread(src_data[0],1,src_bufsize,file_audio);
read_acc += read_ret;
ret = swr_convert(swr_ctx,dst_data,dst_nb_samples,(const uint8_t**)src_data,src_nb_samples);
dst_bufsize = av_samples_get_buffer_size(&dst_linesize,dst_nb_channels,ret,AV_SAMPLE_FMT_S16,1);
memcpy(pData, dst_data[0], dst_bufsize);
hr = pRenderClient->ReleaseBuffer(frame_avail,flags);
}
pAudioClient->Stop();
CoTaskMemFree(fmt);
pEnumerator->Release();
pDevice->Release();
pAudioClient->Release();
pRenderClient->Release();
CoUninitialize();
return 0;
}
</iostream> -
Replaced the inline onclick handler for cboxPhoto with a namespaced e…
14 mai 2015, par jackmooreReplaced the inline onclick handler for cboxPhoto with a namespaced event for easier unbinding. Fixes #719.