
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (101)
-
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 -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.
Sur d’autres sites (15917)
-
How to live stream an mp4 video in android from server - only works in KitKat ?
15 octobre 2014, par user3522608How to stream an MP4 video in Android from a server ? Here is my code but it only works for KitKat.
private void play() {
try {
final String path = ""
Log.v(TAG, "path: " + path);
if (path == null || path.length() == 0) {
Toast.makeText(getApplicationContext(), "File URL/path is empty",
Toast.LENGTH_LONG).show();
} else {
// If the path has not changed, just start the media player
if (path.equals(current) && mVideoView != null) {
mVideoView.start();
mVideoView.requestFocus();
return;
}
current = path;
mVideoView.setVideoPath(getDataSource(path));
mVideoView.start();
mVideoView.requestFocus();
}
} catch (Exception e) {
Log.e(TAG, "error: " + e.getMessage(), e);
if (mVideoView != null) {
mVideoView.stopPlayback();
}
}
}
private String getDataSource(String path) throws IOException {
if (!URLUtil.isNetworkUrl(path)) {
return path;
} else {
URL url = new URL(path);
URLConnection cn = url.openConnection();
cn.connect();
InputStream stream = cn.getInputStream();
if (stream == null)
throw new RuntimeException("stream is null");
File temp = File.createTempFile("mediaplayertmp", "dat");
temp.deleteOnExit();
String tempPath = temp.getAbsolutePath();
FileOutputStream out = new FileOutputStream(temp);
byte buf[] = new byte[256];
do {
int numread = stream.read(buf);
if (numread <= 0)
break;
out.write(buf, 0, numread);
} while (true);
try {
stream.close();
} catch (IOException ex) {
Log.e(TAG, "error: " + ex.getMessage(), ex);
}
return tempPath;
}
} -
Issue while opening a .mp4 file - CPU shoots up 100%
16 juillet 2014, par AnilJI am using IMediaWriter, to write out about 20 video frames into an independent .mp4 file and creating a new writer to write a new file. This is a logic (not so efficient one), I’ve used to chunk the web-cam feed into chunks. I am able to successfully able to create multiple .mp4 video files and when opened then in a VLC player, they can be played back.
However, when I try to open one of the chunked file into a new IContainer object (see below code snippet), my program :
- Gets stuck at the container.open() call ( see * below), and the CPU
utilization shoots above 100%. - Sometimes it throws an error "moov atom not found", and hence can not open the file.
In both the cases, my program does not work.
<code snippet="snippet">
String file = BASE_PATH + File.separator + "output" + File.separator + "output.mp4"; // This is one of the chunk.
IContainer container = IContainer.make();
FileChannel channel = null;
try {
@SuppressWarnings("resource")
RandomAccessFile inFile = new RandomAccessFile(chunkFile, "r");
channel = inFile.getChannel();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
// Open up the container
*** int retval = container.open(channel, IContainer.Type.READ, null);
if (retval < 0) {
// This little trick converts the non friendly integer return value into
// a slightly more friendly object to get a human-readable error name
IError error = IError.make(retval);
throw new IllegalArgumentException("could not open file: " + mInputFileChannel + "; Error: " + error.getDescription());
}
<code snippet="snippet">Subsequently, I ran the AtomicParsley tool to dump the file content, and it prints following. I am not aware of video file internals and seeking help to know the issue here and potential solution.
Atom ftyp @ 0 of size: 28, ends @ 28
Atom free @ 28 of size: 8, ends @ 36
Atom mdat @ 36 of size: 45175, ends @ 45211
Atom moov @ 45211 of size: 1052, ends @ 46263
Atom mvhd @ 45219 of size: 108, ends @ 45327
Atom trak @ 45327 of size: 839, ends @ 46166
Atom tkhd @ 45335 of size: 92, ends @ 45427
Atom edts @ 45427 of size: 36, ends @ 45463
Atom elst @ 45435 of size: 28, ends @ 45463
Atom mdia @ 45463 of size: 703, ends @ 46166
Atom mdhd @ 45471 of size: 32, ends @ 45503
Atom hdlr @ 45503 of size: 45, ends @ 45548
Atom minf @ 45548 of size: 618, ends @ 46166
Atom vmhd @ 45556 of size: 20, ends @ 45576
Atom dinf @ 45576 of size: 36, ends @ 45612
Atom dref @ 45584 of size: 28, ends @ 45612
Atom url @ 45600 of size: 12, ends @ 45612
Atom stbl @ 45612 of size: 554, ends @ 46166
Atom stsd @ 45620 of size: 198, ends @ 45818
Atom mp4v @ 45636 of size: 182, ends @ 45818
Atom esds @ 45722 of size: 96, ends @ 45818
Atom stts @ 45818 of size: 176, ends @ 45994
Atom stss @ 45994 of size: 24, ends @ 46018
Atom stsc @ 46018 of size: 28, ends @ 46046
Atom stsz @ 46046 of size: 100, ends @ 46146
Atom stco @ 46146 of size: 20, ends @ 46166
Atom udta @ 46166 of size: 97, ends @ 46263
Atom meta @ 46174 of size: 89, ends @ 46263
Atom hdlr @ 46186 of size: 33, ends @ 46219
Atom ilst @ 46219 of size: 44, ends @ 46263
Atom ©too @ 46227 of size: 36, ends @ 46263
Atom data @ 46235 of size: 28, ends @ 46263
------------------------------------------------------
Total size: 46263 bytes; 31 atoms total. AtomicParsley from svn built on Jul 15 2014 (utf8)
Media data: 45175 bytes; 1088 bytes all other atoms (2.352% atom overhead).
Total free atom space: 8 bytes; 0.017% waste.
------------------------------------------------------I am not sure if there is anything wrong with the file itself. Can you please help me understand this ?
- Gets stuck at the container.open() call ( see * below), and the CPU
-
Problem with FFMPEG and PHP
10 septembre 2014, par ziritrionI know this isn’t exactly a programming question per se, but rather a settings question, but still :
I’m trying to convert video with FFMPEG with a PHP script, following this tutorial :
http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/
FFMPEG works perfectly and I’ve used it from the command line a number of times. PHP also seems to work fine. I’ve also installed ffmpeg-php and it seems to be loading file.
The problem lies when I try to do the following in PHP :
$srcFile = "p1.avi" ;
$ffmpegObj = new ffmpeg_movie($srcFile) ;
No matter what, PHP will return this :
Warning : can’t open movie file p1.avi in /var/www/converter.php on line xx
Obviously, whatever call I do afterwards with $ffmpegObj will throw a fatal error. I’m absolutely stuck and extensive googling hasn’t helped much.
If you must know, I’m using Ubuntu 9.04 with the default LAMP server packages as well as php5-ffmpeg, and I’ve compiled ffmpeg following a tutorial I found on Ubuntuforums (I’d link to it but stackoverflow won’t let me)
Thanks !