diff --git a/src/FFmpegWriter.cpp b/src/FFmpegWriter.cpp index d48d27b1..41486728 100644 --- a/src/FFmpegWriter.cpp +++ b/src/FFmpegWriter.cpp @@ -195,7 +195,8 @@ void FFmpegWriter::SetOption(Stream_Type stream, string name, string value) option = av_find_opt(c->priv_data, name.c_str(), NULL, NULL, NULL); // Was option found? - if (option || (name == "g" || name == "qmin" || name == "qmax" || name == "max_b_frames" || name == "mb_decision")) + if (option || (name == "g" || name == "qmin" || name == "qmax" || name == "max_b_frames" || name == "mb_decision" || + name == "level" || name == "profile")) { // Check for specific named options if (name == "g") @@ -218,6 +219,14 @@ void FFmpegWriter::SetOption(Stream_Type stream, string name, string value) // macroblock decision mode convert >> c->mb_decision; + else if (name == "level") + // set codec level + convert >> c->level; + + else if (name == "profile") + // set codec profile + convert >> c->profile; + else // Set AVOption av_set_string3 (c->priv_data, name.c_str(), value.c_str(), 0, NULL); diff --git a/src/Main.cpp b/src/Main.cpp index 68976eb7..89c75570 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -41,10 +41,13 @@ int main() w.PrepareStreams(); // Set Options - w.SetOption(VIDEO_STREAM, "quality", "good"); - w.SetOption(VIDEO_STREAM, "g", "5"); + //w.SetOption(VIDEO_STREAM, "quality", "good"); + w.SetOption(VIDEO_STREAM, "g", "120"); w.SetOption(VIDEO_STREAM, "qmin", "10"); w.SetOption(VIDEO_STREAM, "qmax", "42"); + w.SetOption(VIDEO_STREAM, "profile", "0"); + w.SetOption(VIDEO_STREAM, "level", "216"); + w.SetOption(VIDEO_STREAM, "rc_lookahead", "16"); //w.SetOption(VIDEO_STREAM, "max_b_frames", "2"); //w.SetOption(VIDEO_STREAM, "mb_decision", "2");