Merge pull request #1050 from erwincoumans/master

remove 20 second time limit for ffmpeg recording
This commit is contained in:
erwincoumans 2017-03-30 14:57:47 -07:00 committed by GitHub
commit 0c6b0d52c6
4 changed files with 33 additions and 3 deletions

View File

@ -620,6 +620,15 @@ bool UrdfParser::parseVisual(UrdfModel& model, UrdfVisual& visual, TiXmlElement*
if (parseMaterial(visual.m_geometry.m_localMaterial, mat,logger))
{
UrdfMaterial* matPtr = new UrdfMaterial(visual.m_geometry.m_localMaterial);
UrdfMaterial** oldMatPtrPtr = model.m_materials[matPtr->m_name.c_str()];
if (oldMatPtrPtr)
{
UrdfMaterial* oldMatPtr = *oldMatPtrPtr;
model.m_materials.remove(matPtr->m_name.c_str());
if (oldMatPtr)
delete oldMatPtr;
}
model.m_materials.insert(matPtr->m_name.c_str(),matPtr);
visual.m_geometry.m_hasLocalMaterial = true;
}

View File

@ -789,14 +789,14 @@ void SimpleOpenGL3App::dumpFramesToVideo(const char* mp4FileName)
#ifdef _WIN32
sprintf(cmd, "ffmpeg -r 60 -f rawvideo -pix_fmt rgba -s %dx%d -i - "
"-threads 0 -y -b:v 50000k -t 20 -c:v libx264 -preset slow -crf 22 -an -pix_fmt yuv420p -vf vflip %s", width, height, mp4FileName);
"-threads 0 -y -b:v 50000k -c:v libx264 -preset slow -crf 22 -an -pix_fmt yuv420p -vf vflip %s", width, height, mp4FileName);
//sprintf(cmd, "ffmpeg -r 60 -f rawvideo -pix_fmt rgba -s %dx%d -i - "
// "-y -crf 0 -b:v 1500000 -an -vcodec h264 -vf vflip %s", width, height, mp4FileName);
#else
sprintf(cmd, "ffmpeg -r 60 -f rawvideo -pix_fmt rgba -s %dx%d -i - "
"-threads 0 -y -b 50000k -t 20 -c:v libx264 -preset slow -crf 22 -an -pix_fmt yuv420p -vf vflip %s", width, height, mp4FileName);
"-threads 0 -y -b 50000k -c:v libx264 -preset slow -crf 22 -an -pix_fmt yuv420p -vf vflip %s", width, height, mp4FileName);
#endif
//sprintf(cmd,"ffmpeg -r 60 -f rawvideo -pix_fmt rgba -s %dx%d -i - "

View File

@ -1,3 +1,4 @@
#include "../SharedMemory/PhysicsClientC_API.h"
#include "../SharedMemory/PhysicsDirectC_API.h"
#include "../SharedMemory/SharedMemoryInProcessPhysicsC_API.h"
@ -398,6 +399,22 @@ static PyObject* pybullet_disconnectPhysicsServer(PyObject* self,
return Py_None;
}
void b3pybulletExitFunc()
{
int i;
for (i=0;i<MAX_PHYSICS_CLIENTS;i++)
{
if (sPhysicsClients1[i])
{
b3DisconnectSharedMemory(sPhysicsClients1[i]);
sPhysicsClients1[i] = 0;
sNumPhysicsClients--;
}
}
}
static PyObject* pybullet_saveWorld(PyObject* self, PyObject* args, PyObject* keywds)
{
const char* worldFileName = "";
@ -5453,6 +5470,10 @@ initpybullet(void)
Py_INCREF(SpamError);
PyModule_AddObject(m, "error", SpamError);
Py_AtExit( b3pybulletExitFunc );
#ifdef PYBULLET_USE_NUMPY
// Initialize numpy array.
import_array();

View File

@ -29,7 +29,7 @@ public:
{
std::string arg = argv[i];
if ((arg[0] != '-') || (arg[1] != '-')) {
if ((arg.length() < 2) || (arg[0] != '-') || (arg[1] != '-')) {
continue;
}