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-10-04 18:02:46 -05:00
|
|
|
// Create a clip
|
2012-10-05 01:58:27 -05:00
|
|
|
Clip c("/home/jonathan/Videos/big-buck-bunny_trailer.webm");
|
2012-10-04 18:02:46 -05:00
|
|
|
cout << "Position: " << c.Position() << endl;
|
|
|
|
|
cout << "Start: " << c.Start() << endl;
|
|
|
|
|
cout << "End: " << c.End() << endl;
|
|
|
|
|
|
2012-10-05 01:58:27 -05:00
|
|
|
return 0;
|
|
|
|
|
|
2012-08-31 15:19:17 -05:00
|
|
|
//openshot::ImageReader i("/home/jonathan/Apps/videcho_site/media/logos/watermark3.png");
|
|
|
|
|
//openshot::Frame* overlay = i.GetFrame(1);
|
|
|
|
|
//i.DisplayInfo();
|
2012-08-15 17:27:14 -05:00
|
|
|
|
2012-07-19 15:03:55 -05:00
|
|
|
// openshot::FFmpegReader r("../../src/examples/test.mp4");
|
|
|
|
|
// openshot::FFmpegReader r("../../src/examples/test1.mp4");
|
2012-08-15 17:27:14 -05:00
|
|
|
// openshot::FFmpegReader r("../../src/examples/piano.wav");
|
2012-08-12 02:14:15 -05:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Videos/big-buck-bunny_trailer.webm");
|
|
|
|
|
|
2012-08-31 15:19:17 -05:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Videos/sintel-1024-stereo.mp4");
|
2012-08-21 21:51:00 -05:00
|
|
|
// openshot::FFmpegReader r("/home/jonathan/Videos/OpenShot_Now_In_3d.mp4");
|
2012-08-31 15:19:17 -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-08-22 17:31:12 -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-10-04 18:02:46 -05:00
|
|
|
// // Create a writer
|
|
|
|
|
// FFmpegWriter w("/home/jonathan/output.webm");
|
|
|
|
|
// w.DisplayInfo();
|
|
|
|
|
//
|
|
|
|
|
// // Set options
|
|
|
|
|
// w.SetAudioOptions(true, "libvorbis", 44100, 2, 128000, false);
|
|
|
|
|
// w.SetVideoOptions(true, "libvpx", Fraction(24, 1), 640, 360, Fraction(1,1), false, false, 2000000);
|
|
|
|
|
//
|
|
|
|
|
// // Prepare Streams
|
|
|
|
|
// w.PrepareStreams();
|
|
|
|
|
//
|
|
|
|
|
// // Set Options
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "quality", "good");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "g", "120");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "qmin", "11");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "qmax", "51");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "profile", "0");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "speed", "0");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "level", "216");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "rc_lookahead", "16");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "rc_min_rate", "100000");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "rc_max_rate", "24000000");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "slices", "4");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "arnr_max_frames", "7");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "arnr_strength", "5");
|
|
|
|
|
//// w.SetOption(VIDEO_STREAM, "arnr_type", "3");
|
|
|
|
|
//
|
|
|
|
|
// // Write header
|
|
|
|
|
// w.WriteHeader();
|
|
|
|
|
//
|
|
|
|
|
// // Output stream info
|
|
|
|
|
// w.OutputStreamInfo();
|
|
|
|
|
//
|
|
|
|
|
// //Frame *f = r.GetFrame(1);
|
|
|
|
|
//
|
|
|
|
|
// for (int frame = 1; frame <= 1000; frame++)
|
|
|
|
|
// {
|
|
|
|
|
// Frame *f = r.GetFrame(frame);
|
|
|
|
|
// //f->AddOverlay(overlay);
|
|
|
|
|
//
|
|
|
|
|
// //if (f->number == 307 || f->number == 308 || f->number == 309 || f->number == 310)
|
|
|
|
|
// //f->DisplayWaveform();
|
|
|
|
|
//
|
|
|
|
|
// // Apply effect
|
|
|
|
|
// //f->AddEffect("flip");
|
|
|
|
|
//
|
|
|
|
|
// // Write frame
|
|
|
|
|
// cout << "queue frame " << frame << endl;
|
|
|
|
|
// w.WriteFrame(f);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // Write Footer
|
|
|
|
|
// w.WriteTrailer();
|
|
|
|
|
//
|
|
|
|
|
// // Close writer & reader
|
|
|
|
|
// w.Close();
|
2011-10-11 08:44:27 -05:00
|
|
|
r.Close();
|
2012-08-31 15:19:17 -05:00
|
|
|
//i.Close();
|
2011-10-11 08:44:27 -05:00
|
|
|
|
|
|
|
|
|
2012-07-19 15:03:55 -05:00
|
|
|
cout << "Successfully executed Main.cpp!" << endl;
|
2011-10-11 08:44:27 -05:00
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|