Pipeline randomlly hangs at EOS
I'm developing a video recording application on NVIDIA Jetson Nano. My application runs on more than 200 Jetson Nano devices, each record 3-10 videos per day. A single device usually records 40-45 minutes with a 5 minute interval in-between. The problem is: sometimes (< 5%) a video is corrupted and cannot be post-processed.
The pipeline (line breaks added for readability):
v4l2src name=video_source
! videorate ! video/x-raw, height=720, width=1280, framerate=30/1
! nvvidconv
! omxh264enc
! queue
! mux.
pulsesrc device=alsa_input.usb-046d_Logitech_BRIO_FC1248A5-03.analog-stereo name=audio_source
! audio/x-raw, rate=44100, channels=2, width=32, depth=32
! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0
! lamemp3enc bitrate=256
! queue
! mux.
qtmux name=mux
! filesink location=filename.mp4
I tried running this pipeline with the Python binding (Gst.parse_launch
) and gst-launch-1.0
and had problems with both.
- Using the Python binding, I set a clock event on the pipeline's clock object. When it fires, I send and EOS event to the pipeline. My log indicates that the call to
pipeline.send_event
is always made, but sometimes fail to return. - Using
gst-launch-1.0
, I added the-e
flag (force EOS) and use a Python'ssubprocess
to initiate the process. The main Python process then simply sleeps 40-45 minutes then send a SIGINT event to the subprocess. The log bygst-launch-1.0
sometimes stop atEOS on shutdown enabled -- Forcing EOS on the pipeline
.
In either case, the camera is not released and need to be terminated by hand. The resulting video is corruped (missing the moov atom) and cannot be played or read with OpenCV for further processing.
Is this a problem with my pipeline, or a device specific problem, or a Gstreamer bug? How do I fix this?
Device: NVIDIA Jetson Nano
OS: Ubuntu 18.04
Gstreamer version:
~$ dpkg -l | grep gstreamer
ii gir1.2-gstreamer-1.0:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GObject introspection data for the GStreamer library
ii gstreamer1.0-alsa:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer plugin for ALSA
ii gstreamer1.0-clutter-3.0:arm64 3.0.26-1 arm64 Clutter PLugin for GStreamer 1.0
ii gstreamer1.0-gl:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer plugins for GL
ii gstreamer1.0-libav:arm64 1.14.5-0ubuntu1~18.04.1 arm64 libav plugin for GStreamer
ii gstreamer1.0-packagekit 1.1.9-1ubuntu2.18.04.6 arm64 GStreamer plugin to install codecs using PackageKit
ii gstreamer1.0-plugins-bad:arm64 1.14.5-0ubuntu1~18.04.1 arm64 GStreamer plugins from the "bad" set
ii gstreamer1.0-plugins-base:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer plugins from the "base" set
ii gstreamer1.0-plugins-base-apps 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer helper programs from the "base" set
ii gstreamer1.0-plugins-good:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer plugins from the "good" set
ii gstreamer1.0-plugins-ugly:arm64 1.14.5-0ubuntu1~18.04.1 arm64 GStreamer plugins from the "ugly" set
ii gstreamer1.0-pulseaudio:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer plugin for PulseAudio
ii gstreamer1.0-tools 1.14.5-0ubuntu1~18.04.2 arm64 Tools for use with GStreamer
ii gstreamer1.0-x:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer plugins for X11 and Pango
ii libgstreamer-gl1.0-0:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer GL libraries
ii libgstreamer-plugins-bad1.0-0:arm64 1.14.5-0ubuntu1~18.04.1 arm64 GStreamer libraries from the "bad" set
ii libgstreamer-plugins-base1.0-0:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer libraries from the "base" set
ii libgstreamer-plugins-base1.0-dev:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer development files for libraries from the "base" set
ii libgstreamer-plugins-good1.0-0:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer development files for libraries from the "good" set
ii libgstreamer1.0-0:arm64 1.14.5-0ubuntu1~18.04.2 arm64 Core GStreamer libraries and elements
ii libgstreamer1.0-dev:arm64 1.14.5-0ubuntu1~18.04.2 arm64 GStreamer core development files
ii nvidia-l4t-gstreamer 32.3.1-20191209225816 arm64 NVIDIA GST Application files