
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (32)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (5016)
-
Http 400 error : requesting https site with ip instead of hostname Android
8 novembre 2016, par David BarishevIm am developing an android application using xamarin.android.
In my application i use ffmpeg as a static library, from here.In my app i try to access a https site, but i was getting a dns error until i read the documentation, it stated that :
A limitation of statically linking glibc is the loss of DNS
resolution. Installing
nscd through your package manager will fix this or you can use
"ffmpeg -i http://<ip address="address" here="here">/"</ip>
instead of"ffmpeg -i http://example.com/"
So i tried to lookup the ip address and just replace the hostname. Here is the code i have written :
...
//part of main program
if (inputUrl.StartsWith("http"))
{
var splits = inputUrl.Split('/');
var hostName = splits[2];
var ip = GetIpForHost(hostName);
splits[2] = ip;
inputUrl= string.Join("/",splits);
}
//calling ffmpeg with the new url
...
private static string GetIpForHost(string hostname)
{
System.Net.IPHostEntry host = System.Net.Dns.GetHostEntry(hostname);
return host.AddressList.First().ToString();
}The code works fine, but now i’m getting different error, here is the ffmpeg log :
[https @ 0xb2b08e0] HTTP error 400 Bad Request
The original url i tried :
https://r8---sn-ivuoxu-ua8l.googlevideo.com/videoplayback?pl=26&itag=22&mt=1478622247&ms=au&ei=Mv0hWLWEAs-VW7zch6AB&mv=m&upn=DLluZN9oSzo&mn=sn-ivuoxu-ua8l&expire=1478644114&mm=31&ratebypass=yes&id=o-AC_NwrGbkh5OVe-ypJh2WaxzMBK5grMVsSYyG_wMQVZI&ip=5.29.246.6&pcm2cms=yes&key=yt6&lmt=1478408938763105&dur=229.575&initcwndbps=2682500&ipbits=0&gcr=il&requiressl=yes&sparams=dur,ei,gcr,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,pcm2cms,pl,ratebypass,requiressl,source,upn,expire&mime=video/mp4&source=youtube&signature=0E47DFC7FBBDBCD6F36B56FB9871ED3B0DF4D12A.103BAB44FFEE918B78C7D076243B45AF69C444EC
//Modifed url
https://213.57.23.19/videoplayback?ratebypass=yes&ipbits=0&pl=26&requiressl=yes&mime=video/mp4&expire=1478643396&pcm2cms=yes&mt=1478621598&upn=mUgYIoXd3Dc&itag=22&mm=31&mn=sn-ivuoxu-ua8l&key=yt6&ip=5.29.246.6&dur=229.575&source=youtube&lmt=1478408938763105&ei=ZPohWKzbFoG9cpGGsIgH&id=o-AFbYd2BFoMp37bNWC1c0mtfqEwcwbQaNXrF2WraCeK2W&ms=au&gcr=il&mv=m&sparams=dur,ei,gcr,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,pcm2cms,pl,ratebypass,requiressl,source,upn,expire&initcwndbps=2657500&signature=BFB25E20CD92AA3B85D115DB878F0BC2E94A1BF4.C36FBD7733D2CAF1E277FF3B625BED432822C012: Server returned 400 Bad RequestI have no problem accessing the original url through the browser, at the time i ran the program(There is a expired tag in the url,since i’m generating it at runtime).
I speculate that it’s not possible to connect via https through ip ?
Is there another way to connect to the url without the hostname, since android does have build in dns resolution, since i am able to view the url through the browser ? -
javax.media.NoDataSinkException
23 novembre 2022, par DivyaI am trying to convert Jpeg images into .mov video file



package com.ecomm.pl4mms.test;

import java.io.*;
import java.util.*;
import java.awt.Dimension;

import javax.media.*;
import javax.media.control.*;
import javax.media.protocol.*;
import javax.media.protocol.DataSource;
import javax.media.datasink.*;
import javax.media.format.VideoFormat;
import javax.media.format.JPEGFormat;

public class JpegImagesToMovie implements ControllerListener, DataSinkListener {

 public boolean doItPath(int width, int height, int frameRate, Vector inFiles, String outputURL) {
 // Check for output file extension.
 if (!outputURL.endsWith(".mov") && !outputURL.endsWith(".MOV")) {
 // System.err.println("The output file extension should end with a
 // .mov extension");
 prUsage();
 }

 // Generate the output media locators.
 MediaLocator oml;

 if ((oml = createMediaLocator("file:" + outputURL)) == null) {
 // System.err.println("Cannot build media locator from: " +
 // outputURL);
 //System.exit(0);
 }

 boolean success = doIt(width, height, frameRate, inFiles, oml);

 System.gc();
 return success;
 }

 public boolean doIt(int width, int height, int frameRate, Vector inFiles, MediaLocator outML) {
 try {
 System.out.println(inFiles.size());
 ImageDataSource ids = new ImageDataSource(width, height, frameRate, inFiles);

 Processor p;

 try {
 // System.err.println("- create processor for the image
 // datasource ...");
 System.out.println("processor");
 p = Manager.createProcessor(ids);
 System.out.println("success");
 } catch (Exception e) {
 // System.err.println("Yikes! Cannot create a processor from the
 // data source.");
 return false;
 }

 p.addControllerListener(this);

 // Put the Processor into configured state so we can set
 // some processing options on the processor.
 p.configure();
 if (!waitForState(p, p.Configured)) {
 System.out.println("Issue configuring");
 // System.err.println("Failed to configure the processor.");
 p.close();
 p.deallocate();
 return false;
 }
 System.out.println("Configured");

 // Set the output content descriptor to QuickTime.
 p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.QUICKTIME));
System.out.println(outML);
 // Query for the processor for supported formats.
 // Then set it on the processor.
 TrackControl tcs[] = p.getTrackControls();
 Format f[] = tcs[0].getSupportedFormats();
 System.out.println(f[0].getEncoding());
 if (f == null || f.length <= 0) {
 System.err.println("The mux does not support the input format: " + tcs[0].getFormat());
 p.close();
 p.deallocate();
 return false;
 }

 tcs[0].setFormat(f[0]);

 // System.err.println("Setting the track format to: " + f[0]);

 // We are done with programming the processor. Let's just
 // realize it.
 p.realize();
 if (!waitForState(p, p.Realized)) {
 // System.err.println("Failed to realize the processor.");
 p.close();
 p.deallocate();
 return false;
 }

 // Now, we'll need to create a DataSink.
 DataSink dsink;
 if ((dsink = createDataSink(p, outML)) == null) {
 // System.err.println("Failed to create a DataSink for the given
 // output MediaLocator: " + outML);
 p.close();
 p.deallocate();
 return false;
 }

 dsink.addDataSinkListener(this);
 fileDone = false;

 // System.err.println("start processing...");

 // OK, we can now start the actual transcoding.
 try {
 p.start();
 dsink.start();
 } catch (IOException e) {
 p.close();
 p.deallocate();
 dsink.close();
 // System.err.println("IO error during processing");
 return false;
 }

 // Wait for EndOfStream event.
 waitForFileDone();

 // Cleanup.
 try {
 dsink.close();
 } catch (Exception e) {
 }
 p.removeControllerListener(this);

 // System.err.println("...done processing.");

 p.close();

 return true;
 } catch (NotConfiguredError e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 }

 return false;
 }

 /**
 * Create the DataSink.
 */
 DataSink createDataSink(Processor p, MediaLocator outML) {
System.out.println("In data sink");
 DataSource ds;

 if ((ds = p.getDataOutput()) == null) {
 System.out.println("Something is really wrong: the processor does not have an output DataSource");
 return null;
 }

 DataSink dsink;

 try {
 System.out.println("- create DataSink for: " + ds.toString()+ds.getContentType());
 dsink = Manager.createDataSink(ds, outML);
 dsink.open();
 System.out.println("Done data sink");
 } catch (Exception e) {
 System.err.println("Cannot create the DataSink: " +e);
 e.printStackTrace();
 return null;
 }

 return dsink;
 }

 Object waitSync = new Object();
 boolean stateTransitionOK = true;

 /**
 * Block until the processor has transitioned to the given state. Return
 * false if the transition failed.
 */
 boolean waitForState(Processor p, int state) {
 synchronized (waitSync) {
 try {
 while (p.getState() < state && stateTransitionOK)
 waitSync.wait();
 } catch (Exception e) {
 }
 }
 return stateTransitionOK;
 }

 /**
 * Controller Listener.
 */
 public void controllerUpdate(ControllerEvent evt) {

 if (evt instanceof ConfigureCompleteEvent || evt instanceof RealizeCompleteEvent
 || evt instanceof PrefetchCompleteEvent) {
 synchronized (waitSync) {
 stateTransitionOK = true;
 waitSync.notifyAll();
 }
 } else if (evt instanceof ResourceUnavailableEvent) {
 synchronized (waitSync) {
 stateTransitionOK = false;
 waitSync.notifyAll();
 }
 } else if (evt instanceof EndOfMediaEvent) {
 evt.getSourceController().stop();
 evt.getSourceController().close();
 }
 }

 Object waitFileSync = new Object();
 boolean fileDone = false;
 boolean fileSuccess = true;

 /**
 * Block until file writing is done.
 */
 boolean waitForFileDone() {
 synchronized (waitFileSync) {
 try {
 while (!fileDone)
 waitFileSync.wait();
 } catch (Exception e) {
 }
 }
 return fileSuccess;
 }

 /**
 * Event handler for the file writer.
 */
 public void dataSinkUpdate(DataSinkEvent evt) {

 if (evt instanceof EndOfStreamEvent) {
 synchronized (waitFileSync) {
 fileDone = true;
 waitFileSync.notifyAll();
 }
 } else if (evt instanceof DataSinkErrorEvent) {
 synchronized (waitFileSync) {
 fileDone = true;
 fileSuccess = false;
 waitFileSync.notifyAll();
 }
 }
 }

 public static void main(String arg[]) {
 try {
 String args[] = { "-w 100 -h 100 -f 100 -o F:\\test.mov F:\\Text69.jpg F:\\Textnew.jpg" };
 if (args.length == 0)
 prUsage();

 // Parse the arguments.
 int i = 0;
 int width = -1, height = -1, frameRate = 1;
 Vector inputFiles = new Vector();
 String outputURL = null;

 while (i < args.length) {

 if (args[i].equals("-w")) {
 i++;
 if (i >= args.length)
 width = new Integer(args[i]).intValue();
 } else if (args[i].equals("-h")) {
 i++;
 if (i >= args.length)
 height = new Integer(args[i]).intValue();
 } else if (args[i].equals("-f")) {
 i++;
 if (i >= args.length)
 frameRate = new Integer(args[i]).intValue();
 } else if (args[i].equals("-o")) {
 System.out.println("in ou");
 i++;
 System.out.println(i);
 if (i >= args.length)
 outputURL = args[i];
 System.out.println(outputURL);
 } else {
 System.out.println("adding"+args[i]);
 inputFiles.addElement(args[i]);
 }
 i++;

 }
 inputFiles.addElement("F:\\Textnew.jpg");
 outputURL = "F:\\test.mov";
 System.out.println(inputFiles.size() + outputURL);
 if (outputURL == null || inputFiles.size() == 0)
 prUsage();

 // Check for output file extension.
 if (!outputURL.endsWith(".mov") && !outputURL.endsWith(".MOV")) {
 System.err.println("The output file extension should end with a .mov extension");
 prUsage();
 }
 width = 100;
 height = 100;
 if (width < 0 || height < 0) {
 System.err.println("Please specify the correct image size.");
 prUsage();
 }

 // Check the frame rate.
 if (frameRate < 1)
 frameRate = 1;

 // Generate the output media locators.
 MediaLocator oml;
 oml = createMediaLocator(outputURL);
 System.out.println("Media" + oml);
 if (oml == null) {
 System.err.println("Cannot build media locator from: " + outputURL);
 // //System.exit(0);
 }
 System.out.println("Before change");
System.out.println(inputFiles.size());
 JpegImagesToMovie imageToMovie = new JpegImagesToMovie();
 boolean status = imageToMovie.doIt(width, height, frameRate, inputFiles, oml);
 System.out.println("Status"+status);
 //System.exit(0);
 } catch (Exception e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 }
 }

 static void prUsage() {
 System.err.println(
 "Usage: java JpegImagesToMovie -w <width> -h <height> -f -o <output url="url"> <input jpeg="jpeg" file="file" 1="1" /> <input jpeg="jpeg" file="file" 2="2" /> ...");
 //System.exit(-1);
 }

 /**
 * Create a media locator from the given string.
 */
 static MediaLocator createMediaLocator(String url) {
 System.out.println(url);
 MediaLocator ml;

 if (url.indexOf(":") > 0 && (ml = new MediaLocator(url)) != null)
 return ml;

 if (url.startsWith(File.separator)) {
 if ((ml = new MediaLocator("file:" + url)) != null)
 return ml;
 } else {
 String file = "file:" + System.getProperty("user.dir") + File.separator + url;
 if ((ml = new MediaLocator(file)) != null)
 return ml;
 }

 return null;
 }

 ///////////////////////////////////////////////
 //
 // Inner classes.
 ///////////////////////////////////////////////

 /**
 * A DataSource to read from a list of JPEG image files and turn that into a
 * stream of JMF buffers. The DataSource is not seekable or positionable.
 */
 class ImageDataSource extends PullBufferDataSource {

 ImageSourceStream streams[];

 ImageDataSource(int width, int height, int frameRate, Vector images) {
 streams = new ImageSourceStream[1];
 streams[0] = new ImageSourceStream(width, height, frameRate, images);
 }

 public void setLocator(MediaLocator source) {
 }

 public MediaLocator getLocator() {
 return null;
 }

 /**
 * Content type is of RAW since we are sending buffers of video frames
 * without a container format.
 */
 public String getContentType() {
 return ContentDescriptor.RAW;
 }

 public void connect() {
 }

 public void disconnect() {
 }

 public void start() {
 }

 public void stop() {
 }

 /**
 * Return the ImageSourceStreams.
 */
 public PullBufferStream[] getStreams() {
 return streams;
 }

 /**
 * We could have derived the duration from the number of frames and
 * frame rate. But for the purpose of this program, it's not necessary.
 */
 public Time getDuration() {
 return DURATION_UNKNOWN;
 }

 public Object[] getControls() {
 return new Object[0];
 }

 public Object getControl(String type) {
 return null;
 }
 }

 /**
 * The source stream to go along with ImageDataSource.
 */
 class ImageSourceStream implements PullBufferStream {

 Vector images;
 int width, height;
 VideoFormat format;

 int nextImage = 0; // index of the next image to be read.
 boolean ended = false;

 public ImageSourceStream(int width, int height, int frameRate, Vector images) {
 this.width = width;
 this.height = height;
 this.images = images;

 format = new JPEGFormat(new Dimension(width, height), Format.NOT_SPECIFIED, Format.byteArray,
 (float) frameRate, 75, JPEGFormat.DEC_422);
 }

 /**
 * We should never need to block assuming data are read from files.
 */
 public boolean willReadBlock() {
 return false;
 }

 /**
 * This is called from the Processor to read a frame worth of video
 * data.
 */
 public void read(Buffer buf) throws IOException {

 // Check if we've finished all the frames.
 if (nextImage >= images.size()) {
 // We are done. Set EndOfMedia.
 System.err.println("Done reading all images.");
 buf.setEOM(true);
 buf.setOffset(0);
 buf.setLength(0);
 ended = true;
 return;
 }

 String imageFile = (String) images.elementAt(nextImage);
 nextImage++;

 System.err.println(" - reading image file: " + imageFile);

 // Open a random access file for the next image.
 RandomAccessFile raFile;
 raFile = new RandomAccessFile(imageFile, "r");

 byte data[] = null;

 // Check the input buffer type & size.

 if (buf.getData() instanceof byte[])
 data = (byte[]) buf.getData();

 // Check to see the given buffer is big enough for the frame.
 if (data == null || data.length < raFile.length()) {
 data = new byte[(int) raFile.length()];
 buf.setData(data);
 }

 // Read the entire JPEG image from the file.
 raFile.readFully(data, 0, (int) raFile.length());

 System.err.println(" read " + raFile.length() + " bytes.");

 buf.setOffset(0);
 buf.setLength((int) raFile.length());
 buf.setFormat(format);
 buf.setFlags(buf.getFlags() | buf.FLAG_KEY_FRAME);

 // Close the random access file.
 raFile.close();
 }

 /**
 * Return the format of each video frame. That will be JPEG.
 */
 public Format getFormat() {
 return format;
 }

 public ContentDescriptor getContentDescriptor() {
 return new ContentDescriptor(ContentDescriptor.RAW);
 }

 public long getContentLength() {
 return 0;
 }

 public boolean endOfStream() {
 return ended;
 }

 public Object[] getControls() {
 return new Object[0];
 }

 public Object getControl(String type) {
 return null;
 }
 }
}
</output></height></width>



I am getting



Cannot create the DataSink: javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.BasicMux$BasicMuxDataSource@d7b1517
javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.BasicMux$BasicMuxDataSource@d7b1517
 at javax.media.Manager.createDataSink(Manager.java:1894)
 at com.ecomm.pl4mms.test.JpegImagesToMovie.createDataSink(JpegImagesToMovie.java:168)
 at com.ecomm.pl4mms.test.JpegImagesToMovie.doIt(JpegImagesToMovie.java:104)
 at com.ecomm.pl4mms.test.JpegImagesToMovie.main(JpegImagesToMovie.java:330)




Please help me to resolve this and let me what can be the cause of this



I am using java 1.8 and trying to create video with jpeg images and using



javax.media to perform this action. and i followed http://www.oracle.com/technetwork/java/javase/documentation/jpegimagestomovie-176885.html
to write the code


-
Evolution #3089 : Suppression des rubriques : informer des liens qui empêchent
11 août 2014, par Fil Upun message de neofutur qui dit quelque chose de similaire :
```
09:41(02:58) < neofutur>
http://forum.spip.net/fr_256464.html#forum258451
09:41(02:58) < neofutur> a priori des tas de gens ont ce probleme
09:41(03:00) < neofutur> empecher la suppression de la sous
rubrique vide parce qu elle a une photo associee en tant que
logo . . . ca meriterai une explication
09:41(05:04) < neofutur> peut etre avoir un bouton "supprimer" qyi
est inactif ( greyed ) avec un survol qui dit "supprimer d
abord le logo . . ."
```