
Recherche avancée
Médias (91)
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
-
USGS Real-time Earthquakes
8 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
SWFUpload Process
6 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (99)
-
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 (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (12347)
-
FFmpeg giving a wierd "Permission denied" error (Digitalocean VPS Ubuntu 18.04)
10 mai 2021, par DJ DannyI've set up a VPS server on Digitalocean. Installed Ubuntu 18.04, LAMP, etc.
Finally, I installed ffmpeg. It is working fine from terminal but when I try to execute it through php it gives a weird "Permission denied" error :


Here is some information :

root@vl :/# whereis ffmpeg

ffmpeg : /usr/local/bin/ffmpeg

root@vl :/# whereis ffprobe

ffprobe : /usr/local/bin/ffprobe

root@vl :/# ffmpeg -version

ffmpeg version N-102461-g8649f5dca6 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1 18.04)
configuration : —prefix=/usr/local/ffmpeg_build —pkg-config-flags=—static —extra-cflags=-I/usr/local/ffmpeg_build/include —extra-ldflags=-L/usr/local/ffmpeg_build/lib —extra-libs='-lpthread -lm' —ld=g++ —bindir=/usr/local/bin —enable-gpl —enable-gnutls —enable-libaom —enable-libass —enable-libfdk-aac —enable-libfreetype —enable-libmp3lame —enable-libopus —enable-libsvtav1 —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libx265 —enable-nonfree
libavutil 57. 0.100 / 57. 0.100
libavcodec 59. 1.100 / 59. 1.100
libavformat 59. 0.101 / 59. 0.101
libavdevice 59. 0.100 / 59. 0.100
libavfilter 8. 0.101 / 8. 0.101
libswscale 6. 0.100 / 6. 0.100
libswresample 4. 0.100 / 4. 0.100
libpostproc 56. 0.100 / 56. 0.100


My php file :


echo shell_exec("ffmpeg -i mj.gif -profile:v baseline -pix_fmt yuv420p -vf scale=600 :-2 output.mp4 2>&1")

 ?>

The ERROR ! :

ffmpeg version N-102461-g8649f5dca6 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1 18.04) configuration : —prefix=/usr/local/ffmpeg_build —pkg-config-flags=—static —extra-cflags=-I/usr/local/ffmpeg_build/include —extra-ldflags=-L/usr/local/ffmpeg_build/lib —extra-libs='-lpthread -lm' —ld=g++ —bindir=/usr/local/bin —enable-gpl —enable-gnutls —enable-libaom —enable-libass —enable-libfdk-aac —enable-libfreetype —enable-libmp3lame —enable-libopus —enable-libsvtav1 —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libx265 —enable-nonfree libavutil 57. 0.100 / 57. 0.100 libavcodec 59. 1.100 / 59. 1.100 libavformat 59. 0.101 / 59. 0.101 libavdevice 59. 0.100 / 59. 0.100 libavfilter 8. 0.101 / 8. 0.101 libswscale 6. 0.100 / 6. 0.100 libswresample 4. 0.100 / 4. 0.100 libpostproc 56. 0.100 / 56. 0.100 Input #0, gif, from 'mj.gif' : Duration : 00:00:01.60, start : 0.000000, bitrate : 22863 kb/s Stream #0:0 : Video : gif, bgra, 1400x1050, 10 fps, 10 tbr, 100 tbn output.mp4 : Permission denied

From the past 24 hours I've tried installing ffmpeg in different ways (compiling & apt install), I've also tried changing the permission but still I'm stuck with this error.

Any help would be highly appreciated !

Thanks

-
NodeJS - efficiently and correctly convert from raw PCM to WAV at scale (without FFMPEG ?)
13 juillet 2024, par Royi BernthalI have a stream of raw PCM buffers I need to convert to playable WAV buffers.


@ffmpeg.wasm
can convert an individual buffer in the stream well, but it's limited to executing 1 command at a time, so it won't work in a real-life streaming scenario (streams x concurrent users). We can use it as a reference to a conversion that outputs a good playable wav.

import { FFmpeg, createFFmpeg, fetchFile } from '@ffmpeg.wasm/main';

async pcmToWavFFMPEG(buffer: Buffer) {
 // bitDepth - PCM signed 16-bit little-endian
 const options = { sampleRate: '24k', channels: '1', bitDepth: 's16le' };

 this.ffmpeg.FS('writeFile', 'input.pcm', await fetchFile(buffer));

 await this.ffmpeg.run(
 '-f',
 options.bitDepth,
 '-ar',
 options.sampleRate,
 '-ac',
 options.channels,
 '-i',
 'input.pcm',
 'output.wav',
 );

 const wavBuffer = this.ffmpeg.FS('readFile', 'output.wav');

 this.ffmpeg.FS('unlink', `input.pcm`);
 this.ffmpeg.FS('unlink', `output.wav`);

 return Buffer.from(wavBuffer);
 }



In order to get over the command execution limit, I've tried
fluent-ffmpeg
. I couldn't find a way to convert a single buffer, so I'm just passing the whole readable stream so that ffmpeg can convert all of its buffers to wav. The buffers I'm getting in on('data') aren't playable wav. The same is true for concatting the accumulated buffers in on('complete') - the result is not a playable wav.

import ffmpeg from 'fluent-ffmpeg';
import internal from 'stream';

async pcmToWavFluentFFMPEG(
 readable: internal.Readable,
 callback: (chunk: Buffer) => void,
 ) {
 const options = { sampleRate: 24000, channels: 1, bitDepth: 's16le' };

 ffmpeg(readable)
 .inputFormat(options.bitDepth)
 .audioFrequency(options.sampleRate)
 .audioChannels(options.channels)
 .outputFormat('wav')
 .pipe()
 .on('data', callback);
 }



I've also tried using
node-wav
to convert each buffer individually. It manages to convert everything to playable wavs that sound close to the desired result, however for some reason they're extremely loud and sound a bit weird.

import wav from 'node-wav';

pcmToWavBad(buffer: Buffer) {
 const pcmData = new Int16Array(
 buffer.buffer,
 buffer.byteOffset,
 buffer.byteLength / Int16Array.BYTES_PER_ELEMENT,
 );

 const channelData = [pcmData]; // assuming mono channel

 return wav.encode(channelData, { sampleRate: 24000, bitDepth: 16 });
 }



I've also tried wrapping the PCM as a WAV with
wavefile
without any actual conversion (which is redundant as PCM is contained as is in WAV), but it results in white noise :

import { WaveFile } from 'wavefile';

pcmToWav(buffer: Buffer) {
 const wav = new WaveFile();

 wav.fromScratch(1, 24000, '16', buffer); // 's16le' is invalid

 return Buffer.from(wav.toBuffer());
 }



-
FFmpeg avcodec_encode_video2 access violation
28 février 2016, par JustPingoI’ve been trying to encode a frame using FFmpeg with Visual C++. Here is how I do it.
I first have a planar RGB24 image buffer. I convert it to planar YUV using the following rule :Y = ((66 * R + 129 * G + 25 * B + 128) >> 8) + 16;
U = ((-38 * R - 74 * G + 112 * B + 128) >> 8) + 128;
V = ((112 * R - 94 * G - 18 * B + 128) >> 8) + 128;I implemented it like this :
void rgb8toYuv(uchar* rgb, uchar* yuv, uint pixelAmount) {
uchar r, g, b;
for (uint i = 0; i < pixelAmount; i++) {
r = rgb[3 * i];
g = rgb[3 * i + 1];
b = rgb[3 * i + 2];
yuv[3 * i] = ((66 * r + 129 * g + 25 * b + 128) >> 8) + 16;
yuv[3 * i + 1] = ((-38 * r - 74 * g + 112 * b + 128) >> 8) + 128;
yuv[3 * i + 2] = ((112 * r - 94 * g - 18 * b + 128) >> 8) + 128;
}
}I open everything like this (I’m using malloc because I’m used to it in C and it’s my first C++ program, I guess it shouldn’t cause any problem ?) :
AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_H264);
AVFormatContext* outContext;
avformat_alloc_output_context2(&outContext, NULL, "mp4", filepath);
AVStream* video = avformat_new_stream(outContext, codec);
video->codec->bit_rate = VIDEOBITRATE;
video->codec->width = VIDEOWIDTH;
video->codec->height = VIDEOHEIGHT;
video->time_base = fps;
video->codec->gop_size = 10;
video->codec->max_b_frames = 1;
video->codec->pix_fmt = AV_PIX_FMT_YUV420P;
video->codec->codec_id = AV_CODEC_ID_H264;
video->codec->codec_type = AVMEDIA_TYPE_VIDEO;
avio_open(&outContext->pb, filepath, AVIO_FLAG_READ_WRITE);
avformat_write_header(outContext, NULL);
AVFrame* frame = av_frame_alloc();
frame->width = VIDEOWIDTH;
frame->height = VIDEOHEIGHT;
frame->format = AV_PIX_FMT_YUV420P;Then, here is the function I use to encode a frame :
void encodeFrame(uint currentFrame, uchar* data) { // RGB data
uchar* yuvData = (uchar*) malloc(videoWidth * videoHeight * 3);
rgb8toYuv(data, yuvData, videoWidth * videoHeight);
av_image_fill_arrays(frame->data, frame->linesize, yuvData, AV_PIX_FMT_YUV420P, videoWidth, videoHeight, 3); // I'm not sure about that 3, I couldn't find any documentation about it
AVPacket* packet = (AVPacket*) malloc(sizeof(AVPacket));
memset(packet, 0, sizeof(AVPacket));
av_init_packet(packet);
packet->data = NULL;
packet->size = 0;
frame->pts = currentFrame; // I don't know if this is corrrect too
avcodec_encode_video2(video->codec, packet, frame, NULL);
av_interleaved_write_frame(outContext, packet);
av_packet_unref(packet);
free(yuvData);
free(packet);
}However, this causes an
Access violation writing location 0x00000000
onavcodec_encode_video2
. I checked the errors returned by every of FFmpeg’s functions, and it seems like they all work exceptav_image_fill_arrays
that returns a weird1382400
error, although according to the debugger’s RAM-viewing tool, everything gets filled correctly.It seems like
avcodec_encode_video2
tries to access a NULL object that shouldn’t be, however I can’t find what it could be, as I followed a lot of sources example, and I don’t know what I did wrong.Thanks in advance !
EDIT : After applying the fix suggested by Edgar Rokyan (which is setting the 4th argument to an int pointer), I now get an access violation on
0x00000024
, still withavformat_alloc_output_context2
. I believe the problem is similar, but I still can’t find anything.