
Recherche avancée
Autres articles (34)
-
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)
Sur d’autres sites (7519)
-
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 !
-
ffmpeg include issue - some functions are missing
9 septembre 2014, par ThomasI try to follow and adapt this example to convert a video thanks to FFMPEG but some function seems to be missing like :
int avcodec_open ( AVCodecContext * avctx, AVCodec * codec)
When I go in the doc to see where it come from, I find it in the file
libavcodec/avcodec.h
which is included in my program#include "libavcodec/avcodec.h"
(in the top of my.h
file).Given this, I don’t understand why Qt throw me this error :
../../Dev/Joker/libs/PhVideo/PhVideoEncoder.cpp:360:6: error: use of undeclared identifier 'avcodec_open'
if (avcodec_open(c, codec) < 0) { -
Encoding of video returns 0, and nothing written to the output file
14 juillet 2014, par AnilJI have written a code to record the webcam feed into a file on disk. I am attempting to do this using IContainer class rather than IMediaWriter class. I am pasting the code snippet below showing important sections of the code.
The problem I am facing is that nothing is being written to the file. Some of the observations I have made are as follows :
- In the Record() function, the ’while’ loop is kicked off, but the mVideoEncoder.encodeVideo(packet, frame, offset) ; method always returns zero (0). This results in no picture complete and no data is being written to the output file. Can you please provide clue as to what is missing ?
- I checked that the frame size is 80640, which confirms that frame has data.
- I see that only header and trailer is being written to the file.
Let me know if you need any other information.
public class WebcamRecorder {
private boolean StartVideoEncoder() {
boolean result = true;
// Open a container
mPositionInMicroseconds = 0;
mOutputContainer = IContainer.make();
mOutputContainer.open(mOutputFileName, IContainer.Type.WRITE, null);
// Create the video stream and get its coder
ICodec videoCodec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_H264);
IStream videoStream = mOutputContainer.addNewStream(videoCodec);
mVideoEncoder = videoStream.getStreamCoder();
// Setup the stream coder
mFrameRate = IRational.make(1, 30);
mVideoEncoder.setWidth(Constants.RESAMPLE_PICT_WIDTH);
mVideoEncoder.setHeight(Constants.RESAMPLE_PICT_HEIGHT);
mVideoEncoder.setFrameRate(mFrameRate);
mVideoEncoder.setTimeBase(IRational.make(mFrameRate.getDenominator(),
mFrameRate.getNumerator()));
mVideoEncoder.setBitRate(350000);
mVideoEncoder.setNumPicturesInGroupOfPictures(30);
mVideoEncoder.setPixelType(IPixelFormat.Type.YUV420P);
mVideoEncoder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, true);
mVideoEncoder.setGlobalQuality(0);
// Open the encoder
mVideoEncoder.open(null, null);
// Write the header
mOutputContainer.writeHeader();
return result;
}
public void Record() {
picture = GetNextPicture();
image = Utils.videoPictureToImage(picture);
// convert to the right image type
BufferedImage bgrScreen = ConvertToType(image, BufferedImage.TYPE_3BYTE_BGR);
IConverter converter = ConverterFactory.createConverter(bgrScreen, mVideoEncoder.getPixelType());
IVideoPicture frame = converter.toPicture(bgrScreen, mPositionInMicroseconds);
frame.setQuality(0);
IPacket packet = IPacket.make();
int offset = 0;
while (offset < frame.getSize()) {
int bytesEncoded = mVideoEncoder.encodeVideo(packet, frame, offset);
if (bytesEncoded < 0) {
throw new RuntimeException("Unable to encode video.");
}
offset += bytesEncoded;
if (packet.isComplete()) {
System.out.println("Packet is complete");
if (mOutputContainer.writePacket(packet) < 0) {
throw new RuntimeException(
"Could not write packet to container.");
}
// Update frame time
mPositionInMicroseconds += (mFrameRate.getDouble() * Math.pow(1000, 2));
break;
}
}
}
public void Cleanup() {
if (mOutputContainer != null) {
mOutputContainer.writeTrailer();
mOutputContainer.close();
// mOutputContainer.flushPackets();
}
if (mVideoEncoder != null) {
mVideoEncoder.close();
}
}
}