
Recherche avancée
Autres articles (40)
-
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
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 (...)
Sur d’autres sites (10503)
-
Error of FFmpeg on Java in "av_image_copy_to_buffer" method during decoding H.264 stream
26 mai 2020, par maru2213I'm trying to decode H.264 stream, which is sent over Socket from an Android application to a computer. And I also want to show the decoded stream using JavaFX. I searched for a long time, and decided to use JavaCV / FFmpeg. However I got error from FFmpeg. (I was inspired by this code.)



Questions :



- 

- Why does FFmpeg make error ?
- Is it a correct way to convert
AVFrame
tojavafx.scene.image.Image
?







I'm using :



- 

- javacv-platform 1.4.4
- ffmpeg-platform 4.1-1.4.4







Code :



This is a part of import and class fields, and method which runs once at the first time. (Actually the content of
initialize()
is wrapped by try catch.)


import javafx.scene.image.Image;

 private avcodec.AVCodec avCodec;
 private avcodec.AVCodecContext avCodecContext;
 private avutil.AVDictionary avDictionary;
 private avutil.AVFrame avFrame;

 public void initialize() {
 avCodec = avcodec_find_decoder(AV_CODEC_ID_H264);
 if (avCodec == null) {
 throw new RuntimeException("Can't find decoder");
 }
 avCodecContext = avcodec_alloc_context3(avCodec);
 if (avCodecContext == null) {
 throw new RuntimeException("Can't allocate decoder context");
 }
 int result = avcodec_open2(avCodecContext, avCodec, (AVDictionary) null);
 if (result < 0) {
 throw new RuntimeException("Can't open decoder");
 }
 avFrame = av_frame_alloc();
 if (avFrame == null) {
 throw new RuntimeException("Can't allocate frame");
 }
 }




And this is a method which is called every time when I receive a packet from Android.
byte[] data
is the packet data starting with0x00
,0x00
,0x00
,0x01
.


The place where I get error is
number_of_written_bytes
. It always gets <0.


private void decode(byte[] data) {
 AVPacket avPacket = new AVPacket();
 av_init_packet(avPacket);
 avPacket.pts(AV_NOPTS_VALUE);
 avPacket.dts(AV_NOPTS_VALUE);
 BytePointer bytePointer = new BytePointer(data);
 bytePointer.capacity(data.length);
 avPacket.data(bytePointer);
 avPacket.size(data.length);
 avPacket.pos(-1);

 avcodec_send_packet(avCodecContext, avPacket);
 int result = avcodec_receive_frame(avCodecContext, avFrame);
 if (result >= 0) {
 int bufferOutputSize = av_image_get_buffer_size(avFrame.format(), avFrame.width(), avFrame.height(), 16);
 Pointer pointer = av_malloc(bufferOutputSize);
 BytePointer outputPointer = new BytePointer(pointer);
 int number_of_written_bytes = av_image_copy_to_buffer(outputPointer, bufferOutputSize, avFrame.data(), avFrame.linesize(), avFrame.chroma_location(), avFrame.width(), avFrame.height(), 1);
 if (number_of_written_bytes < 0) {
 //The process always come here.
 throw new RuntimeException("Can't copy image to buffer");
 }

 System.out.println("decode success");
 Image image = new Image(new ByteArrayInputStream(outputPointer.asBuffer().array()));
 } else {
 System.out.println("decode failed");
 }
 }




Anything is helpful for me. Thanks.


-
Fatal Exception : java.lang.UnsatisfiedLinkError lopen failed : library name "/data/packagename/lib/arm64/libmobileffmpeg_abidetect.so" too long
23 septembre 2020, par Android198Fatal Exception: java.lang.UnsatisfiedLinkError lopen failed: library name "/data/packagename/lib/arm64/libmobileffmpeg_abidetect.so" too long 



I got this error in android 5 devices because my app packagename is too long. i build apk with abi filters
armeabi-v7a
,arm64-v8a


'java.lang.System.loadLibrary (System.java:989)
 com.arthenica.mobileffmpeg.AbiDetect.<clinit> (AbiDetect.java)
 com.arthenica.mobileffmpeg.AbiDetect.getNativeAbi (AbiDetect.java)
 com.arthenica.mobileffmpeg.AbiDetect.setArmV7aNeonLoaded (AbiDetect.java)
 com.arthenica.mobileffmpeg.Config.enableLogCallback (Config.java:5)'
</clinit>


-
FFMPEG, macOS Catalina : "ffmpeg stderr : /private/tmp/com.apple.launchd.ID/org.macosforge.xquartz:0 : Operation not supported on socket"
11 février 2021, par Bogdan SlyusarenkoI'm trying to record selenium test run with FFMPEG, for automation testing of web extensions (selenium+js/ts).
FFMPEG initiated by command :


const { spawn } = require("child_process");
 ffmpeg = spawn("ffmpeg", [
 "-x265-params",
 "-f",
 "xcbgrab", 
 "-video_size",
 "1280x1024", 
 "-i",
 process.env.DISPLAY, // "/private/tmp/com.apple.launchd.ID/org.macosforge.xquartz:0"
 "-loglevel",
 "debug", 
 "-y", 
 "-pix_fmt",
 "yuv420p",
 videoPath, 
 ]);



Return constantly error,related to process.DISPLAY, I'm not sure why it's so :


ffmpeg stderr: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0: Operation not supported on socket



Full debug login is :


ffmpeg stderr: ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
ffmpeg stderr: built with Apple clang version 12.0.0 (clang-1200.0.32.28)
ffmpeg stderr: configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_9 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --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 --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack
ffmpeg stderr: libavutil 56. 51.100 / 56. 51.100
ffmpeg stderr: libavcodec 58. 91.100 / 58. 91.100
ffmpeg stderr: libavformat 58. 45.100 / 58. 45.100
ffmpeg stderr: libavdevice 58. 10.100 / 58. 10.100
ffmpeg stderr: libavfilter 7. 85.100 / 7. 85.100
ffmpeg stderr: libavresample 4. 0. 0 / 4. 0. 0
ffmpeg stderr: libswscale 5. 7.100 / 5. 7.100
ffmpeg stderr: libswresample 3. 7.100 / 3. 7.100
ffmpeg stderr: libpostproc 55. 7.100 / 55. 7.100
ffmpeg stderr: Splitting the commandline.
ffmpeg stderr: Reading option '-x265-params' ...
ffmpeg stderr: matched as AVOption 'x265-params' with argument '-f'.
ffmpeg stderr: Reading option 'xcbgrab' ...
ffmpeg stderr: matched as output url.
ffmpeg stderr: Reading option '-video_size' ...
ffmpeg stderr: matched as AVOption 'video_size' with argument '1280x1024'.
ffmpeg stderr: Reading option '-i' ... matched as input url with argument '/private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0'.
ffmpeg stderr: Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
ffmpeg stderr: Reading option '-y' ...
ffmpeg stderr: matched as option 'y' (overwrite output files) with argument '1'.
ffmpeg stderr: Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
ffmpeg stderr: Reading option '/Volumes/MacHD2/Upprojects/TEST/log/Checkout-Google.com-Search-on-Google.mp4' ... matched as output url.
ffmpeg stderr: Finished splitting the commandline.
ffmpeg stderr: Parsing a group of options: global .
ffmpeg stderr: Applying option loglevel (set logging level) with argument debug.
ffmpeg stderr: Applying option y (overwrite output files) with argument 1.
ffmpeg stderr: Successfully parsed a group of options.
ffmpeg stderr: Parsing a group of options: input url /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0.
ffmpeg stderr: Successfully parsed a group of options.
ffmpeg stderr: Opening an input file: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0.
ffmpeg stderr: [NULL @ 0x7fcf80016800] Opening '/private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0' for reading
ffmpeg stderr: [file @ 0x7fcf7f507a00] Setting default whitelist 'file,crypto,data'
ffmpeg stderr: /private/tmp/com.apple.launchd.W851FkeNXz/org.macosforge.xquartz:0: Operation not supported on socket




Any feedback appreciated