Sponsored Content
Top Forums Shell Programming and Scripting Help on shell script (string operations) Post 302443215 by KenJackson on Saturday 7th of August 2010 02:39:34 PM
Old 08-07-2010
Maybe this.
Code:
#!/bin/sh
cd "$1"  ||  { echo "Arg 1 must be a directory" 2>/dev/stderr; exit 1; }
OPTIONS="-oac mp3lame -lameopts cbr=128 -ovc xvid -xvidencopts bitrate=1200"
for f in *.mkv; do
    AVI="${f%.*}.avi"
    mencoder $OPTIONS "$f" -o $AVI
done

${f%.*} prints the contents of $f with everything stripped off from the last period to the end.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

String Operations

Hi All, Query 1 : I want to know how we can get a count of multipe occurrences of a particular expression in another string. For Eg. If my string is " 12" and i need to count the number of spaces preceeding 12 Query 2 : Also want to know how we can change the alignment of a... (9 Replies)
Discussion started by: Rohini Vijay
9 Replies

2. UNIX for Dummies Questions & Answers

AlphaNumeric String Operations

Hi :) I am writing a ksh I have a string of general format A12B3456CD78 the string is of variable length the string always ends with numbers (here it is 78.. it can be any number of digits may be 789 or just 7) before these ending numbers are alphabets (here it is CD can even be... (3 Replies)
Discussion started by: lakshmikanth
3 Replies

3. Shell Programming and Scripting

Unix file operations(shell script)

Hi, I want to compare two files. Files will look like as follows: file1: ASDFGHJU|1234567890123456 QWERTYUI|3456789098900890 file2: ZXCVBVNM|0987654321234567 POLKIJUYH|1234789060985478 output file should be: ASDFGHJU|1234567890123456 QWERTYUI|3456789098900890 Thnaks in advance (6 Replies)
Discussion started by: nivas
6 Replies

4. Shell Programming and Scripting

file operations in shell scripting

hi All, my query... 1.I Have to search for the files in the root directory. 2.i have to search for a pattern in all the files in the root directory and then replace them with a new pattern. 3.Rename the file Explanation: if ABC is the root folder and has 3 subfolders and there are 15... (9 Replies)
Discussion started by: adityamahi
9 Replies

5. Shell Programming and Scripting

String operations

Hi All, can you tell me how to drop all preceding zeros in a number. For example, if i have a numbers like 000876838347 and 0000007854762543..how to make them as 876838347 and 7854762543. (6 Replies)
Discussion started by: nram_krishna@ya
6 Replies

6. Shell Programming and Scripting

String operations

Can you give me some suggestions to split below string into three parts using shell scripts.. Script has to print all alphabets before the number, then number and then all alphabets after the number.. input: chris martin 200173 845747 mech engineer output: chris martin 200173 845747 mech... (6 Replies)
Discussion started by: nram_krishna@ya
6 Replies

7. Programming

shell cursor operations

Hi I need to save the actual cursor position into variable in my script. How can I do it ? thx for help. (1 Reply)
Discussion started by: presul
1 Replies

8. UNIX for Dummies Questions & Answers

Comparing a String variable with a string literal in a Debian shell script

Hi All, I am trying to to compare a string variable with a string literal inside a loop but keep getting the ./testifstructure.sh: line 6: #!/bin/sh BOOK_LIST="BOOK1 BOOK2" for BOOK in ${BOOK_LIST} do if then echo '1' else echo '2' fi done Please use next... (1 Reply)
Discussion started by: daveu7
1 Replies

9. Shell Programming and Scripting

Shell operations from C++

Hi everyone, I need little help in shell operations from C++ program. Here I furnish the details of problem: 1. Lets say my current working path is myWorkingPath. 2. In my working path I have list of name directories and each name directory has two more sub directories say A/B. (now path to... (5 Replies)
Discussion started by: linuxUser_
5 Replies
yuv2lav(1)							MJPEG tools manual							yuv2lav(1)

NAME
yuv2lav - encodes lavtool's raw YUV frame streams into MJPEG files SYNOPSIS
yuv2lav [-f a|A|q|m] [-q num] [-b num] [-I num] [-m num] [-v num] [-w file] -o output-file DESCRIPTION
yuv2lav is a simple MJPEG encoder for raw YUV frame streams as they are emitted by lav2yuv(1) or lavpipe(1), for example. It reads its input from stdin and is capable of writing AVI and Quicktime. OPTIONS
The command line options allow to specify the output file name, JPEG encoding quality and the amount of memory that will be allocated for JPEG compressed data. -o output-file This (compulsorary) option sets the name of the file that yuv2lav will write its output to. If the output file contains a % (e.g. file%02d.avi), the output will be written to multiple files in case this is necessary (file00.avi, file01.avi and so on). -f a|A|q This sets the output file format, which has to be one of a - for AVI file output, A - for AVI with reversed fields, q - for Quicktime output or AVI with reversed field of course only makes sense if yuv2lav's feed is an interlaced video source and should only be needed if you experience frame reversal problems in your output. If you don't use that option yuv2lav will set the output format to AVI if the last 3 char are avi, or to Quicktime if you use mov. If you use the -f option it overides the setting in the filename -q num This option specifies the JPEG encoding quality as passed through to libjpeg. The default value is 80, num must lie within 24...100 inclusive (think of it as percentage values, although with a lossy compression algorithm like JPEG, keeping 100% of the original quality is of course not really possible). -b num This option specifies the size of the buffer (in kBytes) that yuv2lav allocates in order to store the compressed JPEG data in it. The default value (256k) is perfectly enough for 100% quality full sized PAL/NTSC, but if you want to compress Super-Mega-HDTV or if you are low on memory, you can use this option to suit your needs. -m num This is the maximum size (in MB) per file. Normally this depends on the output file type. -I num Force a specific interlacing type. 0 means no interlacing, 1 means top-field-first, 2 means bottom-field-first. -w file This is the WAV file containing audio data to be combined with the video stream into the output file. -v num Verbosity level. 0 means only print error messages, 2 prints full debug output. -? Display a synopsis of the command syntax. EXAMPLES
lav2yuv movie.avi | yuv2lav -fq -q 30 lowbitrate.qt would recompress movie.avi as a low bit rate Quicktime file. lavpipe input.pli | yuv2lav -q80 output.avi would save the movie assembled by lavpipe as a single AVI file. BUGS
If you experience any problems with this tool, please feel free to contact the developers (see below). AUTHOR
This man page was written by pHilipp Zabel. If you have questions, remarks, problems or you just want to contact the developers, the main mailing list for the MJPEG-tools is: mjpeg-users@lists.sourceforge.net For more info, see our website at http://mjpeg.sourceforge.net/ SEE ALSO
lav2yuv(1), lavpipe(1), lavplay(1), lavrec(1), mpeg2enc(1), yuvscaler(1) MJPEG Linux Square 2 June 2001 yuv2lav(1)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy