fix ffmpeg stream to create quicktime compatible videos
This commit is contained in:
@@ -750,7 +750,7 @@ static void writeTextureToFile(int textureWidth, int textureHeight, const char*
|
|||||||
|
|
||||||
void SimpleOpenGL3App::swapBuffer()
|
void SimpleOpenGL3App::swapBuffer()
|
||||||
{
|
{
|
||||||
m_window->endRendering();
|
|
||||||
if (m_data->m_frameDumpPngFileName)
|
if (m_data->m_frameDumpPngFileName)
|
||||||
{
|
{
|
||||||
int width = (int)m_window->getRetinaScale()*m_instancingRenderer->getScreenWidth();
|
int width = (int)m_window->getRetinaScale()*m_instancingRenderer->getScreenWidth();
|
||||||
@@ -764,7 +764,8 @@ void SimpleOpenGL3App::swapBuffer()
|
|||||||
m_data->m_frameDumpPngFileName = 0;
|
m_data->m_frameDumpPngFileName = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_window->startRendering();
|
m_window->endRendering();
|
||||||
|
m_window->startRendering();
|
||||||
}
|
}
|
||||||
|
|
||||||
// see also http://blog.mmacklin.com/2013/06/11/real-time-video-capture-with-ffmpeg/
|
// see also http://blog.mmacklin.com/2013/06/11/real-time-video-capture-with-ffmpeg/
|
||||||
@@ -780,7 +781,7 @@ void SimpleOpenGL3App::dumpFramesToVideo(const char* mp4FileName)
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
sprintf(cmd, "ffmpeg -r 60 -f rawvideo -pix_fmt rgba -s %dx%d -i - "
|
sprintf(cmd, "ffmpeg -r 60 -f rawvideo -pix_fmt rgba -s %dx%d -i - "
|
||||||
"-threads 0 -y -crf 0 -b 50000k -vf vflip %s", width, height, mp4FileName);
|
"-threads 0 -y -b 50000k -t 20 -c:v libx264 -preset slow -crf 22 -an -pix_fmt yuv420p -vf vflip %s", width, height, mp4FileName);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//sprintf(cmd,"ffmpeg -r 60 -f rawvideo -pix_fmt rgba -s %dx%d -i - "
|
//sprintf(cmd,"ffmpeg -r 60 -f rawvideo -pix_fmt rgba -s %dx%d -i - "
|
||||||
|
|||||||
Reference in New Issue
Block a user