
Recherche avancée
Autres articles (81)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
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 (...) -
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 (...)
Sur d’autres sites (5555)
-
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
? -
ffmpeg with frei0r libraries fails on os x 10.14.6
13 novembre 2019, par Bernhard WagnerI’m on Mac OS X 10.14.6 (Mojave), used homebrew to install both ffmpeg and frei0r.
If you check the output below, the option--enable-frei0r
is there.I verified the path to the frei0r libaries and call ffmpeg like this :
FREI0R_PATH=/usr/local/Cellar/frei0r/1.6.1/lib/frei0r-1/ ffmpeg -v debug -i running.mkv -filter:v frei0r=pixeliz0r=0.02:0.02 pixel.mkv
however it fails the exact same way as if I hadn’t passed the env var FREI0R_PATH :
FREI0R_PATH=/usr/local/Cellar/frei0r/1.6.1/lib/frei0r-1/ ffmpeg -y -v debug -i running.mkv -filter:v frei0r=pixeliz0r=0.02:0.02 pixel.mkv
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'running.mkv'.
Reading option '-filter:v' ... matched as option 'filter' (set stream filtergraph) with argument 'frei0r=pixeliz0r=0.02:0.02'.
Reading option 'pixel.mkv' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url running.mkv.
Successfully parsed a group of options.
Opening an input file: running.mkv.
[NULL @ 0x7f894e002000] Opening 'running.mkv' for reading
[file @ 0x7f894ce20f40] Setting default whitelist 'file,crypto'
[matroska,webm @ 0x7f894e002000] Format matroska,webm probed with size=2048 and score=100
st:0 removing common factor 1000000 from timebase
st:1 removing common factor 1000000 from timebase
[matroska,webm @ 0x7f894e002000] Before avformat_find_stream_info() pos: 1021 bytes read:32768 seeks:0 nb_streams:2
[h264 @ 0x7f894e003400] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7f894e003400] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7f894e003400] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7f894e003400] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7f894e003400] nal_unit_type: 5(IDR), nal_ref_idc: 1
[h264 @ 0x7f894e003400] Format yuv420p chosen by get_format().
[h264 @ 0x7f894e003400] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0x7f894e003400] no picture
[matroska,webm @ 0x7f894e002000] All info found
[matroska,webm @ 0x7f894e002000] After avformat_find_stream_info() pos: 26157 bytes read:32768 seeks:0 frames:5
Input #0, matroska,webm, from 'running.mkv':
Metadata:
MINOR_VERSION : 0
COMPATIBLE_BRANDS: iso6avc1mp41
MAJOR_BRAND : dash
ENCODER : Lavf58.29.100
Duration: 00:00:46.22, start: -0.013000, bitrate: 2189 kb/s
Stream #0:0, 3, 1/1000: Video: h264 (Main), 1 reference frame, yuv420p(tv, bt709, progressive, left), 1280x720 [SAR 1:1 DAR 16:9], 0/1, 60 fps, 60 tbr, 1k tbn, 120 tbc (default)
Metadata:
HANDLER_NAME : ISO Media file produced by Google Inc.
DURATION : 00:00:46.216000000
Stream #0:1(eng), 2, 1/1000: Audio: opus, 48000 Hz, stereo, fltp, delay 312 (default)
Metadata:
DURATION : 00:00:46.194000000
Successfully opened the file.
Parsing a group of options: output url pixel.mkv.
Applying option filter:v (set stream filtergraph) with argument frei0r=pixeliz0r=0.02:0.02.
Successfully parsed a group of options.
Opening an output file: pixel.mkv.
[file @ 0x7f894ce22840] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 4 logical cores
[h264 @ 0x7f894d006a00] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7f894d006a00] nal_unit_type: 8(PPS), nal_ref_idc: 3
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (opus (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
Last message repeated 1 times
[opus @ 0x7f894d020000] skip 312/960 samples
[h264 @ 0x7f894d006a00] nal_unit_type: 5(IDR), nal_ref_idc: 1
[h264 @ 0x7f894d006a00] Format yuv420p chosen by get_format().
[h264 @ 0x7f894d006a00] Reinit context to 1280x720, pix_fmt: yuv420p
[graph_1_in_0_1 @ 0x7f894ce3f740] Setting 'time_base' to value '1/48000'
[graph_1_in_0_1 @ 0x7f894ce3f740] Setting 'sample_rate' to value '48000'
[h264 @ 0x7f894d006a00] no picture
[graph_1_in_0_1 @ 0x7f894ce3f740] Setting 'sample_fmt' to value 'fltp'
[graph_1_in_0_1 @ 0x7f894ce3f740] Setting 'channel_layout' to value '0x3'
[graph_1_in_0_1 @ 0x7f894ce3f740] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
[format_out_0_1 @ 0x7f894ce3fdc0] Setting 'sample_fmts' to value 'fltp'
[AVFilterGraph @ 0x7f894cc07180] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
Last message repeated 2 times
[h264 @ 0x7f894d007000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264 @ 0x7f894e030800] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264 @ 0x7f894e030e00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
Last message repeated 1 times
[h264 @ 0x7f894e017c00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264 @ 0x7f894d006a00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1
[Parsed_frei0r_0 @ 0x7f894ce4fe40] Setting 'pixeliz0r' to value '0.02'
[Parsed_frei0r_0 @ 0x7f894ce4fe40] Option 'pixeliz0r' not found
[AVFilterGraph @ 0x7f894cc08340] Error initializing filter 'frei0r' with args 'pixeliz0r=0.02:0.02'
Error reinitializing filters!
Failed to inject frame into filter network: Option not found
Error while processing the decoded data for stream #0:0
[AVIOContext @ 0x7f894cc06400] Statistics: 0 seeks, 0 writeouts
[libvorbis @ 0x7f894d800c00] 44 frames left in the queue on closing
[AVIOContext @ 0x7f894ce21080] Statistics: 65536 bytes read, 0 seeks
Conversion failed! -
'ffmpy' cannot find 'ffmpeg' when running in PyCharm on Mac using conda env
5 janvier 2020, par user12448123When I ran the following piece of code in PyCharm on MacOS Catalina within conda environment :
import ffmpy
ff = ffmpy.FFmpeg(
inputs={'download/v_5c80f6ac3e28a_7BumyNgu/video.m3u8': ['-protocol_whitelist', 'crypto,file,http,https,tcp,tls']},
outputs={'download/ffmpy_test.mp4': None}
)
print(ff.cmd)
ff.run()I got this error :
Traceback (most recent call last):
File "/Users/myname/.conda/envs/xiaoetong/lib/python3.7/site-packages/ffmpy.py", line 95, in run
stderr=stderr
File "/Users/myname/.conda/envs/xiaoetong/lib/python3.7/subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "/Users/myname/.conda/envs/xiaoetong/lib/python3.7/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg': 'ffmpeg'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/myname/Documents/Projects/xiaoetong/ffmpy_test.py", line 8, in <module>
ff.run()
File "/Users/myname/.conda/envs/xiaoetong/lib/python3.7/site-packages/ffmpy.py", line 99, in run
raise FFExecutableNotFoundError("Executable '{0}' not found".format(self.executable))
ffmpy.FFExecutableNotFoundError: Executable 'ffmpeg' not found
Process finished with exit code 1
</module>The traceback info above literally implies that either
ffmpeg
is not installed or command is not added to path. However, I did install it, and I could callffmpeg
command successfully in terminal. I could even run that python script without error in zsh terminal within exactly the same conda environment (and using exactly the same python interpreter).(Some information that might be useful :
-
The same code could also be run without error within the same conda environment in PyCharm on Windows 10.
-
python==3.7.5, ffmpeg==4.2, ffmpy==0.2.2 )
This error is just so weird that I have no clue. Someone please help, I would appreciate.
-