
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (69)
-
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 (...)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)
Sur d’autres sites (8937)
-
Anomalie #4569 (Nouveau) : Accessibilité, boutons et javascript
5 octobre 2020Il y a 2 types de boutons qui ne répondent peut-être pas aux critères d’accessibilité, à vérifier.
Bouton « Détails » dans le modèle document_desc¶
Ce bouton sert à afficher ou masquer les détails complets d’un document.
Actuellement c’est juste un lien<a></a>
sans href et du javascript inline :<span class="CodeRay"><span class="tag">span> <span class="attribute-name">class</span>=<span class="string"><span class="delimiter">"</span><span class="content">lien_details bouton link</span><span class="delimiter">"</span></span>
<span class="attribute-name">onClick</span>=<span class="string"><span class="delimiter">"</span><span class="predefined">$</span>(<span class="local-variable">this</span>).parent().next(<span class="string"><span class="delimiter">'</span><span class="content">.detaillees</span><span class="delimiter">'</span></span>).toggle(); <span class="keyword">return</span> <span class="predefined-constant">true</span>;<span class="delimiter">"</span></span>
<span class="attribute-name">title</span>=<span class="string"><span class="delimiter">"</span><span class="content"><:medias:details_document_afficher_masquer|attribut_html:</span></span><span class="error">></span>"<span class="error">></span><span class="tag"><:medias:details_document:></span><span class="tag"></span>
</span></span>Boutons pour changer le mode d’affichage¶
Il s’agit des 3 boutons ajoutés en javascript qui permettent de changer le mode d’affichage de la liste des documents liés.
Ils sont générés en javascript dans gestion_listes_documents.js.
Là il s’agit d’un simple<span></span>
. Un clic dessus toggle des classes sur une cible.<span class="CodeRay">
<span class="tag">span> <span class="attribute-name">class</span>=<span class="string"><span class="delimiter">"</span><span class="content">affichages</span><span class="delimiter">"</span></span><span class="tag">></span>
<span class="tag">span> <span class="attribute-name">class</span>=<span class="string"><span class="delimiter">"</span><span class="content">icone grand on</span><span class="delimiter">"</span></span> <span class="attribute-name">title</span>=<span class="string"><span class="delimiter">"</span><span class="content">Affichage en grand</span><span class="delimiter">"</span></span><span class="tag">></span><span class="tag"></span></span>
<span class="tag">span> <span class="attribute-name">class</span>=<span class="string"><span class="delimiter">"</span><span class="content">icone cases</span><span class="delimiter">"</span></span> <span class="attribute-name">title</span>=<span class="string"><span class="delimiter">"</span><span class="content">Affichage en cases</span><span class="delimiter">"</span></span><span class="tag">></span><span class="tag"></span></span>
<span class="tag">span> <span class="attribute-name">class</span>=<span class="string"><span class="delimiter">"</span><span class="content">icone liste</span><span class="delimiter">"</span></span> <span class="attribute-name">title</span>=<span class="string"><span class="delimiter">"</span><span class="content">Affichage en liste compacte</span><span class="delimiter">"</span></span><span class="tag">></span><span class="tag"></span></span>
<span class="tag"></span>
</span></span> -
Evolution #4727 (Nouveau) : Des pictos / icônes symboliques pour tout le monde
12 avril 2021Je fais un ticket pour la future PR et poser le plan d’action.
C’est la suite de https://core.spip.net/issues/4562#Des-ic%C3%B4nesProposition pour intégrer un jeu complet d’icônes symboliques.¶
Les besoins sont multiples pour pleins d’éléments d’interface, dans le core et les plugins : des barres d’outils, des boutons d’actions, etc.
Et chacun doit réimplémenter ça un peu à sa sauce, notamment dans le privé.C’est un besoin bien distinct des icônes svg de couleur dont on dispose actuellement dans le privé : on veut des pictos symboliques qui héritent de taille et de la couleur du texte, et issus d’un même set afin d’avoir un style unifié.
Cela vient donc en complément.Il s’agit donc de reprendre un jeu d’icônes existant, qu’on n’aura pas à maintenir, optimisé, et qui fournit des icônes cohérentes visuellement, utilisables dans tous les contextes. Cf. plus bas pour une comparaison initiale des candidats possibles.
Utilisation¶
Ces icônes seraient utilisables de 2 façons :
1) Des classes .spicon¶
Des classes à ajouter à n’importe quel élément inline quand il s’agit d’icônes purement décoratives.
Ces classes pouvant finir dans squelettes utilisés dans le public, pour éviter les conflits, on propose la contraption de spip + icon =spicon
. Il y a aussispip-icon
mais c’est un peu plus verbeux.Exemples :
<span class="CodeRay"><span class="tag">span> <span class="attribute-name">class</span>=<span class="string"><span class="delimiter">"</span><span class="content">spicon_menu</span><span class="delimiter">"</span></span><span class="tag">></span>Ouvrir le menu<span class="tag"></span>
<span class="tag">span> <span class="attribute-name">class</span>=<span class="string"><span class="delimiter">"</span><span class="content">spicon_truc</span><span class="delimiter">"</span></span><span class="tag">></span><span class="tag"></span> Du texte
<span class="tag">span> <span class="attribute-name">class</span>=<span class="string"><span class="delimiter">"</span><span class="content">titrem spicon_machin</span><span class="delimiter">"</span></span><span class="tag">></span>Mon titre<span class="tag"></span>
</span></span></span></span>2) Une balise #ICON¶
En complément, on peut vouloir embarquer une icône svg dans le HTML.
On propose de reprendre et d’adapter la balise #ICON du plugin Zcore, qui fait ça très bien.
Cette balise permet d’embarquer une icône du set par défaut, mais également n’importe quelle autre (je rentre pas dans les détails).Un modèle correspondant permettra aussi d’inclure des icônes svg dans les textes :
<span class="CodeRay">
#ICONE{identifiant}
#ICONE{chemin/vers/mon_icone.svg}
#ICONE{#identifiant_autre_set}
</span>Identifiants sémantiques¶
Les identifiants des icônes seront directement ceux du jeu d’icônes choisi.
Mais ils peuvent avoir des noms un peu barbares : chevron-double-right, eye-slash, grip-vertical, etc.Dans tous les cas on pourra les utiliser tels quels, mais en plus de ça, on propose de faire une correspondance sémantique pour les icônes correspondants aux actions les plus courantes. Par exemple au lieu de faire
#ICONE{chevron-double-down}
on pourra faire#ICONE{deplier}
.
Cela passerait par un pipeline, donc liste qui peut être complétée selon ses besoins.La liste initiale est visible ici : https://demo.hedgedoc.org/3zIXkcFLTVSwV0nKC1_qcA?both
Ressources privé / public¶
Cela veut dire 2 ressources à charger :
- Une font-face pour les classes
- Un sprite svg pour la balise
Dans le privé, il faut charger les 2.
Dans le public, cela pourrait se faire optionnellement, à la demande.Candidats¶
Pour finir un tableau comparatif des jeux d’icônes possibles (à licences libres), avec mes commentaires initiaux.
Petite préférence pour Feather actuellement.Lib Nb sprite fontface Commentaire Bootstrap 1300+ 693ko 85ko Clés en main, beaucoup d’icônes (trop ?) Feather 286 ( 100ko) - Styles rounded. Bonne balance nb icônes / poids. Octicon (Github) 433 ( 240ko) - Styles rounded. Bonne balance nb icônes / poids. Beaucoup de manips à faire pour créer sprite et cie. Material (Google) ? (?ko) 44ko Style rounded / épaisseur variable. Beaucoup de manips à faire pour créer sprite et cie. Google ! Core-ui 554 418ko 63ko Clés en main. Sets inutiles non pris en compte dans ce tableau (brands, flags, …) Bytesize 101 11ko - Style rounded / épaisseur variable. Léger : le minimum syndical. Sprite entre parenthèses = non fourni dans le dépôt ou la dist → poids théorique.
-
Send AVPacket over Network
2 décembre 2019, par YondonatorI’m generating AVPackets with an encoder with ffmpeg and now I want to send them with UDP to another Computer and show them there.
The problem is I don’t know how to convert the packet to bytes and back. I tried this to copy the package :AVPacket newPacket = avcodec.av_packet_alloc();
ByteBuffer byteBuffer = packet.buf().buffer().asByteBuffer();
int bufferSize = byteBuffer.capacity();
byte bytes[] = new byte[bufferSize];
byteBuffer.get(bytes);
AVBufferRef newBufferRef = avutil.av_buffer_alloc(bufferSize);
newBufferRef.data(new BytePointer(bytes));
newPacket.buf(newBufferRef);
ByteBuffer dataBuffer = packet.data().asByteBuffer();
int dataSize = dataBuffer.capacity();
byte dataBytes[] = new byte[dataSize];
dataBuffer.get(dataBytes);
BytePointer dataPointer = new BytePointer(dataBytes);
newPacket.data(dataPointer);
newPacket.dts(packet.dts());
newPacket.duration(packet.duration());
newPacket.flags(packet.flags());
newPacket.pos(packet.pos());
newPacket.pts(packet.pts());
newPacket.side_data_elems(0);
newPacket.size(packet.size());
newPacket.stream_index(packet.stream_index());
videoPlayer.sendPacket(newPacket);This gives me this Error :
[h264 @ 0000018951be8440] Invalid NAL unit size (3290676 > 77).
[h264 @ 0000018951be8440] Error splitting the input into NAL units.
[h264 @ 0000018951bf6480] Invalid NAL unit size (15305314 > 163).
[h264 @ 0000018951bf6480] Error splitting the input into NAL units.The problem is
newPacket.data()
. When I set it directly :newPacket.data(packet.data())
it works. Alsopacket.data().asByteBuffer().capacity()
returns 1 andpacket.data().capacity()
returns 0.This is my method that creates the decoder :
private void startUnsafe() throws Exception
{
int result;
convertContext = null;
codec = null;
codecContext = null;
AVFrame = null;
RGBAVFrame = null;
frame = new Frame();
codec = avcodec_find_decoder(codecID);
if(codec == null)
{
throw new Exception("Unable to find decoder");
}
codecContext = avcodec_alloc_context3(codec);
if(codecContext == null)
{
releaseUnsafe();
throw new Exception("Unable to alloc codec context!");
}
AVCodecParameters para = avcodec_parameters_alloc();
para.bit_rate(streamBitrate);
para.width(streamWidth);
para.height(streamHeight);
para.codec_id(codecID);
para.codec_type(AVMEDIA_TYPE_VIDEO);
try
{
byte extradataByte[] = Files.readAllBytes(new File("extradata.byte").toPath());
para.extradata(new BytePointer(extradataByte));
para.extradata_size(extradataByte.length);
}
catch (IOException e1)
{
e1.printStackTrace();
throw new Exception("extradata file not available");
}
result = avcodec_parameters_to_context(codecContext, para);
if(result < 0)
{
throw new Exception("Unable to copy parameters to context! [" + result + "]");
}
codecContext.thread_count(0);
result = avcodec_open2(codecContext, codec, new AVDictionary());
if(result < 0)
{
releaseUnsafe();
throw new Exception("Unable to open codec context![" + result + "]");
}
AVFrame = av_frame_alloc();
if(AVFrame == null)
{
releaseUnsafe();
throw new Exception("Unable to alloc AVFrame!");
}
RGBAVFrame = av_frame_alloc();
if(RGBAVFrame == null)
{
releaseUnsafe();
throw new Exception("Unable to alloc AVFrame!");
}
initRGBAVFrame();
TimerTask task = new TimerTask() {
@Override
public void run()
{
timerTask();
}
};
timer = new Timer();
timer.scheduleAtFixedRate(task, 0, (long) (1000/streamFramerateDouble));
window.setVisible(true);
}The file extradata.byte has some bytes that I got from another video, because without them it doesn’t work too.
EDIT :
package org.stratostream.streaming;
import java.nio.ByteBuffer;
import org.bytedeco.javacpp.BytePointer;
import org.bytedeco.javacpp.Pointer;
import org.bytedeco.javacpp.avcodec;
import org.bytedeco.javacpp.avutil;
import org.bytedeco.javacpp.avcodec.AVPacket;
import org.bytedeco.javacpp.avcodec.AVPacketSideData;
public class PacketIO {
public static final int SIDE_DATA_FIELD = 0;
public static final int SIDE_ELEMENTS_FIELD = 4;
public static final int SIDE_TYPE_FIELD = 8;
public static final int DTS_FIELD = 12;
public static final int PTS_FIELD = 20;
public static final int FLAGS_FIELD = 28;
public static final int DATA_OFFSET = 32;
public static byte[] toByte(AVPacket packet) throws Exception
{
int dataSize = packet.size();
ByteBuffer dataBuffer = packet.data().capacity(dataSize).asByteBuffer();
byte dataBytes[] = new byte[dataSize];
dataBuffer.get(dataBytes);
AVPacketSideData sideData = packet.side_data();
int sideSize = sideData.size();
ByteBuffer sideBuffer = sideData.data().capacity(sideSize).asByteBuffer();
byte sideBytes[] = new byte[sideSize];
sideBuffer.get(sideBytes);
int sideOffset = DATA_OFFSET + dataSize;
int resultSize = sideOffset + sideSize;
byte resultBytes[] = new byte[resultSize];
System.arraycopy(dataBytes, 0, resultBytes, DATA_OFFSET, dataSize);
System.arraycopy(sideBytes, 0, resultBytes, sideOffset, sideSize);
resultBytes[SIDE_DATA_FIELD] = (byte) (sideOffset >>> 24);
resultBytes[SIDE_DATA_FIELD+1] = (byte) (sideOffset >>> 16);
resultBytes[SIDE_DATA_FIELD+2] = (byte) (sideOffset >>> 8);
resultBytes[SIDE_DATA_FIELD+3] = (byte) (sideOffset >>> 0);
int sideType = sideData.type();
intToByte(resultBytes, SIDE_TYPE_FIELD, sideType);
int sideElements = packet.side_data_elems();
intToByte(resultBytes, SIDE_ELEMENTS_FIELD, sideElements);
long dts = packet.dts();
longToByte(resultBytes, DTS_FIELD, dts);
long pts = packet.pts();
longToByte(resultBytes, PTS_FIELD, pts);
int flags = packet.flags();
intToByte(resultBytes, FLAGS_FIELD, flags);
return resultBytes;
}
public static AVPacket toPacket(byte bytes[]) throws Exception
{
AVPacket packet = avcodec.av_packet_alloc();
int sideOffset = byteToInt(bytes, SIDE_DATA_FIELD);
int sideElements = byteToInt(bytes, SIDE_ELEMENTS_FIELD);
int sideType = byteToInt(bytes, SIDE_TYPE_FIELD);
int dataSize = sideOffset - DATA_OFFSET;
int sideSize = bytes.length - sideOffset;
long pts = byteToLong(bytes, PTS_FIELD);
long dts = byteToLong(bytes, DTS_FIELD);
int flags = byteToInt(bytes, FLAGS_FIELD);
packet.pts(pts);
packet.dts(dts);
packet.flags(flags);
Pointer newDataPointer = avutil.av_malloc(bytes.length);
BytePointer dataPointer = new BytePointer(newDataPointer);
byte dataBytes[] = new byte[dataSize];
System.arraycopy(bytes, DATA_OFFSET, dataBytes, 0, dataSize);
dataPointer.put(dataBytes);
packet.data(dataPointer);
packet.size(dataSize);
Pointer newSidePointer = avutil.av_malloc(sideSize);
BytePointer sidePointer = new BytePointer(newSidePointer);
byte sideBytes[] = new byte[sideSize];
System.arraycopy(bytes, sideOffset, sideBytes, 0, sideSize);
sidePointer.put(sideBytes);
AVPacketSideData sideData = new AVPacketSideData();
sideData.data(sidePointer);
sideData.type(sideType);
sideData.size(sideSize);
//packet.side_data(sideData);
//packet.side_data_elems(sideElements);
return packet;
}
private static void intToByte(byte[] bytes, int offset, int value)
{
bytes[offset] = (byte) (value >>> 24);
bytes[offset+1] = (byte) (value >>> 16);
bytes[offset+2] = (byte) (value >>> 8);
bytes[offset+3] = (byte) (value >>> 0);
}
private static void longToByte(byte[] bytes, int offset, long value)
{
bytes[offset] = (byte) (value >>> 56);
bytes[offset+1] = (byte) (value >>> 48);
bytes[offset+2] = (byte) (value >>> 40);
bytes[offset+3] = (byte) (value >>> 32);
bytes[offset+4] = (byte) (value >>> 24);
bytes[offset+5] = (byte) (value >>> 16);
bytes[offset+6] = (byte) (value >>> 8);
bytes[offset+7] = (byte) (value >>> 0);
}
private static int byteToInt(byte[] bytes, int offset)
{
return (bytes[offset]<<24)&0xff000000|(bytes[offset+1]<<16)&0x00ff0000|(bytes[offset+2]<<8)&0x0000ff00|(bytes[offset+3]<<0)&0x000000ff;
}
private static long byteToLong(byte[] bytes, int offset)
{
return (bytes[offset]<<56)&0xff00000000000000L|(bytes[offset+1]<<48)&0x00ff000000000000L|(bytes[offset+2]<<40)&0x0000ff0000000000L|(bytes[offset+3]<<32)&0x000000ff00000000L|(bytes[offset+4]<<24)&0x00000000ff000000L|(bytes[offset+5]<<16)&0x0000000000ff0000L|(bytes[offset+6]<<8)&0x000000000000ff00L|(bytes[offset+7]<<0)&0x00000000000000ffL;
}
}Now I have this class that works fine on the same programm, but when I send the bytes over the network I get a bad output and this error is printed to the console :
[h264 @ 00000242442acc40] Missing reference picture, default is 72646
[h264 @ 000002424089de00] Missing reference picture, default is 72646
[h264 @ 000002424089e3c0] mmco: unref short failure
[h264 @ 000002424081a580] reference picture missing during reorder
[h264 @ 000002424081a580] Missing reference picture, default is 72652
[h264 @ 000002424082c400] mmco: unref short failure
[h264 @ 000002424082c400] co located POCs unavailable
[h264 @ 000002424082c9c0] co located POCs unavailable
[h264 @ 00000242442acc40] co located POCs unavailable
[h264 @ 000002424089de00] mmco: unref short failureI think its because I dont set the sidedata field but when I try to set it the encoder crashes with the second packet.
The output looks like this :
Decoder Output