Unreadeable recorded video in SLP

S.L.P. image questions, stereoscopic video livestream and recording, stereoscopic photo capture etc.
Post Reply
User avatar
stereomii
Posts: 37
Joined: Mon May 13, 2019 3:11 pm
Location: Apeldoorn, The Netherlands
Contact:

Unreadeable recorded video in SLP

Post 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.
Jan a.k.a. stereomii
StereoPi with Waveshare 160deg cams

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Unreadeable recorded video in SLP

Post 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.
Eugene a.k.a. Realizator

User avatar
stereomii
Posts: 37
Joined: Mon May 13, 2019 3:11 pm
Location: Apeldoorn, The Netherlands
Contact:

Re: Unreadeable recorded video in SLP

Post 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 :) .
Jan a.k.a. stereomii
StereoPi with Waveshare 160deg cams

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Unreadeable recorded video in SLP

Post 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.
Eugene a.k.a. Realizator

jonititan
Posts: 3
Joined: Wed Oct 21, 2020 11:18 am

Re: Unreadeable recorded video in SLP

Post by jonititan »

I am also having this issue. Out of the box recording results in unplayable files 90+% of the time

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Unreadeable recorded video in SLP

Post 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.
Eugene a.k.a. Realizator

jonititan
Posts: 3
Joined: Wed Oct 21, 2020 11:18 am

Re: Unreadeable recorded video in SLP

Post 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....

jonititan
Posts: 3
Joined: Wed Oct 21, 2020 11:18 am

Re: Unreadeable recorded video in SLP

Post by jonititan »

Upon further inspection i do still get lots of unreadable files when I set the duration for 5min or more.

Post Reply