
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 (69)
-
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...) -
Activation de l’inscription des visiteurs
12 avril 2011, parIl est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...) -
ANNEXE : Les extensions, plugins SPIP des canaux
11 février 2010, parUn plugin est un ajout fonctionnel au noyau principal de SPIP. MediaSPIP consiste en un choix délibéré de plugins existant ou pas auparavant dans la communauté SPIP, qui ont pour certains nécessité soit leur création de A à Z, soit des ajouts de fonctionnalités.
Les extensions que MediaSPIP nécessite pour fonctionner
Depuis la version 2.1.0, SPIP permet d’ajouter des plugins dans le répertoire extensions/.
Les "extensions" ne sont ni plus ni moins que des plugins dont la particularité est qu’ils se (...)
Sur d’autres sites (5633)
-
stout to textarea from ffmpeg command
21 septembre 2014, par BrettHi im trying to get the output of a ffmpeg command into a text level here is my code i am posting the lot as im brand new to java and am not sure where ive gone wrong i want to run the command and have the progress bar update and the output to show on a text area.
any help would appreciatedpackage MyPackage;
import java.util.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author brett
*/
public class NumberAdditionUI extends javax.swing.JFrame {
private static final long serialVersionUID = 1L;
/**
* Creates new form NumberAdditionUI
*/
public NumberAdditionUI() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
//
private void initComponents() {
db = new javax.swing.JFileChooser();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField();
jButton3 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jProgressBar1 = new javax.swing.JProgressBar();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
db.setBackground(java.awt.Color.white);
db.setCurrentDirectory(new java.io.File("C:\\Users\\brett\\Documents\\convert"));
db.setDialogTitle("grabAFile");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Smoke Goobies");
setMaximumSize(getPreferredSize());
jButton1.setText("Exit");
jButton1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Browse");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jTextField1.setText("Select A File To Covert");
jButton3.setText("Run This Puppy");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jLabel1.setFont(new java.awt.Font("Goudy Old Style", 1, 56)); // NOI18N
jLabel1.setIcon(jLabel1.getIcon());
jLabel1.setText(" MASHiTuP");
jProgressBar1.setValue(50);
jProgressBar1.setBorder(new javax.swing.border.MatteBorder(null));
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jTextArea1.setAutoscrolls(false);
jScrollPane1.setViewportView(jTextArea1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 282, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jButton3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1)))
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jScrollPane1))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton2)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(34, 34, 34)
.addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 48, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton3))
.addContainerGap())
);
jProgressBar1.getAccessibleContext().setAccessibleName("MYsTATUS");
pack();
}//
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
int returnVal = db.showOpenDialog( this );
File f = db.getSelectedFile();
String filename = f.getAbsolutePath();
jTextField1.setText(filename);
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
java.lang.Runtime rt = java.lang.Runtime.getRuntime();
java.lang.Process proc = null;
try {
proc = rt.exec("ipconfig");
//proc = rt.exec("ffmpeg -i C:\\Users\\brett\\Documents\\MASH_02.avi C:\\Users\\brett\\Documents\\mash09.avi");
} catch (IOException ex) {
Logger.getLogger(NumberAdditionUI.class.getName()).log(Level.SEVERE, null, ex);
}
BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
// read the output from the command
System.out.println("Here is the standard output of the command:\n");
String s;
try {
while ((s = stdInput.readLine()) != null) {
System.out.println(s);
jTextArea1.append(s+"\n\n");
}
} catch (IOException ex) {
Logger.getLogger(NumberAdditionUI.class.getName()).log(Level.SEVERE, null, ex);
}
// read any errors from the attempted command
System.out.println("Here is the standard error of the command (if any):\n");
try {
while ((s = stdError.readLine()) != null) {
System.out.println(s);
}
} catch (IOException ex) {
Logger.getLogger(NumberAdditionUI.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
*
* @param args the command line arguments
*/
public static void main(String args[])
{
/*
* Set the Nimbus look and feel
*/
//
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(NumberAdditionUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//
/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new NumberAdditionUI().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JFileChooser db;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;
private javax.swing.JProgressBar jProgressBar1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField1;
// End of variables declaration
} -
ffmpeg 1FPS extraction call spits out infinite images until disk is bricked on poorly-encoded movie
12 juillet 2017, par John AllardThis is one of the oddest things I’ve ever seen while using ffmpeg.
This is the scenario - we are getting video footage from a IONODE ION-E100 encoder, the footage is encoded in h264. I can view the footage fine in VLC, and I can copy it over to another video using
ffmpeg
and-c:v copy
. The issue arises when I try and extract one FPS from the movie using the following command :ffmpeg -i testmovie.mp4 -r 1 -vf 640:-2 -q:v 18 -loglevel error /tmp/tmp/extraction_%04d.jpeg
What this should do is go through the movie and extract one frame per second, then dump the frames to the files
/tmp/tmp/extraction_0001.jpeg, /tmp/tmp/extraction_0002.jpeg, ..., /tmp/tmp/extraction_000X.jpeg
. It should end when it reaches the end of the video.Now the odd thing that happens when I run this command is that it will run in a tight loop, writing tens or hundreds of thousands of images to the disk until the disk is full at which point the command fails. All of the extracted images are the exact same as one another.
Here is the ffmpeg stats output on the video
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/john/ionode/test2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : /videoinput_1:0/h264_1/media.stm
encoder : Lavf57.56.100
Duration: 00:00:16.52, start: -9791.427750, bitrate: 2165 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 2119 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 236 kb/s (default)
Metadata:
handler_name : SoundHandler(notice the
start: -9791.427750
value, what is this ?)Here are the encoding details on the footage :
{
"programs": [
],
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_time_base": "1/50",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1920,
"height": 1080,
"coded_width": 1920,
"coded_height": 1080,
"has_b_frames": 2,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": 40,
"chroma_location": "left",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"r_frame_rate": "25/1",
"avg_frame_rate": "25/1",
"time_base": "1/12800",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 211456,
"duration": "16.520000",
"bit_rate": "2119813",
"bits_per_raw_sample": "8",
"nb_frames": "413",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler"
}
}
]
}Here a link to the sample video to use : http://s000.tinyupload.com/?file_id=03169189167771012515
(it’s a 5MB video file)The only clues I have as to what is actually going on is the error output
from the command that grabs the video from the encoder :[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823640, current: -630275919; changing to -629823639. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823639, current: -630274895; changing to -629823638. This may result in incorrect timestamps in the output file.
frame= 124 fps= 21 q=28.0 size= 41kB time=00:00:02.60 bitrate= 128.8kbits/s dup=26 drop=4 spee[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823638, current: -630273871; changing to -629823637. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823637, current: -630272847; changing to -629823636. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823636, current: -630271824; changing to -629823635. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823635, current: -630270800; changing to -629823634. This may result in incorrect timestamps in the output file.
frame= 124 fps= 19 q=28.0 size= 43kB time=00:00:02.60 bitrate= 137.0kbits/s dup=26 drop=4 spee[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823634, current: -630269776; changing to -629823633. This may result in incorrect timestamps in the output file.
[aac @ 0x7faa1a832000] Queue input is backward in time
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823633, current: -630268752; changing to -629823632. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823632, current: -630267728; changing to -629823631. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823631, current: -630513833; changing to -629823630. This may result in incorrect timestamps in the output file.
frame= 124 fps= 18 q=28.0 size= 46kB time=00:00:02.60 bitrate= 145.4kbits/s dup=26 drop=4 spee[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823630, current: -630512810; changing to -629823629. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823629, current: -630511786; changing to -629823628. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823628, current: -630510762; changing to -629823627. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823627, current: -630509738; changing to -629823626. This may result in incorrect timestamps in the output file.
frame= 124 fps= 17 q=28.0 size= 49kB time=00:00:02.60 bitrate= 153.6kbits/s dup=26 drop=4 spee[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823626, current: -630508714; changing to -629823625. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823625, current: -630507690; changing to -629823624. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823624, current: -630506667; changing to -629823623. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823623, current: -630505643; changing to -629823622. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823622, current: -630504619; changing to -629823621. This may result in incorrect timestamps in the output file.
frame= 124 fps= 16 q=28.0 size= 52kB time=00:00:02.60 bitrate= 163.5kbits/s dup=26 drop=4 spee[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823621, current: -630503595; changing to -629823620. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823620, current: -630502571; changing to -629823619. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823619, current: -630501548; changing to -629823618. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823618, current: -630500524; changing to -629823617. This may result in incorrect timestamps in the output file.
frame= 124 fps= 15 q=28.0 size= 54kB time=00:00:02.60 bitrate= 171.4kbits/s dup=26 drop=4 spee[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823617, current: -630499500; changing to -629823616. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823616, current: -630498476; changing to -629823615. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823615, current: -630497452; changing to -629823614. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823614, current: -630496428; changing to -629823613. This may result in incorrect timestamps in the output file.
frame= 124 fps= 14 q=28.0 size= 57kB time=00:00:02.60 bitrate= 179.3kbits/s dup=26 drop=4 spee[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823613, current: -630495405; changing to -629823612. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823612, current: -630494381; changing to -629823611. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823611, current: -630493357; changing to -629823610. This may result in incorrect timestamps in the output file.
frame= 124 fps= 13 q=28.0 size= 59kB time=00:00:02.60 bitrate= 185.6kbits/s dup=26 drop=4 spee[aac @ 0x7faa1a832000] Queue input is backward in time
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823610, current: -630492333; changing to -629823609. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823609, current: -630491309; changing to -629823608. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823608, current: -630736398; changing to -629823607. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823607, current: -630735375; changing to -629823606. This may result in incorrect timestamps in the output file.
frame= 124 fps= 12 q=28.0 size= 61kB time=00:00:02.60 bitrate= 193.5kbits/s dup=26 drop=4 spee[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823606, current: -630734351; changing to -629823605. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823605, current: -630733327; changing to -629823604. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823604, current: -630732303; changing to -629823603. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823603, current: -630731279; changing to -629823602. This may result in incorrect timestamps in the output file.
[mp4 @ 0x7faa1a83ba00] Non-monotonous DTS in output stream 0:1; previous: -629823602, current: -630730256; changing to -629823601. This may result in incorrect timestamps in the output file.
frame= 124 fps= 12 q=-1.0 Lsize= 507kB time=00:00:04.84 bitrate= 858.7kbits/s dup=26 drop=4 speed=0.453xSo my question is, why does this video break ffmpeg ? Why does ffmpeg get caught up in a tight loop extracting images without ever making any progres towards the end of the video ?
-
When generating a video from images and adding audio the video isn't playable
1er août 2017, par randommmanSo I have a bunch of images in a folder, with the following structure :
image-0.png
image-1.png
image-2.pngSometimes the folder can have just 1 image which will be saved as :
image-0.png
My code to generate the video and to add the audio
// create the file
using (WaveFileReader wf = new WaveFileReader(Audio))
{
// the files
OldVideo = "old.avi";
NewVideo = "video.avi";
Audio = "sound.wav";
// Get the time of the audio and divide by images
time = wf.TotalTime.TotalSeconds;
mimtime = time / imagescount;
ffmpegPath = "ffmpeg.exe";
ffmpegParams = " -r 1/" + mimtime + " -i " + ImagesFolder + "image-%d.png -t " + time + " -y -vf scale=1280:-2 " + OldVideo;
ffmaudioParams = " -i " + OldVideo + " -i " + Audio + " -c copy -shortest " + NewVideo;
}
using (Process ffmpeg = new Process())
{
//Generate video
ffmpegstartInfo = new ProcessStartInfo();
ffmpegstartInfo.FileName = ffmpegPath;
ffmpegstartInfo.Arguments = ffmpegParams;
ffmpegstartInfo.RedirectStandardOutput = true;
ffmpegstartInfo.RedirectStandardError = true;
ffmpegstartInfo.UseShellExecute = false;
ffmpegstartInfo.CreateNoWindow = true;
ffmpeg.StartInfo.FileName = ffmpegPath;
ffmpeg.StartInfo.Arguments = ffmpegParams;
ffmpeg.StartInfo = ffmpegstartInfo;
ffmpeg.Start();
ffmpeg.WaitForExit(30000);
/*ffmpeg.StartInfo.FileName = "cmd.exe";
ffmpeg.StartInfo.Arguments = "/k " + ffmpegPath + " " + ffmpegParams;
ffmpeg.Start();
ffmpeg.WaitForExit(30000);*/
}
using (Process ffmaudio = new Process())
{
//Add audio to video
ffmaudiostartInfo = new ProcessStartInfo();
ffmaudiostartInfo.FileName = ffmpegPath;
ffmaudiostartInfo.Arguments = ffmaudioParams;
ffmaudiostartInfo.RedirectStandardOutput = true;
ffmaudiostartInfo.RedirectStandardError = true;
ffmaudiostartInfo.UseShellExecute = false;
ffmaudiostartInfo.CreateNoWindow = true;
ffmaudio.StartInfo.FileName = ffmpegPath;
ffmaudio.StartInfo.Arguments = ffmaudioParams;
ffmaudio.StartInfo = ffmaudiostartInfo;
ffmaudio.Start();
ffmaudio.WaitForExit(30000);
/*ffmaudio.StartInfo.FileName = "cmd.exe";
ffmaudio.StartInfo.Arguments = "/k " + ffmpegPath + " " + ffmaudioParams;
ffmaudio.Start();
ffmaudio.WaitForExit(30000);*/
}So, what my code does, with the
wavfilereader
it gets the total length of my audio file, and then splits that time up by the number of images I have, so I can generate a video with the images split equally. Then I generate the video to a file called ’old.avi’, which is then used with my wav file to generate a new file called video.avi (which I am trying to have the generated video and audio together)My problem is when I generate the video it becomes uplayable. It claims to be (for example) 1 minute 50 seconds long, but once I click it, it won’t play. It just becomes unplayable, as you can see below
http://i.imgur.com/tsck2NX.gifv
I am using C# with process and Winforms, which opens the cmd line to run ffmpeg, with the 2 commands called above with the named variables below :
ffmpegParams;
ffmaudioParams;Which has all the commands I am using
-r 1/ (audio length /divided by total images) so they're equal
-t (to limit to the total time which is the audio's total seconds)
... I am using more as you can see in my code aboveHow can I fix my problem, that I have described ?
CMD line when generating the video :
ffmpeg version N-86848-g03a9e6f Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 68.100 / 55. 68.100
libavcodec 57.102.100 / 57.102.100
libavformat 57. 76.100 / 57. 76.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 95.100 / 6. 95.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, image2, from 'C:\Users\Laptop\Documents\program/images/image-%d.png':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgba(pc), 800x800, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[mpeg4 @ 00000000024f44a0] bitrate tolerance 4000000 too small for bitrate 200000, overriding
Output #0, avi, to 'C:\Users\Laptop\Documents\program/old.avi':
Metadata:
ISFT : Lavf57.76.100
Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x1280, q=2-31, 200 kb/s, 0.01 fps, 0.01 tbn, 0.01 tbc
Metadata:
encoder : Lavc57.102.100 mpeg4
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 1 fps=0.0 q=6.8 Lsize= 46kB time=00:01:37.57 bitrate= 3.9kbits/s speed=1.43e+003x
video:41kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 13.641467%When adding the audio to the video
ffmpeg version N-86848-g03a9e6f Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 68.100 / 55. 68.100
libavcodec 57.102.100 / 57.102.100
libavformat 57. 76.100 / 57. 76.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 95.100 / 6. 95.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, avi, from 'C:\Users\Laptop\Documents\program/old.avi':
Metadata:
encoder : Lavf57.76.100
Duration: 00:01:37.58, start: 0.000000, bitrate: 3 kb/s
Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 1280x1280 [SAR 1:1 DAR 1:1], 0.01 fps, 0.01 tbr, 0.01 tbn, 40 tbc
Guessed Channel Layout for Input Stream #1.0 : mono
Input #1, wav, from 'C:\Users\Laptop\Documents\program/audio.wav':
Duration: 00:01:37.57, bitrate: 352 kb/s
Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s
Output #0, avi, to 'C:\Users\Laptop\Documents\program/video.avi':
Metadata:
ISFT : Lavf57.76.100
Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 1280x1280 [SAR 1:1 DAR 1:1], q=2-31, 0.01 fps, 0.01 tbr, 0.01 tbn, 0.01 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=-1.0 Lsize= 55kB time=00:01:37.57 bitrate= 4.6kbits/s speed=1.95e+005x
video:41kB audio:4kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 21.946869%