Extending edgertronic capabilities - Mp4 video file format support

From edgertronic high speed video camera
Jump to: navigation, search


Home

Hardware watchdog timer




The edgertronic high speed camera designers are a bunch of Mac computer users, so we picked the Apple-defined QuickTime .mov video file format. If you would prefer to use the Moving Picture Experts Group defined MPEG-4 Part 14, affectionately known as .mp4 file format, that is possible by providing a custom GStreamer Pipelines file. Both .mov and .mp4 video files contain H.264 encoded video frames and no audio. The difference is just the multimedia container used.

Adding a custom pipeline

The pipelines file differs from the factory provided pipeline by specifying an .mp4 file extension and specifying an mp4 container be used in the GStreamer save video pipeline. A tested, but possibly old, version of the pipelines_custom.txt file is shown below. The mp4 pipelines file version that matches your camera's software (version 2.4.1 or newer) can be retrieved from your camera:

replacing 10.11.12.13 with your camera's IP address as necessary.

or you can grab the mp4 pipelines_custom.txt file, from the internet (for software versions 2.2.* and 2.3.*).

Once you have the pipelines_custom.txt file, put it on the SD card, in the top level (root) directory, turn on the camera, and wait for the camera LED to go solid green.

mp4 custom pipelines file

The following shows the contents of the mp4 custom pipelines file.

Notes:

  • Save view is disabled, meaning you will see a black frame when save is in progress instead seeing frames being saved. This decreases the time to save and for some use cases also improves reliability (due to a defect in a Texas Instruments provided software library).
  • The video encode quality is set to high in the following file. You can change it by adjusting the setting the qpintra and qpinter to values like 20 or 25.
# Sanstreak Corporation provides this source code solely on the terms and
# conditions set forth in the edgertronic by Sanstreak Usage Agreement and
# on the condition that you accept and comply with them.  You may view the
# most recent version of the Usage Agreement at:
# http://wiki.edgertronic.com/index.php/Usage_Agreement.
[OVERLAY]

overlay_notes = text-offseth=10 text-offsetv=&y text-font-height=&F text-color=0xFFFFFF text-border=0x000000

overlay_settings = text2-offseth=10 text2-offsetv=&y text2-font-height=&F text2-color=0xFFFFFF text2-border=0x000000 text2=ISO:\ &i\ EXP:\ &s\ FPS:\ &f

overlay_frame_number = frame-offseth=10 frame-offsetv=&y frame-font-height=&F frame-color=0xFFFFFF frame-border=0x000000 frame-number=-100

overlay_logo = logo-offseth=-10 logo-offsetv=-10 logo-transparency=false logo-scale=&I logo-autofit=true logo=/usr/share/edgertronic/edgertronic-logo.png

[DEFAULT]

description = MP4 container holding H.264 high encode quality with preview during save disabled

source_format = video/x-raw-yuv,format=(fourcc)NV12

movie_extension = mp4

preview_during_save=false

source_bin = v4l2src always-copy=false name=camera queue-size=8 ! capsfilter name=filter ! dmaiaccel ! emboverlay name=overlay ! tee name=srctee

stream_bin = queue ! dmaienc_jpeg outputBufferSize=3133440 qValue=75 ! multifilesink next-file=0 async=false sync=false location=/tmp/images/image.jpg

save_bin = queue name=video-queue ! dmaienc_h264 encodingpreset=2 ratecontrol=4 intraframeinterval=15 idrinterval=15 entropy=1 qpintra=15 qpinter=15 outputBufferSize=18800640 fixTimestamp=true single-nalu=true ! mp4mux name=mux0 ! filesink name=fsink location=/video.mp4 async=false

Activating the custom pipeline

Custom-pipeline-selection.png

You can activate the custom pipeline to generate mp4 files by browsing to the camera and in the Settings modal, Options tab, and set Video Encoding to Custom.

  • Using a custom pipeline disables the 'Save View' feature.(as shown in the image).

If you are using CAMAPI, you can activate the custom pipeline by dictionary entry requested_pipeline to DEFAULT:pipelines_custom.txt when invoking configure_camera().




Home

Hardware watchdog timer