LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 03-18-2019, 06:10 PM   #1
soveda
Member
 
Registered: Feb 2018
Distribution: Mint 19; Ubuntu Studio; Kali
Posts: 37

Rep: Reputation: Disabled
Question Raspivid -t variable not timing out


I'm really not sure where to ask this question.
I've set up two bird boxes each with a pi zero w with ir camera in them.
When I start the cameras streaming with raspivid streaming to youtube they are sending the signal nicely but I want the stream to only last about 30 minutes at a time. I've looked at the documentation which says that you use the -t variable to set the length of the capture in milliseconds. I've done this but the stream does not stop!
What I really want to do is set the command as a bash script which is called by cron each hour to stream for half an hour with each pi alternating so it doesn't kill my bandwidth too much! Any thoughts or help appreciated!
I'll then start on my "why does the cron job work on one pi and not the other" question!
Code as below:

Code:
raspivid -t 180000 -o - -w 1080 -h 720 -fps 25 -b 4000000 -g 50
The code then pipes to ffmpeg but that bit works fine!

Edited to add:
I know that 180000ms would be 3 minutes not 30 minutes but it doesn't even do just 3 minutes it won't blooming stop!

Last edited by soveda; 03-18-2019 at 06:12 PM. Reason: clarification
 
Old 03-19-2019, 11:26 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,813
Blog Entries: 13

Rep: Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875
My suggestions would be to remove all the other options for now and just use the -t and the -o option.

Yes I realize that they should have nothing to do with this problem, but just get them out of the way and use the defaults for the time being.

Instead of 3 minutes, try 3 seconds so that you can try it iteratively.

Recommend you try putting the output to an actual file versus stdout and see if this continual problem has to do with the redirection to stdout over a file. It may be an inconvenient feature/problem that isn't documented. Unsure, I can't test that one myself. I used to use a Pi to capture still frames, but it was still frames only and I used a different application but it worked great.

Dumb other things to try, if the capture does stop when you put it to a file, try putting the -o - either at the beginning or the end of the command string.

If you find any success with capturing to a file, I wonder if instead of -o - you could use -o /dev/stdout.

For that matter, what happens if you never give it a -o argument? Could you just leave that out and pipe it to ffmpeg that way?
 
1 members found this post helpful.
Old 03-19-2019, 04:43 PM   #3
soveda
Member
 
Registered: Feb 2018
Distribution: Mint 19; Ubuntu Studio; Kali
Posts: 37

Original Poster
Rep: Reputation: Disabled
I'll try that and report back.
 
Old 03-19-2019, 05:34 PM   #4
soveda
Member
 
Registered: Feb 2018
Distribution: Mint 19; Ubuntu Studio; Kali
Posts: 37

Original Poster
Rep: Reputation: Disabled
Ok, so the timeout works when the output is a file but not when it is sent to ffmpeg. with the -o - variable.
I'll try the /dev/stdout option tomorrow, time for bed here!
Thank you for your help so far.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh connection timing out - Lenny out of the box SirSefu Linux - Newbie 4 12-17-2009 07:41 AM
AWK a variable Ouptut to a new variable and using the new variable with the old one alertroshannow Linux - Newbie 4 02-16-2009 12:08 AM
how to start timing and print the timing result on portions of java codes ?? alred Programming 2 05-15-2006 10:00 AM
SSH remote command not timing out tajsss Other *NIX 5 04-28-2005 06:57 AM
SSH timing out/not connecting NeccoWolf Linux - Networking 2 01-26-2003 02:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration