From 7de79eb71985f47f0c9ee96222448dc38fbe6a22 Mon Sep 17 00:00:00 2001 From: Edric Milaret <edric.ladent-milaret@savoirfairelinux.com> Date: Wed, 11 Nov 2015 15:35:21 -0500 Subject: [PATCH] encoder: don't try to provide framerate to ffmpeg on win32 - dshow provide min/max value that don't always work. No pattern have been observed as to why... - ffmpeg chooses the highest value it can when we don't provide it. Change-Id: I8d8b0993ded6d474f3ad9c741df7fd14fb61021b Tuleap: #132 --- src/media/media_decoder.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/media/media_decoder.cpp b/src/media/media_decoder.cpp index cadbb23002..5c3d74ce28 100644 --- a/src/media/media_decoder.cpp +++ b/src/media/media_decoder.cpp @@ -70,8 +70,13 @@ int MediaDecoder::openInput(const DeviceParams& params) ss << params.width << "x" << params.height; av_dict_set(&options_, "video_size", ss.str().c_str(), 0); } +#ifndef _WIN32 + // on windows, framerate setting can lead to a failure while opening device + // despite investigations, we didn't found a proper solution + // we let dshow choose the framerate, which is the highest according to our experimentations if (params.framerate) av_dict_set(&options_, "framerate", ring::to_string(params.framerate.real()).c_str(), 0); +#endif if (params.channel) av_dict_set(&options_, "channel", ring::to_string(params.channel).c_str(), 0); av_dict_set(&options_, "loop", params.loop.c_str(), 0); -- GitLab