ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Recording camera frames to file using MPA

    Ask your questions right here!
    5
    13
    805
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Eric KatzfeyE
      Eric Katzfey ModalAI Team @czarsimon
      last edited by

      @czarsimon Are you interested in recording the raw frames coming from the sensor (voxl-camera-server) or the compressed h264 stream coming from voxl-streamer?

      C 1 Reply Last reply Reply Quote 0
      • C
        czarsimon @Eric Katzfey
        last edited by

        @Eric-Katzfey Ideally I would like to be able to record 4K video while streaming at a lower resolution to save on bandwidth. To answer your question I suppose it would be the h264 stream. Does either app have the ability to export video to a file? I wasn't able to find any references to it in the documentation or looking through the source. Thanks

        Eric KatzfeyE 1 Reply Last reply Reply Quote 0
        • Eric KatzfeyE
          Eric Katzfey ModalAI Team @czarsimon
          last edited by

          @czarsimon Unfortunately, voxl-streamer does not currently support that, and we don't have a date when it will be added. You are more than welcome to add the feature to voxl-streamer. It shouldn't be too hard. You just "tee" the stream at some point and send to a "filesink" element.

          Pavel ArdashovP C 2 Replies Last reply Reply Quote 0
          • Pavel ArdashovP
            Pavel Ardashov @Eric Katzfey
            last edited by

            @Eric-Katzfey please tell me how to recording the raw frames coming from the sensor (voxl-camera-server) to a SD card?

            1 Reply Last reply Reply Quote 0
            • Cliff WongC
              Cliff Wong ModalAI Team
              last edited by

              Raw frames can be had onboard using voxl-logger. For example,

              voxl-logger --cam stereo --samples 60
              

              will record 60 frames in png format from the stereo camera. The frames are currently stored on /data/voxl-logger/log<XXXX>/run. You'll need to move them to the sdcard.

              C Pavel ArdashovP 2 Replies Last reply Reply Quote 0
              • C
                czarsimon @Cliff Wong
                last edited by

                @Cliff-Wong Thanks Cliff this is great, is the source for this app available? I can't find it on Gitlab.

                1 Reply Last reply Reply Quote 0
                • ?
                  A Former User
                  last edited by

                  The source lives here in the mpa-tools repo

                  C 1 Reply Last reply Reply Quote 0
                  • C
                    czarsimon @Guest
                    last edited by

                    @Alex-Gardner Sweet, thanks!

                    1 Reply Last reply Reply Quote 0
                    • Pavel ArdashovP
                      Pavel Ardashov @Cliff Wong
                      last edited by

                      @Cliff-Wong Thanks! Happened.
                      Please tell me how to record video to SD?

                      1 Reply Last reply Reply Quote 0
                      • C
                        czarsimon @Eric Katzfey
                        last edited by

                        Hi @Eric-Katzfey, I've been revisiting this lately and modified the voxl-streamer app like you suggested with a tee to a filesink. I am however seeing a strange behavior where the video file is very short and missing most of the frames. Any idea why that might be? My modified pipeline follows the image overlay element and is this:

                        gst_element_link_many(last_element,
                                                            context->encoder_queue,
                                                            context->omx_encoder,
                                                            context->filesink_tee,
                                                            NULL);
                        gst_element_link_many(context->filesink_tee,
                                                            context->rtp_filter,
                                                            context->rtp_queue,
                                                            context->rtp_payload,
                                                            NULL);
                        gst_element_link_many(context->filesink_tee,
                                                            context->h264_parser_queue,
                                                            context->h264_parser,
                                                            context->filesink_queue,
                                                            context->filesink,
                                                            NULL);
                        
                        1 Reply Last reply Reply Quote 0
                        • C
                          czarsimon
                          last edited by

                          I've been trying to build a simple command line pipeline to test the filesink:

                          gst-launch-1.0 videotestsrc num-buffers=100 ! video/x-raw,width=640,height=480,framerate=30/1 ! omxh264enc ! mp4mux ! filesink location=test_file.mp4
                          

                          But it doesn't seem to be want to play nice with omx:

                          ERROR:/opt/workspace/build/apq8096-le-1-0-1_ap_standard_oem.git/apps_proc/poky/build/tmp-glibc/work/armv7a-vfp-neon-oemllib32-linux-gnueabi/lib32-gstreamer1.0-omx/1.10.4-r0/gst-omx-1.10.4/omx/gstomxh264enc.c:532:gst_omx_h264_enc_get_caps: code should not be reached
                          

                          It works just fine on my laptop if I replace omxh264enc with x264enc. Does this mean that the problem is not with gstreamer but with the omx plugin?

                          Eric KatzfeyE 1 Reply Last reply Reply Quote 0
                          • Eric KatzfeyE
                            Eric Katzfey ModalAI Team @czarsimon
                            last edited by

                            @czarsimon omx has a very limited set of input formats. I would add format NV12 (or NV21) to your caps filter in between videotestsrc and omx.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Powered by NodeBB | Contributors