
Recherche avancée
Médias (1)
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
Autres articles (30)
-
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (6502)
-
FFmpeg HLS Live Stream Stuck with iOS 11
1er novembre 2017, par LamorunI’ve exp with FFmpeg but i recent problem with iOS 11 (Recent release for Apple)
I used FFmpeg for stream HLS Live Stream for only iPhone and iPad in closed app for online courses. My problem is the next :
I used this code for HLS Live Stream :
ffmpeg -i "Input" -preset fast -c:v libx264 -c:a aac -ac 1 -strict -2 -crf 18 -profile:v baseline -maxrate 1000k -bufsize 1835k -pix_fmt yuv420p -b:a 64k -flags -global_header -hls_time 20 -hls_list_size 6 -hls_wrap 10 -start_number 1 /m3u8/test.m3u8
This work perfect in iOS 8, 9 and 10 devices. But with new version iOS 11, video is stuck after about 30 to 40 seconds, as seen in the image :
I have searched for hours and hours. I have done many tests, but I can not get it out, since it works perfectly with iOS 8,9 and 10 (test in somes devices, even working perfectly on a device with iOS 10, update to iOS 11, and stop working immediately, downgrade to iOS 10 and work again)
I hope someone can help me out, thank you and greetings to all
-
Windows(WASAPI):Converting IEEE float PCM to PCM 16bit
10 octobre 2017, par Michael IVI do a hook into some of WASAPI methods to read out audio buffer that contains system sound.
The source is WAV with audio
format = WAVE_FORMAT_IEEE_FLOAT
andsubformat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
I am trying to convert it to PCM 16bit on the fly using FFMPEG libswresample. The resulting soundtrack has alot of forground noise with the original track’s data playing in the background.
Here is how I do it (I skip WASAPI init part) :
First,the source WAVEFORMATEX struct has the following properties :
Format tag:65534
Sample rate:44100
Num channels:2
CB size:22
Average bytes per sec:352800
Block align:8
Bits per sample:32Where 65534 stands for WAVE_FORMAT_IEEE_FLOAT.
WAVEFORMATEX *w;//filled with the props above
int samples = 0;
int bufferSize = 0;
int buffer_frames = 0;
int bWritten = 0;
char* bufferIn = NULL;
char* bufferOut = NULL;
BYTE* wavBuffer = NULL;
void InitSWRContext()
{
swrctx = swr_alloc_set_opts(NULL,
AV_CH_LAYOUT_STEREO, //stereo layout
AV_SAMPLE_FMT_S16, // sample out format
44100, // out sample rate
2, //number of channels
AV_SAMPLE_FMT_FLT, //sample in format
w->nSamplesPerSec ,//in sample rate
0,
NULL);
swr_init(swrctx);
//also tried like this:
/*
swrctx = swr_alloc();
av_opt_set_int(swrctx, "in_channel_layout", CA2SWR_chlayout(w->nChannels), 0);
av_opt_set_int(swrctx, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0);
av_opt_set_int(swrctx, "in_sample_rate", 44100, 0);
av_opt_set_int(swrctx, "out_sample_rate", 44100, 0);
av_opt_set_sample_fmt(swrctx, "in_sample_fmt", AV_SAMPLE_FMT_FLT, 0);
av_opt_set_sample_fmt(swrctx, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0);
*/
samples = (int)av_rescale_rnd(CA_MAX_SAMPLES, 44100, w->nSamplesPerSec,
AV_ROUND_UP);
bufferSize = av_samples_get_buffer_size(NULL,2, samples * 2,AV_SAMPLE_FMT_S16, 1/*no-alignment*/);
bufferOut = ( char *)malloc(bufferSize ))
}These two methods are invoked by the system and I hook them to access audio buffer :
DEXPORT HRESULT __stdcall
_GetBuffer(
IAudioRenderClient *thiz,
UINT32 NumFramesRequested,
BYTE **ppData)
{
HRESULT hr;
hr = orig_GetBuffer(thiz, NumFramesRequested, ppData);
bufferIn = (char*)*ppData;
buffer_frames = NumFramesRequested;
return S_OK;
}Then on buffer release I perform the conversion and readout.
DEXPORT HRESULT __stdcall
_ReleaseBuffer(IAudioRenderClient *thiz,
UINT32 NumFramesWritten, DWORD dwFlags)
{
const unsigned char *srcplanes[2];
unsigned char *dstplanes[2];
int samples;
srcplanes[0] = (unsigned char*)bufferIn;
srcplanes[1] = NULL;
dstplanes[0] = (unsigned char*)bufferOut;
dstplanes[1] = NULL;
samples = (int)av_rescale_rnd(NumFramesWritten, 44100, 44100, AV_ROUND_UP);
int samplesConverted = swr_convert(swrctx, dstplanes, samples , srcplanes, NumFramesWritten);
int framesize = (/*PCM16*/16 / 8) * pwfx->nChannels * NumFramesWritten;
if (!wavBuffer)
{
wavBuffer = (BYTE*)malloc(4096 * 1000); //write out a few seconds
}
//copy converted buffer into wavBuffer
memcpy(wavBuffer + bWritten, bufferOut, framesize);
bWritten += framesize;
if (bWritten > 4096 * 1000)
{
pwfx->wFormatTag = WAVE_FORMAT_PCM;
pwfx->wBitsPerSample = 16;
pwfx->nBlockAlign = (pwfx->nChannels * pwfx->wBitsPerSample) / 8;
pwfx->cbSize = 0;
SaveWaveData(wavBuffer, bWritten, pwfx, L"test.wav");
exit(0);
}
}SaveWaveData
borrowed from here.Resulting sound file(WAV)
Original file : a2002011001-e02.wav
I tried to play and analyze the output in VLC,Audacity, and FMOD Studio.
The strange thing is that VLC show (codec info) that it is PCM16, while FMOD studio interprets the data as PCM32. I also tried to store without conversion the original buffer which also produces a sound with noise,though not as significant as when converting to PCM16 -
Connect external cameras to iOS and decompress to a usable form
27 septembre 2017, par Ping ChenI want to create a 2 camera setup which can send 1 of the camera views out as an RTMP stream depending on the motion intensity detected. The chosen camera view can change if motion intensity on the views changes.
I imagine that I could use an iPhone/iPad as encoding/streaming hub as well as 1 of the cameras. And connect a WiFi camera to the iPad/iPhone to feed the 2nd camera view.
My goals for the iOS side are :
- Connect with a WiFi camera on the local network
- Decode the data and run motion intensity detection on the WiFi camera feed AND the iPhone/iPad’s own camera feed with Brad Larson’s GPUImage framework https://github.com/BradLarson/GPUImage
- Stream out the chosen camera view. depending on motion detected
Larson’s GPUImage framework works with an AVCaptureSession subclass. I’m only familiar with AVFoundation objects, but am a complete noob with it comes to VideoToolbox and some of the lower level iOS video stuff. Through googling, I kind of know that VTDecompressionSession is what I’d get from the WiFi camera. I have no clue how I can manipulate that to a usable form for my purposes.
I’ve dug through stackoverflow answers such as : https://stackoverflow.com/a/29525001/7097455
Very informative, but maybe I don’t even know to ask the correct questions