Solved

Error in Linux Shell Programming ...

Posted on 2004-08-09
8
673 Views
Last Modified: 2008-01-09
Dear Experts,

 I have a problem while convertimg  ppm image files to YUV format.i have these commands:

export dir="out1/"
(
i=0
for file in `find $dir -name "out1*" |sort`
    do
        i=0
        x=10
        cat $file
    done
)|ppmtoy4m -F 25:1|mpeg2enc -f 8 -o exp.m1v

I am giving ppm images as INPUT and after some calculation(in C Language) i am making OUTPUT images to "out1" folder. With the above commands, i am getting "bad raw ppm magic number" error when piped to ppmto4ym command.

I have p6 format for ppm images. Size of the image is: 776*602

I am a newbie for Linux Shell Commands. Is this the Right section for this Question ? Please tell me if i am not clear in my explanation. Thanks for any reply.
0
Comment
Question by:ldbkutty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 3

Accepted Solution

by:
pYrania earned 250 total points
ID: 11750888
Try the following:

cd ${dir}
ls out1* | sort | xargs -n1 ppmtoy4m -F 25:1|mpeg2enc -f 8 -o exp.m1v
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 250 total points
ID: 11758962
To make your script work more reliable, you need to do:

DIR="/path-to/out1"
cd $DIR
ls -1 out1* | sort | xargs -n1 ppmtoy4m -F 25:1|mpeg2enc -f 8 -o exp.m1v

Please remember give credit to pYrania (http:#11750888).

Cheers!
0
 
LVL 32

Author Comment

by:ldbkutty
ID: 11760178
pYrania

Thanks for ur reply.....i have had no chance to try yesterday..i will check it tonight and come back to u tomorrow..

bye....
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Author Comment

by:ldbkutty
ID: 11768286
i am gettng : "Horizontal size is greater than permitted in specified level " in the command mpeg2enc -f 8 -o exp.m1v

if i remove -f 8 in the above command, i am getting a warning msg as: "Error reading from header(1) : code parameter out of range."

Could you please tell me what might be the problem?

Thanks for your patience.
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 250 total points
ID: 11769103
Size of the image is: 776*602 is outside the 720x576 frame size permitted at MPEG-2 [EMAIL PROTECTED] !

see:
http://www.mail-archive.com/mjpeg-users@lists.sourceforge.net/msg04065.html
0
 
LVL 32

Author Comment

by:ldbkutty
ID: 11781595
even though i have some more questions, my question has been answered. so, i will accept your answers now and will post a new question later.
thanks again.
0
 
LVL 32

Author Comment

by:ldbkutty
ID: 11869257
Dear experts

i  tried for the scaling of the image using y4mscaler
            ls -1 dimas* | sort | xargs -n1 ppmtoy4m -F 25:1 | /y4mscaler-0.6.2-bin/y4mscaler -I sar=1:1 -O sar=PAL -O size=704*576 | mpeg2enc -f 8 -o video1.m1v

but i have some errors
            ERROR: Could not read YUV4MPEG header: system error (failed read/write)!
           xargs: ppmtoy4m: terminated by signal 13

what is this xargs terminated by signal 13  means and how should i solve it  

 i have installed the y4mscaler ...but it also says
           /y4mscaler-0.6.2-bin/y4mscaler: No match.

could you please tell me what is this problem all about and how to tackle it.
thanks for your patience
0
 
LVL 38

Expert Comment

by:yuzh
ID: 11878923
You can try to use "ppmtoy4m" to test convert one to see if there is any problem.

also:
ls -al /y4mscaler-0.6.2-bin/y4mscaler

see what you get, if the file permissions is correct, then try to test convert just one file
to make sure that your commandline syntax is correct.
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question