
Recherche avancée
Autres articles (97)
-
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 ;
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
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) (...)
Sur d’autres sites (5422)
-
Passing FileInputStream and FileOutputStream to ffmpeg to transcode(using JAVE-Java Audio Video Encoding)
17 février 2014, par Jagan SI am trying to transcode a *.mov file into a *.mp4 file using JAVE, which calls ffmpeg.
Both input file and output file are in InputStream and OutputStream forms.
That means I need to pass InputStream and OutputStream as -i and -y parematers for ffmpeg.
How do I do that ?//Read a movfile.mov converted into a FileInputStream
InputStream fileInputStream = getFileInputStream();
OutputStream fileOutputStream = new FileOutputStrea(outputMP4File) //Output
Process p = Runtime.exec("ffmpeg -i - -y -");
InputStream pInStrm = p.getInputStream();
OutputStream pOutStrm = p.getOutputStream();
int vin = 0, vout = 0;
Thread read = new Thread() {
byte[] buff = new byte[4096];
void run() {
while ((vin=fileInputStream.read(buf))!=-1) {
pOutStrm.write(buf, 0, vin);
}
}
}; read.start();
Thread write = new Thread() {
byte[] buff = new byte[4096];
void run() {
while ((vout=pInStrm.read(buf))!=-1) {
fileOutputStream.write(buf, 0, vout);
}
}
}; write.start();But I keep getting "IOException : pipe is closed" error. Could somebody help me out ?
Alternatively if there is any JAVA API that could do this transcoding(on Windows and RedHat Linux), that would be very helpfulThanks
-
Suppress output from popen()
18 février 2012, par Juan Gabriel Calderón-PérezIs there a way to suppress the output from
popen()
without losing the Wait().Test 1 :
FILE * stream = NULL;
char buffer [120];
stream = popen ("ffmpeg -y -i test.amr -ar 16000 test.wav -v quiet", "r");
while (fgets (buffer, sizeof(buffer), stream))
{
}
pclose (stream);Test 2 :
FILE * stream = NULL;
char buffer [120];
stream = popen ("ffmpeg -y -i test.amr -ar 16000 test.wav -v quiet &> /dev/null", "r");
while (fgets (buffer, sizeof(buffer), stream))
{
}
pclose (stream);The problem with Test 2 is that
pclose()
is not waiting for the pipe to finish processing. I don't want to have a bunch of FFMPEG output every time I have to do a pipe. -
reading video mpegts stream from stdin using libavformat libavcodec
1er février 2012, par D StarkweatherI'm trying to read video frames from stdin using ffmpeg's libav* lib collection. Simply passing "pipe:0" or "pipe :" as the filename to avformat_open_input_file() in my program does not do the trick. (e.g. cat /dev/video0 | ./myprogram OR ./myprogram < /dev/video0 ; it also fails using file.avi in place of /dev/video0).
Peeking into ffmpeg.c, I find the following bit of code using tcsetattr() to set the termios :
struct termios tty;
if (tcgetattr (0, &tty) == 0) {
oldtty = tty;
restore_tty = 1;
atexit(term_exit);
tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
|INLCR|IGNCR|ICRNL|IXON);
tty.c_oflag |= OPOST;
tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
tty.c_cflag &= ~(CSIZE|PARENB);
tty.c_cflag |= CS8;
tty.c_cc[VMIN] = 1;
tty.c_cc[VTIME] = 0;
tcsetattr (0, TCSANOW, &tty);
}
signal(SIGQUIT, sigterm_handler); /* Quit (POSIX). */
}
avformat_network_deinit();
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
signal(SIGXCPU, sigterm_handler);However, when I try this, it appears to have no effect. What settings do I need in the termios struct to continuously read video frames in ?
Currently, all i am able to do is call av_read_frames a few times (return code 0) before it usually either segfaults or hangs waiting. The buffer usually contains just a blank screen (all black). With any luck, the video buffer will contain the first video frame it comes across, but does not update to the later frames.
(I'm running this on Debian 6.0) Here's my version of ffmpeg :
ffmpeg version N-36936-g4cf81d9 Copyright (c) 2000-2012 the FFmpeg
developers built on Jan 19 2012 20:51:47 with gcc 4.4.5
configuration : —enable-shared —enable-gray —enable-hardcoded-tables
—enable-runtime-cpudetect —enable-libmp3lame —enable-libopenjpeg —enable-librtmp —enable-libtheora —enable-libvorbis —enable-libx264 —enable-libxvid —enable-zlib —enable-gpl libavutil 51. 34.101 / 51. 34.101 libavcodec 53. 57.100 /
53. 57.100 libavformat 53. 30.100 / 53. 30.100 libavdevice 53. 4.100 / 53. 4.100 libavfilter 2. 59.101 / 2. 59.101 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 6.100 /
0. 6.100 libpostproc 52. 0.100 / 52. 0.100 Hyper fast Audio and Video encoder usage : ffmpeg [options] [[infile options] -i
infile].Thank you very much for any help helpful tips. It is much appreciated.
D. Grant Starkweather