Many Windows related fixes and tweaks. Also fixed some issues with newer versions of CMake and Swig files.

This commit is contained in:
Jonathan Thomas
2015-08-24 23:49:45 -05:00
parent bfa050409c
commit fbc719b11f
7 changed files with 84 additions and 56 deletions

View File

@@ -38,29 +38,41 @@ int main(int argc, char* argv[])
{
// Create a reader
Clip clip_video("/home/jonathan/apps/libopenshot-git/src/examples/test.mp4");
string path = "C:\\Users\\Jonathan\\Apps\\libopenshot\\src\\examples\\sintel_trailer-720p.mp4";
cout << path << endl;
Clip clip_video("C:\\Users\\Jonathan\\Apps\\libopenshot\\src\\examples\\sintel_trailer-720p.mp4");
clip_video.Layer(0);
clip_video.Position(0.0);
Clip clip_overlay("/home/jonathan/apps/libopenshot-git/src/examples/front3.png");
clip_overlay.Layer(1);
//clip_overlay.Position(0.05); // Delay the overlay by 0.05 seconds
clip_overlay.End(0.5); // Make the duration of the overlay 1/2 second
//// Clip clip_overlay("/home/jonathan/apps/libopenshot-git/src/examples/front3.png");
//// clip_overlay.Layer(1);
//// //clip_overlay.Position(0.05); // Delay the overlay by 0.05 seconds
//// clip_overlay.End(0.5); // Make the duration of the overlay 1/2 second
//
// Create a timeline
Timeline t(640, 480, Fraction(30, 1), 44100, 2, LAYOUT_STEREO);
// Add clips
t.AddClip(&clip_video);
t.AddClip(&clip_overlay);
Timeline r9(640, 480, Fraction(30, 1), 44100, 2, LAYOUT_STEREO);
r9.debug = false;
//
// // Add clips
r9.AddClip(&clip_video);
// //t.AddClip(&clip_overlay);
// Open Timeline
t.Open();
r9.Open();
t.GetFrame(2)->Display();
return 0;
// cout << " --> 1" << endl;
// t.GetFrame(1);
// cout << " --> 500" << endl;
// t.GetFrame(500);
// cout << "1034" << endl;
// t.GetFrame(1034);
// cout << "1" << endl;
// t.GetFrame(1);
// cout << "1200" << endl;
// t.GetFrame(1200);
//
//
// return 0;
//
// FFmpegReader r110("/home/jonathan/Videos/PlaysTV/Team Fortress 2/2015_07_06_22_43_16-ses.mp4");
// r110.Open();
@@ -109,8 +121,6 @@ int main(int argc, char* argv[])
// t110.GetFrame(y);
// }
return 0;
// FrameMapper m110(&r110, Fraction(24,1), PULLDOWN_NONE, 22050, 2, LAYOUT_STEREO);
// m110.Open();
//
@@ -164,9 +174,9 @@ int main(int argc, char* argv[])
// //t10.AddClip(&c20);
// t10.Open();
FFmpegReader r9("/home/jonathan/Videos/sintel_trailer-720p.mp4");
r9.Open();
r9.DisplayInfo();
// FFmpegReader r9("/home/jonathan/Videos/sintel_trailer-720p.mp4");
// r9.Open();
// r9.DisplayInfo();
// Mapper
@@ -176,16 +186,16 @@ int main(int argc, char* argv[])
//map.Open();
/* WRITER ---------------- */
FFmpegWriter w9("/home/jonathan/output-pops.webm");
w9.debug = false;
FFmpegWriter w9("C:\\Users\\Jonathan\\test-output.webm");
w9.debug = true;
//ImageWriter w9("/home/jonathan/output.gif");
// Set options
//w9.SetVideoOptions(true, "libx264", r9.info.fps, 1024, 576, Fraction(1,1), false, false, 1000000);
//w9.SetVideoOptions(true, "mpeg4", r9.info.fps, r9.info.width, r9.info.height, Fraction(1,1), false, false, 1000000);
//w9.SetAudioOptions(true, "mp2", r9.info.sample_rate, r9.info.channels, r9.info.channel_layout, 64000);
w9.SetAudioOptions(true, "libvorbis", r9.info.sample_rate, r9.info.channels, r9.info.channel_layout, 128000);
w9.SetVideoOptions(true, "libvpx", r9.info.fps, 1024, 576, Fraction(1,1), false, false, 3000000);
//w9.SetAudioOptions(true, "libmp3lame", 22050, t10.info.channels, t10.info.channel_layout, 120000);
w9.SetVideoOptions(true, "libvpx", r9.info.fps, r9.info.width, r9.info.height, Fraction(1,1), false, false, 3000000);
//w9.SetAudioOptions(true, "libmp3lame", 22050, r9.info.channels, r9.info.channel_layout, 120000);
//w9.SetVideoOptions(true, "libx264", t10.info.fps, t10.info.width, t10.info.height, t10.info.pixel_ratio, false, false, 1500000);
//w9.SetVideoOptions(true, "rawvideo", r9.info.fps, 400, 2, r9.info.pixel_ratio, false, false, 20000000);
//w9.SetVideoOptions("GIF", r9.info.fps, r9.info.width, r9.info.height, 70, 1, true);
@@ -194,23 +204,23 @@ int main(int argc, char* argv[])
w9.Open();
// Prepare Streams
//w9.PrepareStreams();
w9.PrepareStreams();
// w9.SetOption(VIDEO_STREAM, "qmin", "2" );
// w9.SetOption(VIDEO_STREAM, "qmax", "30" );
// w9.SetOption(VIDEO_STREAM, "crf", "10" );
w9.SetOption(VIDEO_STREAM, "crf", "10" );
// w9.SetOption(VIDEO_STREAM, "rc_min_rate", "2000000" );
// w9.SetOption(VIDEO_STREAM, "rc_max_rate", "4000000" );
// w9.SetOption(VIDEO_STREAM, "max_b_frames", "10" );
// Write header
//w9.WriteHeader();
w9.WriteHeader();
//r9.DisplayInfo();
// 147000 frames, 28100 frames
//for (int frame = 1; frame <= (r9.info.video_length - 1); frame++)
//for (int z = 0; z < 2; z++)
for (long int frame = 1; frame <= 700; frame++)
for (long int frame = 500; frame <= 750; frame++)
//int frame = 1;
//while (true)
{
@@ -219,8 +229,8 @@ int main(int argc, char* argv[])
cout << "get " << frame << " (frame: " << frame_number << ") " << endl;
tr1::shared_ptr<Frame> f = r9.GetFrame(frame_number);
cout << "mapped frame channel layouts: " << f->ChannelsLayout() << endl;
cout << "display it (" << f->number << ", " << f << ")" << endl;
//cout << "mapped frame channel layouts: " << f->ChannelsLayout() << endl;
//cout << "display it (" << f->number << ", " << f << ")" << endl;
//r9.GetFrame(frame_number)->DisplayWaveform();
//if (frame >= 495)
// f->DisplayWaveform();