the details of what I'm trying to do and the progress so far are in this thread. https://forum.videohelp.com/topic353687.html But my problem is with the conversion.
basically the subject says it all. I have two jpegs. They start at 3072x2304. Both have been converted to 704x480 for use as SVCD stills and look fine at the resolution (with intended distortion b/c of rectangular tv pixels). I convert them to m2v so that I can later mux them in with audio commentary into an mpg.
conversion is done using the following commands for resizing and encoding
All conversions work, and the resulting svcd plays in the dvd player fine. The problem is that certain images are horrible quality. Others are perfectly fine. The filesize of the bad quality pictures is 16K to 32K. certain 48K pictures look beautiful. Max size is 148K.Code:# convert to 704x480 convert -geometry '704x480!' -quality 100 $file svcd/$file # convert to m2v mpeg2 stills jpeg2yuv -v 0 -f 29.97 -j $file -I p -n 1 | \ mpeg2enc -v 0 -a 2 -T 200 -n n -f 7 -o mpgs/m2v/${file%.JPG}.m2v # mux with audio mplex -f 7 $m2v $mp2 -o $dest
Why is there such a huge difference? Can I add some options to mpeg2enc to make the process generate more uniform quailty? I've included an example m2v attached for your reference.
Thanks
Bill
img_0104.m2v
+ Reply to Thread
Results 1 to 8 of 8
-
-
If mpeg2enc supports custom quantization matrices,
try a matrix that compresses less then the default one.
HTH. -
Would it be possible to start with a less compressed image? or lossless compression like a .png as opposed to a .jpg? I don't know the command line for this
-
That's an idea. Although jpeg2yuv pipes raw yuv uncompressed data out, the picture does go through a jpeg compression at a relatively low resolution before (704x480). I could use ppm2yuv (or something like that). Also, I'm not sure if setting -q 3 is the same as a custom quantization matrix, but I had tried that to no avail. I will look into both. Thanks.
Bill -
OK update. After much wrestling with ppmtoy4m, I finally got it piped successfully into mpeg2enc. However, the results were exactly the same, much to my dismay. I decided that I would have to try the custom quantization matrix (qm).
It turns out that the qm is merely a threshold matrix that is applied to the DCT of an 8x8 section of the image. A threshold number is given to each frequency block. High frequency data usually has a higher threshold. If the threshold is not exceeded, then the data is ignored.
mpeg2enc accepts a custom qm through the -K file=<filename> parameter. I couldn't find any information about the syntax of the file, so I ended up going to the source code. (woot for open source).
The custom quantization matrix file for mpeg2enc should be a comma delimited list with 8 ascii numbers per line, terminated by a \n. Inter and Intra come right after one another.
I decided to try the extreme case and put all 1's. This gave beautiful results. My 16K image is now 44K, and it looks great. Problem solved.
Thanks
Bill -
We're glad you managed to solve your problem.
mpeg2enc accepts a custom qm through the -K file=<filename> parameter.
I couldn't find any information about the syntax of the file, so I ended up
going to the source code. (woot for open source).
-K|--custom-quant-matriceskvcd|tmpgenc|default|hi-res|file=input-file|help
Specify which quantization matrices to use instead of the defaults
(which can be specified by using "-K default"). Using "-K hi-res" is
identical to using the -H option. The value kvcd uses the Kvcd.Net
matrices from http://www.kvcd.net/; the value tmpgenc invokes the
TMPGEnc matrices from http://www.tmpgenc.net/e_main.html.
On average (this depends on the source material), the tmpgenc tables
reduce the average bitrate by about 10% and the kvcd tables
reduce bitrate by about 16% (compared to the default tables).-H|--keep-hf
Setting this flag makes the encoder encode as much high-frequency
information as possible. This is a good setting for maximising quality
at VCD resolution with good quality low-noise source material.
It can also help with "swimmy" material if you can spare the bitrate! -
it is hard when documentation isn't great. But I'm just glad that we've got people to program this stuff, because I sure couldn't.
-
fyi, although it's not in the man page, running
Code:mpeg2enc -K help
Code:$ mpeg2enc -K help Quantization matrix names: help - this message kvcd - matrices from http://www.kvcd.net hi-res - high resolution tables (same as -H) default - turn off -N or -H (use standard tables) tmpgenc - TMPGEnc tables (http://www.tmpgenc.com) file=filename - filename contains custom matrices 8 comma separated values per line. 8 lines per matrix, INTRA matrix first, then NONINTRA
Similar Threads
-
Reliable Streaming Options [Linux]
By chiorigreene in forum Video Streaming DownloadingReplies: 0Last Post: 19th Apr 2012, 12:10 -
How to Author an SVCD with menus and stills Under GNU/Linux
By khey in forum User guidesReplies: 1Last Post: 24th May 2011, 23:35 -
PS3 needs full firmware update to play new BD but removes Linux. Options?
By gll99 in forum DVD & Blu-ray PlayersReplies: 22Last Post: 18th Jan 2011, 01:39 -
X264 encode switches/options retrieval
By padiwa in forum Video ConversionReplies: 2Last Post: 11th Jan 2010, 09:28 -
Large size difference in mov and mpg, no apparent loss of quality.
By prioryjim in forum Video ConversionReplies: 3Last Post: 20th Dec 2009, 09:19