
Recherche avancée
Autres articles (45)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (7375)
-
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