
Recherche avancée
Autres articles (73)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (6147)
-
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.


-
Problem with ffmpeg rtp stream to janus webrtc
13 juin 2020, par XPModderI am trying to use ffmpeg and janus-gateway to stream video in the local network. I am piping the h264 video directly in to ffmpeg and from there it gets transferred to janus as an rtp stream. Janus then does the rest.



The problem is, that when I try to open the stream using the streamingtest html page included in janus, I can select the stream, but I never get to see anything. On the console where I started janus, it throws multiple errors starting with : "SDP missing mandatory information"



After starting ffmpeg it shows the SDP in console :



v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat 58.20.100
m=video 8004 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=J2QAKKwrQDwBE/LAPEiagA==,KO4BNywA; profile-level-id=640028




The command I use to start ffmpeg is the following :



ffmpeg -loglevel quiet -y -i - -c:v copy -preset veryfast -f rtp rtp://127.0.0.1:8004




I assume that I am missing something in the ffmpeg command and therefore there is some kind of problem with the SDP.



Edit : I looked a little further into this and actually looked at the code for janus at the lines that throw the error. Then I traced that to the origin of the error.



Apparently the SDP is supposed to contain some authorization in for of this :



a=... ice-ufrag=?; ice-pwd=?




So how do I find out what this username and password are and how do I get it in to the SDP from ffmpeg ?



Or how do I disable this entirely ?


-
Decoding H.264 stream using FFmpeg on Java
25 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 much hours, 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");
 }
 }