diff --git a/README.md b/README.md
index 030386eae..7ba83cb38 100755
--- a/README.md
+++ b/README.md
@@ -208,6 +208,7 @@ Supported operating systems and hardware:
* 2013-10-17, Created.
## History
+* v1.0, 2014-07-19, fix [#119](https://github.com/winlinvip/simple-rtmp-server/issues/119), use iformat and oformat for ffmpeg transcode. 0.9.163.
* v1.0, 2014-07-13, [1.0 mainline6(0.9.160)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0.mainline8) released. 50029 lines.
* v1.0, 2014-07-13, refine the bandwidth check/test, add as/js library, use srs-librtmp for linux tool. 0.9.159
* v1.0, 2014-07-12, complete rtmp stack utest. 0.9.156
diff --git a/trunk/src/app/srs_app_ffmpeg.cpp b/trunk/src/app/srs_app_ffmpeg.cpp
index 134d5971b..ae1a75a5a 100644
--- a/trunk/src/app/srs_app_ffmpeg.cpp
+++ b/trunk/src/app/srs_app_ffmpeg.cpp
@@ -76,6 +76,11 @@ void SrsFFMPEG::set_iparams(string iparams)
_iparams = iparams;
}
+void SrsFFMPEG::set_oformat(string format)
+{
+ oformat = format;
+}
+
string SrsFFMPEG::output()
{
return _output;
@@ -243,7 +248,7 @@ int SrsFFMPEG::start()
}
// input.
- if (iformat != "off") {
+ if (iformat != "off" && !iformat.empty()) {
params.push_back("-f");
params.push_back(iformat);
}
@@ -346,7 +351,7 @@ int SrsFFMPEG::start()
}
// output
- if (oformat != "off") {
+ if (oformat != "off" && !oformat.empty()) {
params.push_back("-f");
params.push_back(oformat);
}
diff --git a/trunk/src/app/srs_app_ffmpeg.hpp b/trunk/src/app/srs_app_ffmpeg.hpp
index e9a50f5ce..6da372f13 100644
--- a/trunk/src/app/srs_app_ffmpeg.hpp
+++ b/trunk/src/app/srs_app_ffmpeg.hpp
@@ -75,6 +75,7 @@ public:
virtual ~SrsFFMPEG();
public:
virtual void set_iparams(std::string iparams);
+ virtual void set_oformat(std::string format);
virtual std::string output();
public:
virtual int initialize(std::string in, std::string out, std::string log);
diff --git a/trunk/src/app/srs_app_ingest.cpp b/trunk/src/app/srs_app_ingest.cpp
index 322336dbc..dcfe0fe8a 100644
--- a/trunk/src/app/srs_app_ingest.cpp
+++ b/trunk/src/app/srs_app_ingest.cpp
@@ -317,12 +317,14 @@ int SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective* vhost, S
ingest->arg0().c_str(), input_type.c_str(), ret);
}
+ // set output format to flv for RTMP
+ ffmpeg->set_oformat("flv");
+
std::string vcodec = _srs_config->get_engine_vcodec(engine);
std::string acodec = _srs_config->get_engine_acodec(engine);
// whatever the engine config, use copy as default.
- if (!engine || vcodec.empty() || acodec.empty()
- || !_srs_config->get_engine_enabled(engine)
- ) {
+ bool engine_disabled = !engine || !_srs_config->get_engine_enabled(engine);
+ if (engine_disabled || vcodec.empty() || acodec.empty()) {
if ((ret = ffmpeg->initialize_copy()) != ERROR_SUCCESS) {
return ret;
}
diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp
index 05360793e..3997b82fa 100644
--- a/trunk/src/core/srs_core.hpp
+++ b/trunk/src/core/srs_core.hpp
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
-#define VERSION_REVISION "162"
+#define VERSION_REVISION "163"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "SRS"