2011-10-11 08:44:27 -05:00
|
|
|
|
2012-07-19 15:03:55 -05:00
|
|
|
#include <fstream>
|
2011-10-11 08:44:27 -05:00
|
|
|
#include <iostream>
|
|
|
|
|
#include <map>
|
|
|
|
|
#include <queue>
|
|
|
|
|
#include "../include/OpenShot.h"
|
|
|
|
|
|
|
|
|
|
using namespace openshot;
|
|
|
|
|
|
|
|
|
|
void FrameReady(int number)
|
|
|
|
|
{
|
|
|
|
|
cout << "Frame #: " << number << " is ready!" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
2012-07-19 15:03:55 -05:00
|
|
|
// openshot::FFmpegReader r("../../src/examples/test.mp4");
|
|
|
|
|
// openshot::FFmpegReader r("../../src/examples/test1.mp4");
|
|
|
|
|
openshot::FFmpegReader r("../../src/examples/piano.wav");
|
2012-07-09 15:18:24 -05:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Videos/sintel-1024-stereo.mp4");
|
2012-06-17 23:15:47 -05:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Videos/00001.mts");
|
2012-07-07 00:58:05 -05:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Videos/sintel_trailer-720p.mp4");
|
2011-12-11 20:42:50 -06:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Aptana Studio Workspace/OpenShotLibrary/src/examples/piano.wav");
|
2012-07-08 23:26:44 -05:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Music/Army of Lovers/Crucified/Army of Lovers - Crucified [Single Version].mp3");
|
2012-02-26 16:45:50 -06:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Documents/OpenShot Art/test.jpeg");
|
2011-10-27 11:27:44 -05:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Videos/60fps.mp4");
|
2011-10-11 08:44:27 -05:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Aptana Studio Workspace/OpenShotLibrary/src/examples/asdf.wdf");
|
|
|
|
|
|
|
|
|
|
// Display debug info
|
|
|
|
|
r.DisplayInfo();
|
|
|
|
|
|
2012-07-19 15:03:55 -05:00
|
|
|
// Create a writer
|
2012-07-20 00:13:16 -05:00
|
|
|
FFmpegWriter w("/home/jonathan/output.flac");
|
2012-07-19 15:03:55 -05:00
|
|
|
w.DisplayInfo();
|
2012-07-03 16:58:07 -05:00
|
|
|
|
2012-07-19 15:03:55 -05:00
|
|
|
// Set options
|
2012-07-20 00:13:16 -05:00
|
|
|
w.SetAudioOptions(true, "flac", 44100, 2, 64000);
|
2012-07-19 15:03:55 -05:00
|
|
|
|
|
|
|
|
// Write header
|
|
|
|
|
w.WriteHeader();
|
|
|
|
|
|
|
|
|
|
for (int frame = 1; frame <= 10; frame++)
|
|
|
|
|
{
|
|
|
|
|
Frame f = r.GetFrame(frame);
|
|
|
|
|
|
|
|
|
|
// Write frame
|
|
|
|
|
cout << "Write frame " << f.number << endl;
|
|
|
|
|
w.WriteFrame(&f);
|
2011-10-25 00:20:26 -05:00
|
|
|
}
|
2011-10-14 09:47:05 -05:00
|
|
|
|
2012-07-19 15:03:55 -05:00
|
|
|
// Write Footer
|
|
|
|
|
w.WriteTrailer();
|
2011-10-11 08:44:27 -05:00
|
|
|
|
2012-07-19 15:03:55 -05:00
|
|
|
// Close writer & reader
|
|
|
|
|
w.Close();
|
2011-10-11 08:44:27 -05:00
|
|
|
r.Close();
|
|
|
|
|
|
|
|
|
|
|
2012-07-19 15:03:55 -05:00
|
|
|
cout << "Successfully executed Main.cpp!" << endl;
|
2011-10-11 08:44:27 -05:00
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|