
Recherche avancée
Autres articles (53)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (6388)
-
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>


-
electron app fluent-ffmpeg " Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height"
27 juillet 2020, par MartinI am trying to run an ffmpeg command in my electron app. I have created the function ffmpegTest() based off instructions for setting up ffmpeg here :


https://alexandercleasby.dev/blog/use-ffmpeg-electron


and the example query for ffmpeg-fluent here :


https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/blob/master/examples/image2video.js


function ffmpegTest(){
 console.log('ffmpeg-test')
 //require the ffmpeg package so we can use ffmpeg using JS
 const ffmpeg = require('fluent-ffmpeg');
 //Get the paths to the packaged versions of the binaries we want to use
 const ffmpegPath = require('ffmpeg-static').replace(
 'app.asar',
 'app.asar.unpacked'
 );
 const ffprobePath = require('ffprobe-static').path.replace(
 'app.asar',
 'app.asar.unpacked'
 );
 //tell the ffmpeg package where it can find the needed binaries.
 ffmpeg.setFfmpegPath(ffmpegPath);
 ffmpeg.setFfprobePath(ffprobePath);
 
 var imgPath = "C:\\Users\\marti\\Documents\\martinradio\\uploads\\israel song festival 1979\\front.jpg"
 var outputPath = "C:\\Users\\marti\\Documents\\martinradio\\uploads\\israel song festival 1979\\output.m4v"

 // make sure you set the correct path to your video file
 var proc = ffmpeg(imgPath)
 // loop for 5 seconds
 .loop(5)
 // using 25 fps
 .fps(25)
 // setup event handlers
 .on('end', function() {
 console.log('file has been converted succesfully');
 })
 .on('error', function(err) {
 console.log('an error happened: ' + err.message);
 })
 // save to file
 .save(outputPath);

 console.log("end of ffmpeg-test")
}



it is trying to convert an image to a video, my filepaths are accurate, but when I run this function, I get this output in console :


ffmpeg-test
index.js:137 end of ffmpeg-test
index.js:132 an error happened: ffmpeg exited with code 1: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!



After the error prints out, I can see my output.m4v file inside my output folder, but it is 0KB in size and wont open. Is there some way I can specify my bit_rate / rate / width / height in my fluent-ffmpeg command so I can run this simple ffmpeg command ?


thanks


-
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.