LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-24-2014, 06:20 AM   #1
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Rep: Reputation: 3
saving bash script's audio-and-image output as .mov file


2014-09-24

I would like to know a simple command-line method to save a show-and-tell script's audio-and-image output in a .mov file, which I can play back on a TV through a CD or DVD player. Any help will be much appreciated.

Julianloui
 
Old 09-24-2014, 07:18 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Bit confusing to me. Scripts don't have audio/video "output", however one can cause an existing media file or stream to be played via the use of a script. Or have a script load and play an online medial stream. Either way, those media streams are already saved somewhere.

Or are you saying that you want to make a video of a show and tell script, so that persons using it can reference the video to understand something further?
 
Old 09-24-2014, 07:27 AM   #3
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Quote:
Bit confusing to me. Scripts don't have audio/video "output", however one can cause an existing media file or stream to be played via the use of a script. Or have a script load and play an online medial stream. Either way, those media streams are already saved somewhere.

Or are you saying that you want to make a video of a show and tell script, so that persons using it can reference the video to understand something further?
__________________

I think I did'nt state my question clearly. My script currently produces pictures and associated sounds in a number of succesive frames on the computer screen. What I would like to do is to capture the script's output in a .mov file which I can then play back on a TV screen. Thanks very much for your input.

julianloui
(formerly Framingham, MA)

Last edited by julianvb; 09-24-2014 at 07:35 AM.
 
Old 09-24-2014, 07:43 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by julianvb View Post
I guess I didn't state my question clearly. My script produces pictures as well as associated sounds in a number of succesive frames on the computer screen. What I would like to do is to capture the script's output in a .mov file which I can then play back on a TV screen. Thanks very much for your input.

julianloui
OK, there are two possibilities, I'm guessing the second one. The first one would be:
The script totally governs the flow of audio-video, therefore what would be the problem, it's technically already recorded.
The second one would be:
The script is interactive, therefore due to the actions on the part of the user, different flows of audio-video would occur, and could occur each time a user ran the script; depending what options they selected.
So like I say, I "guess" that second option.

And if I'm close, one thing you could do; also providing you can edit the script yourself, is to capture into a record file the choices that the person made to define their flow. That capture could be a complete copy of their session with sufficient data to re-run the flow of audio-video that they did. A further enhancement might be to convert that session record into a singular movie file at the successful end of a script session. I'd break it down into recording the session so that it would be replayed first as a script option, secondly try to make it so that the recorded session file itself becomes a script and when run, would do the replay, and finally design a way to convert that recorded session into a movie file.

Some notes. I long ago did a project where we took images periodically throughout the day to record environment changes and then they wanted it made into a movie. I guess it depends. They wanted full resolution images, fully visible movies, therefore it took a ton of space and resources to create the movies. Ultimately they started complaining about disk space. Gotta love that. We did find that making the movie low resolution cost a lot of visibility, especially if you wanted to blow it up to screen size. This seems similar, the images hardly changed, but there were like 84,000 of them (one photo per second, for a whole day). If you have a fixed image on the screen and then play an audio file in conjunction with that. To make that a movie, you're basically having multiple frames of that fixed image showing and multiplying that by however many times you need to fill the movie space where there are pauses and the audio is also playing. So therefore some 300K JPEG image gets copied at 30 frames per second for 10, 20, 30 (?) seconds. It becomes large. This is why I'm thinking it might be better to "replay" the script session in the same manner; which is to make the replay a script which follows the recorded session and does the same actions; "display one fixed image, and plays an audio file".

A final option might be to research something which can record your screen and then cause it to start and stop recording as part of the script so that the session is bounded in start/stop as you'd prefer it to be.
 
1 members found this post helpful.
Old 09-24-2014, 08:36 AM   #5
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
if you have something like a directory of jpg's maybe this will work:
Code:
mencoder mf://*.jpg -mf w=320:h=240:fps=.5:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o julianvb.avi
supposedly imagemagicks convert program should work but i get an error:
Code:
convert -delay 6 -quality 95 dscf007*.jpg julianvb.mpg
convert: delegate failed `"ffmpeg" -v -1 -mbd rd -flags +4mv+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -i "%M%%d.jpg" "%u.%m" 2> "%Z"' @ error/delegate.c/InvokeDelegate/1061.
#formerly of somerville
 
1 members found this post helpful.
Old 09-24-2014, 10:23 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I used convert to convert an individual image, to place the day/time timestamp onto the images taken so a day/clock would be shown as part of the movie. However we did try to use avconv and/or ffmpeg to make the actual movie. And that appears to be what convert attempted to use there actually.
 
Old 09-24-2014, 12:48 PM   #7
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Hi, rtmister and schneidz,

Thank you very much for your copious generous help. A few days ago I did entertain the idea to makig an interactive start-stop version of my script, but I decided to put it off as I was too busy with other matters.

Essentially my script repeatitive invokes just two applications, namely espeak and shotwell. So it is pretty basic. My present plan is to somehow to save the script's real-time output into a move-like file. I agree that the script should include commands to start and stop 'recording' its output.

Once I get a chance I'll make full use of your great information.

julianvb
 
Old 09-24-2014, 01:43 PM   #8
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Hi, schneidz,

I saw the following error when I executed the mencoder line from a short script.

Option lavcopts: Unknown suboption vocder
Error parsing option on the command line: -lavcopts


julianvb
 
Old 09-24-2014, 05:23 PM   #9
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
thats weird ? did you copy-pasta ?
(where did it get vocder from ?)

Last edited by schneidz; 09-24-2014 at 05:24 PM.
 
Old 09-24-2014, 09:27 PM   #10
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Hi, schneidz,

No, I didn't know anything about copy-pasta. I just entered your 'memcoder' line from the keyboard out of curiosity and saw this error message.

I am wondering if there's a brute-force harware way to capture my script's output via the computer's 15-pin display port.

julianvb

Last edited by julianvb; 09-24-2014 at 09:28 PM.
 
Old 09-24-2014, 10:25 PM   #11
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
by copy-pasta I meant typo.
you also typed in memcoder [sic] wrong.
 
Old 09-25-2014, 12:15 AM   #12
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Hi, Schneidz,

I meant mencoder. I still have the piece of paper on which I copied 'mencoder mf://*.jpg ....' The 'memcoder' typo was made when I wrote the reply in Post #10. Please see Post # 8, where I wrote 'mencoder'. Had I originally entered 'memcoder', Linux would have ignored the rest of the entire line.

I'm sorry about the misunderstanding. When one reaches my relatively advanced age of 80, typos would not surprise anyone or myself even though I still mow my fair-sized lawn once a week and troubleshoot various computer problems daily, without much difficulty. For some reason, I just can't resist the temptation of poking into new things whenever an idea or urge occurs to me.

julianvb

Last edited by julianvb; 09-25-2014 at 12:17 AM.
 
  


Reply



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
[SOLVED] log bash script output to file with timestamp daisychick Programming 11 05-08-2013 01:50 AM
Opening and saving an image file in a bash script Dralnu Programming 5 06-16-2009 01:23 PM
Extract audio from mov file sigma_50 Linux - Desktop 3 05-31-2008 02:35 AM
bash:output file names from shell script to vi sickboy Linux - Newbie 6 10-14-2004 03:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:14 AM.

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