#433 Declined
  1. Ian Chen

Added video encoding functionality

Added a toolbar button in gzclient for making videos

Update: Renamed to VideoEncoder

Comments (26)

  1. Steve Peters

    My first thought when I see a file named Encoder.[hh/cc] is that it is a joint angle sensor. It's maybe a bit picky on my part, but it would be more clearly named as VideoEncoder.

  2. Steve Peters

    The first save dialog that comes up is not wide enough to display the full filename for me.

  3. Steve Peters

    It looks like the video size is hard-coded to 1024x768, but this makes the images distorted if the window has a different aspect ratio. At a minimum, we should maintain the aspect ratio so the videos don't look distorted, and power users might want to set the image size themselves.

      1. Ian Chen author

        thanks for filing the issue, since we're not going to be using this for the competition, I'll leave that for later.

  4. Steve Peters

    In addition to ogv, mp4, and avi, it would be nice to offer saving the raw camera images as a sequence of png images. I know there are plugins to do this, but it would be cool to have it available from this interface. They should be named sequentially:

    1. Ian Chen author

      I suspect its related to ogre's copyContentsToMemory call which caused previously seen crashes. I modified the code to use the old render texture blitToMemory method during a Camera post render.

      1. Nate Koenig

        I now get a segfault. Here's the backtrace:

        #0  _int_malloc (av=0x7ffff3605720, bytes=7246668) at malloc.c:3868
        #1  0x00007ffff32cffb5 in __GI___libc_malloc (bytes=7246668) at malloc.c:2924
        #2  0x00007ffff3bd3ded in operator new(unsigned long) ()
           from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
        #3  0x00007ffff3bd3f09 in operator new[](unsigned long) ()
           from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
        #4  0x00007fffbbc8a9e9 in ?? ()
           from /usr/lib/x86_64-linux-gnu/OGRE-1.7.4/RenderSystem_GL.so
        #5  0x00007ffff6f5e360 in gazebo::rendering::Camera::PostRender (
            this=0x2ce13f0) at /home/nkoenig/work/gazebo/gazebo/rendering/Camera.cc:435
        #6  0x00007ffff7020082 in gazebo::rendering::UserCamera::PostRender (
            at /home/nkoenig/work/gazebo/gazebo/rendering/UserCamera.cc:196
        #7  0x00007ffff6f7db1e in boost::_mfi::mf0<void, gazebo::rendering::Camera>::operator() (this=0x13026e8, p=0x2ce13f0)
            at /usr/include/boost/bind/mem_fn_template.hpp:49
        #8  0x00007ffff6f7c876 in boost::_bi::list1<boost::_bi::value<gazebo::rendering::Camera*> >::operator()<boost::_mfi::mf0<void, gazebo::rendering::Camera>, boost::_bi::list0> (this=0x13026f8, f=..., a=...)
            at /usr/include/boost/bind/bind.hpp:253
        #9  0x00007ffff6f7b033 in boost::_bi::bind_t<void, boost::_mfi::mf0<void, gazebo::rendering::Camera>, boost::_bi::list1<boost::_bi::value<gazebo::rendering::Camera*> > >::operator() (this=0x13026e8)
            at /usr/include/boost/bind/bind_template.hpp:20
        #10 0x00007ffff6f78f8d in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, gazebo::rendering::Camera>, boost::_bi::list1<boost::_bi::value<gazebo::rendering::Camera*> > >, void>::invoke (
            at /usr/include/boost/function/function_template.hpp:153
        #11 0x00000000005ad5b6 in boost::function0<void>::operator() (this=0x13026e0)
            at /usr/include/boost/function/function_template.hpp:1013
        #12 0x00000000005ad1cb in gazebo::event::EventT<void ()>::Signal() (this=
            0x7ffff7dd92c0) at /home/nkoenig/work/gazebo/gazebo/common/Event.hh:126
        #13 0x00000000005aced0 in gazebo::event::EventT<void ()>::operator()() (
            at /home/nkoenig/work/gazebo/gazebo/common/Event.hh:119
        #14 0x00000000005af3a0 in gazebo::gui::GLWidget::paintEvent (this=0x12d6720, 
            _e=0x7fffffffc210) at /home/nkoenig/work/gazebo/gazebo/gui/GLWidget.cc:191
        #15 0x00007ffff57120f6 in QWidget::event(QEvent*) ()
           from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
        #16 0x00007ffff56c1894 in QApplicationPrivate::notify_helper(QObject*, QEvent*)
            () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
        #17 0x00007ffff56c6713 in QApplication::notify(QObject*, QEvent*) ()
           from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
        #18 0x00007ffff519ee9c in QCoreApplication::notifyInternal(QObject*, QEvent*)
            () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
        #19 0x00007ffff570dd96 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
           from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
        #20 0x00007ffff58d9787 in QWidgetPrivate::repaint_sys(QRegion const&) ()
           from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
        #21 0x00007ffff5704a64 in QWidgetPrivate::syncBackingStore() ()
           from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
        #22 0x00007ffff571260c in QWidget::event(QEvent*) ()
           from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
        #23 0x00007ffff56c1894 in QApplicationPrivate::notify_helper(QObject*, QEvent*)
            () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
        ---Type <return> to continue, or q <return> to quit---
        #24 0x00007ffff56c6713 in QApplication::notify(QObject*, QEvent*) ()
           from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
        #25 0x00007ffff519ee9c in QCoreApplication::notifyInternal(QObject*, QEvent*)
            () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
        #26 0x00007ffff51a2c6a in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
        #27 0x00007ffff51cdf93 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
        #28 0x00007fffee367d53 in g_main_context_dispatch ()
           from /lib/x86_64-linux-gnu/libglib-2.0.so.0
        #29 0x00007fffee3680a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
        #30 0x00007fffee368164 in g_main_context_iteration ()
           from /lib/x86_64-linux-gnu/libglib-2.0.so.0
        #31 0x00007ffff51ce3bf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
        #32 0x00007ffff5769d5e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
        #33 0x00007ffff519dc82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
        #34 0x00007ffff519ded7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
        #35 0x00007ffff51a2f67 in QCoreApplication::exec() ()
           from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
        #36 0x00000000005c5dab in gazebo::gui::run (_argc=1, _argv=0x7fffffffcf78)
            at /home/nkoenig/work/gazebo/gazebo/gui/Gui.cc:196
        #37 0x0000000000640637 in main (_argc=1, _argv=0x7fffffffcf78)
            at /home/nkoenig/work/gazebo/gazebo/gui/main.cc:23
        1. Ian Chen author

          The backtrace points to line 435 in Camera.cc which is the old code that uses copyContentsToMemory(). Can you update to the latest code, compile and try again? thanks.

  5. Nate Koenig

    The aspect ratio is off in the recorded video. Is that easy to fix, or should this be a feature request?

    1. Steve Peters

      I mentioned that above and then filed issue #645. I'd like to see the aspect ratio fixed, even if the user can't specify the frame sizes.

  6. Steve Peters

    It's subjective, but I think the record button for the Data Logging gui looks better, because it has the thin ring of light grey between the red circle and the dark grey. The video record button would also benefit from some contrast, so that it looks like a button, not just a circle. What do you think @spaepcke ?

      1. Steffi Paepcke

        Thanks, Steve :)

        Agreed that it would be nice if the buttons looked more 3D. The grey border on the Logger record button is good, but might look better if it were thinner. What would be really cool is if we could add a bevel to the edge to really make it stand out from the screen. Is that possible?

        1. Steve Peters

          The icons are currently based on png images, so it will just take some photoshop/gimp work to make it happen. I'm not sure how the grey ring around the data logger is generated, but here's two of the raw images:



          1. Ian Chen author

            Thanks for the feedback guys. Unfortunately the pull request has to go. I made notes of it in issue #650

  7. Nate Koenig

    Okay. We are getting side tracked. Ian, can you decline this pull-request and make a feature request on the issue tracker to revisit this pull-request after the VRC?