
Recherche avancée
Médias (1)
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
Autres articles (111)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
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 (...)
Sur d’autres sites (4007)
-
Piping stream to ffmpeg via forked process stdin
6 novembre 2019, par Yanick SalzmannI am piping data from my raspberry pi camera to ffmpeg to convert them into an mp4 stream. I do so not with libavformat/libavformat but I call
ffmpeg
directly like this :context->ffmpeg_process = utils::launch_subprocess(
"ffmpeg",
{"-f", "rawvideo", "-pix_fmt", "yuv420p", "-s", "1920x1080", "-r", "30", "-i", "-", "-c", "libx264", "-f", "mp4", "-movflags", "frag_keyframe+empty_moov", "-", "-loglevel", "trace"}
);This is my wrapper around fork and exec like this :
const auto child = fork();
if(child == 0) {
if (dup2(stdin_pipe[PIPE_READ], STDIN_FILENO) == -1) {
exit(errno);
}
// same for stdout and sterr
execvp(command.c_str(), proc_args);
exit(errno);
} else if(child > 0) {
// same for stdout and stderr
ret_process.stdin_pipe = stdin_pipe[PIPE_WRITE];
}Now I have a callback that is called by the raspberry pi camera :
void CameraHandler::handle_camera_frame(const std::vector &data, std::size_t size) {
FILE* f = fopen("output.yuv4", "ab");
fwrite(data.data(), 1, size, f);
fclose(f);
std::lock_guard l{_listener_lock};
for (const auto &listener : _data_listeners) {
std::size_t written = 0;
while (written < size) {
const auto num_written = write(listener->ffmpeg_process.stdin_pipe, data.data() + written, size - written);
written += num_written;
if(num_written < 0) {
log->error("Broken stdin pipe");
break;
}
}
}
}I deliberately append every frame to a file because I am running the exact same command as above (with
cat output.yuv4 | ffmpeg ... > output4.mp4
to cross check).Now I can see that I am reading some data from my camera and pushing it to the ffmpeg process. But already after the first read ffmpeg complains, that the input data is invalid :
[2019-11-06 20:08:04.010] [11872:11932] [carpi::data::CameraHandler] [info] Launched ffmpeg process. PID: 11933, error: 0
[2019-11-06 20:08:04.014] [11872:11932] [carpi::video::RawCameraStream] [info] Camera dimension: 1920/1080
ffmpeg version 4.1.4-1+rpt1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
configuration: --prefix=/usr --extra-version='1+rpt1~deb10u1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Successfully parsed a group of options.
Parsing a group of options: input url -.
Applying option pix_fmt (set pixel format) with argument yuv420p.
Applying option s (set frame size (WxH or abbreviation)) with argument 1920x1080.
Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 30.
Successfully parsed a group of options.
Opening an input file: -.
[NULL @ 0xcd02d0] Opening 'pipe:' for reading
[pipe @ 0xcd0b50] Setting default whitelist 'crypto'
[AVIOContext @ 0xcd8d50] Statistics: 1048576 bytes read, 0 seeks
pipe:: Invalid data found when processing inputI am now confused. This is literally the same as I am
fwrite
ing and then piping from the file. Is there something wrong with mywrite
? -
More problems with FFmpeg not recognizing the directory I'm sending it to
8 novembre 2019, par Requiem_7I am creating a program that takes an audio file, breaks it up into 30-second audio files, and sends those files to Google’s Speech Recognition API to transcribe the audio. I’m using FFmpeg to break up the original audio file and make the 30-second files. It was working for about 20 minutes and I didn’t change anything but now it’s giving me an error saying that no such file or directory exists.
Here is the error it gives me :
C:\Users\hmkur\Desktop\Python\Transcribing_Audio_GoogleAPI_Python>ffmpeg -i source/valve.flac -f segment -segment_time 30 -c copy parts/out%01d.flac
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190807
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'source/valve.flac':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.29.100
Duration: 00:11:42.54, start: 0.000000, bitrate: 129 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : ISO Media file produced by Google Inc.
[segment @ 000001f8e84bd100] Opening 'parts/out0.flac' for writing
[segment @ 000001f8e84bd100] Failed to open segment 'parts/out0.flac'
Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Last message repeated 1 timesBoth the folder "source" with "valve.flac" exists as well as the folder "parts" and the files "out0.flac", etc. I was originally trying in the wav file format, switched to flac and it worked for about 20 minutes then stopped working.
-
I have installed FFMPEG and can't find it inside a PHP script
14 novembre 2019, par AntopI have installed FFMPeg in CentOS. It works perfectly.
It’s inside /usr/bin directory. Also, I have PHP 7.2.24 that comes with Plesk 18.0.20.I want to use FFMPeg inside a PHP script, but that script can’t find the executable of FFMpeg. I have tried giving the exact route (/usr/bin/ffmpeg) but doesn’t work.
It’s a production server. The same script, in my development server (macOS) works perfectly.
I tried using :
var_dump(getenv('PATH'));
var_dump(exec('which ffmpeg'));
var_dump(ini_get('open_basedir'));
var_dump(is_file(exec('which ffmpeg')));
var_dump(is_executable(exec('which ffmpeg')));And it returns me :
string(49) "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
string(0) ""
string(44) "/var/www/vhosts/name-of-the-domain.com/:/tmp/"
bool(false)
bool(false)
NULL¿What could be happening ?
A very strange thing I’ve noticed is that I can’t access any command via php :
I tried using it with echovar_dump(exec('which echo'));
var_dump(is_file(exec('which echo')));
var_dump(is_executable(exec('which echo')));And it returns me :
string(0) ""
bool(false)
bool(false)
NULLAnd the permissions are right :
[root@vps bin]# ls -lha echo
-rwxr-xr-x 1 root root 33K ago 20 08:25 echo
[root@vps bin]# ls -lha ffmpeg
-rwxr-xr-x 1 root root 217K abr 4 2019 ffmpegBut if I make a
var_dump(exec('echo "HELLO"'))
it returns me
string(5) "HELLO"