Page 1 of 1

Unreadeable recorded video in SLP

Posted: Wed Jun 10, 2020 12:32 pm
by stereomii
I wonder if I am the only one having problems recording videos with the SLP image. I mentioned it last year in viewtopic.php?p=252#p252 problems recording videos. Realizator suggested videos being not correctly closed.

Alas no real solutions came up. The problems continued what resulted in me losing interest in the StereoPi.

Recently I picked up StereoPi with a fresh SLP image (version 0.2.4), only to find out that no reliable video capture was possible. I tried to get some idea why and noticed that running /opt/StereoPi/run.sh in a ssh-terminal (after first stopping relevant processes with stop.sh) logged a lot of information on the termial screen.

Next lines seem to confirm that Gstreamer not correctly closing the recordings is indeed the reason why the recordings can not be played

Code: Select all

Recording enabled
Recording without audio to  20200604-165655
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstQTMux:qtmux0: Could not multiplex stream.
Additional debug info:
gstqtmux.c(3391): gst_qt_mux_add_buffer (): /GstPipeline:pipeline0/GstQTMux:qtmux0:
Buffer has no PTS.
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming stopped, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstQueue:queue0: Internal data stream error.
Additional debug info:
gstqueue.c(989): gst_queue_handle_sink_event (): /GstPipeline:pipeline0/GstQueue:queue0:
streaming stopped, reason error (-5)
Need to stop recording
handling interrupt.
Interrupt: Stopping pipeline ...
Interrupt while waiting for EOS - stopping pipeline...
Execution ended after 0:00:28.678193959
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Recording parts by 30 seconds
Setting pipeline to NULL ...
Freeing pipeline ...
Recording stopped
So I tried to make sure Gstreamer (recorder) has time enough to shut down before a new recording is started. I modified /opt/SterePi/scripts/loop-record.sh by adding:
killall -q -INT recorder
sleep 2
before starting a new recording (after line 20)

Code: Select all

...
    if [ "$record_enabled" = "1" ] ; then
		echo "Recording enabled"
	else
		sleep 1
		continue
    fi

#next two lines added:
     killall -q -INT recorder
     sleep 2

    if [ "$audio_enabled" = "1" ] ; then
		echo "Recording with audio"
...
And I am quiet delighted to see that there are almost no recording error anymore. (decreased from sometimes more than 50% to almost nothing)

So, after that I added a record button to the SLP, I will describe this in a new post.

Re: Unreadeable recorded video in SLP

Posted: Wed Jun 10, 2020 4:29 pm
by Realizator
Hi Stereomii,
Welcome back, we missed you here! :-)
Thank you for your catch! We'll test this approach. I also added this post to the list of improvements for the upcoming SLP update topic.

Re: Unreadeable recorded video in SLP

Posted: Thu Jun 18, 2020 7:44 pm
by stereomii
stereomii wrote:
Wed Jun 10, 2020 12:32 pm
.... And I am quiet delighted to see that there are almost no recording error anymore. (decreased from sometimes more than 50% to almost nothing)
.....
I was a bit too optimistic :( . Recording long (>10 minutes) videos still give occasional unplayable files, although a lot less than it used to be :) .

Re: Unreadeable recorded video in SLP

Posted: Fri Jun 19, 2020 10:47 am
by Realizator
May be on-the-go conversion from raw H264 to the readable MP4 is an issue. But raw264 is very uncomfortable for the viewing (no scroll, etc). We need to investigate this issue.

Re: Unreadeable recorded video in SLP

Posted: Wed Oct 21, 2020 11:32 am
by jonititan
I am also having this issue. Out of the box recording results in unplayable files 90+% of the time

Re: Unreadeable recorded video in SLP

Posted: Fri Oct 23, 2020 9:32 am
by Realizator
jonititan, which settings are you using for the video recording?
Also, JFYI, we are planning to start beta-tests of our updated SLP image soon. The Video recording part was fully rewritten, and this issue should be solved.

Re: Unreadeable recorded video in SLP

Posted: Sat Nov 21, 2020 10:30 pm
by jonititan
Thats great to hear. i'll look forward to trying it out. I'm also looking forward to Stereopiv2

It seemed to happen no matter what settings i choose.
However I must admit I went to check it just now and after resetting everything to their defaults it started working....

Re: Unreadeable recorded video in SLP

Posted: Thu Nov 26, 2020 9:22 am
by jonititan
Upon further inspection i do still get lots of unreadable files when I set the duration for 5min or more.