
Recherche avancée
Autres articles (111)
-
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...) -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Installation en mode standalone
4 février 2011, parL’installation de la distribution MediaSPIP se fait en plusieurs étapes : la récupération des fichiers nécessaires. À ce moment là deux méthodes sont possibles : en installant l’archive ZIP contenant l’ensemble de la distribution ; via SVN en récupérant les sources de chaque modules séparément ; la préconfiguration ; l’installation définitive ;
[mediaspip_zip]Installation de l’archive ZIP de MediaSPIP
Ce mode d’installation est la méthode la plus simple afin d’installer l’ensemble de la distribution (...)
Sur d’autres sites (8250)
-
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
-
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;
}
} -
MOOV atom is not being written to the output.
18 juillet 2014, par AnilJI am facing a problem where a MOOV atom is not written to the end of the file, and the file is not playable by the vlc player. Also, FFmpeg command gives me the following error.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2334ba0] moov atom not found
queueout/1000_wrecord.mp4: Invalid data found when processing inputIn my design, I am using an object of DataChunkQueue class to initialize the IContainer object, where it writes into this queue when it calls IContainer.WritePacket(packet) method. Finally when the recording is complete, I am flushing out this queue into a file. However, when I try to play the file, above error is thrown. When I test with the FLV file type however, I am able to playout the file correctly.
I am not sure what is the issue with the MP4 file and why it does not write the MOOV item to the end. Can anyone offer me an suggestions as to how this can be resolved ?
I am pasting below some of the code snippets for reference.
public class DataChunkQueue implements ByteChannel {
private ConcurrentLinkedQueue<datachunk> mChunkQueue = null;
private static String BASE_PATH = null;
private static String mOutputFileName = null;
private FileChannel mOutputFileChannel = null;
// constructor
public DataChunkQueue() {
mChunkQueue = new ConcurrentLinkedQueue<datachunk>();
}
@Override
public void close() throws IOException {
return;
}
@Override
public boolean isOpen() {
return true;
}
@Override
public int write(ByteBuffer buffer) throws IOException {
DataChunk vChunk = new DataChunk(buffer);
mChunkQueue.add(vChunk);
return 0;
}
public int read(ByteBuffer buffer) throws IOException {
int result = 0;
buffer = mChunkQueue.poll().GetBuffer();
if (buffer != null ) {
result = 0;
} else {
result = 1;
}
return result;
}
}
private boolean InitStreamEncoder() {
DataChunkQueue mOutQueue = null;
// Change this to change the frame rate you record at
mFrameRate = IRational.make(Constants.FRAME_RATE, 1);
// try opening a container format
mOutFormat = IContainerFormat.make();
mOutFormat.setOutputFormat(mRecordFormat, null, null);
// Initialize the output container.
mOutputContainer = IContainer.make();
int retval = mOutputContainer.open(mOutQueue, IContainer.Type.WRITE, mOutFormat);
if (retval < 0)
throw new RuntimeException("could not open data output stream buffer");
// Guess the Encoding CODEC based on the type of input file.
ICodec videoCodec = ICodec.guessEncodingCodec(null, null, ("out." + mRecordFormat), null, ICodec.Type.CODEC_TYPE_VIDEO);
if (videoCodec == null)
throw new RuntimeException("could not guess a codec");
// Initialize the encoding parameters.
mOutStream = mOutputContainer.addNewStream(videoCodec);
mOutStreamCoder = mOutStream.getStreamCoder();
mOutStreamCoder.setNumPicturesInGroupOfPictures(Constants.GOP);
mOutStreamCoder.setCodec(videoCodec);
//mOutStreamCoder.setBitRate(Constants.BITRATE);
//mOutStreamCoder.setBitRateTolerance(Constants.TOLERANCE);
mOutStreamCoder.setPixelType(IPixelFormat.Type.YUV420P);
mOutStreamCoder.setWidth(Constants.MAIN_SCREEN_WIDTH);
mOutStreamCoder.setHeight(Constants.MAIN_SCREEN_HEIGHT);
//mOutStreamCoder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, true);
//mOutStreamCoder.setGlobalQuality(0);
mOutStreamCoder.setFrameRate(mFrameRate);
mOutStreamCoder.setTimeBase(IRational.make(mFrameRate.getDenominator(), mFrameRate.getNumerator()));
retval = mOutStreamCoder.open(null, null);
if (retval < 0) {
System.out.println("could not open input decoder");
return false;
}
retval = mOutputContainer.writeHeader();
if (retval < 0) {
System.out.println("could not write file header");
return false;
}
return true;
}
</datachunk></datachunk>This function is called at the very end to write the trailer.
public void Cleanup() {
if (mOutputContainer != null) {
mOutputContainer.flushPackets();
mOutputContainer.writeTrailer();
mOutputContainer.close();
}
if (mOutStreamCoder != null) {
mOutStreamCoder.close();
mOutStreamCoder = null;
}
}