KVCD using Menkoder?
http://www.digitalfaq.com/archives/error.gif
It is a template script, not interactive. If you are a developer (I'm a not) you can encapsulate into interactive script or GUI, gtk preferable. In the script you have at least to chose resolution width*height, fps (if you change them), mpeg (1 or 2) and vcd type for multiplexing and imaging. Video bitrate can be entered in commad line, so don't edit it. Edit the section between dash lines. The script is capable to scale into NTSC/PAL dimensions if the source is fit - width is used as a base to scale (with original aspect ratio), so scaled height have to be within allowed height for NTSC or PAL. It is assumed that you know xvcd and svcd specifications and familiar with mencoder options. (I've just checked on a stream capture that telecine from 10fps to 27.97fps is bearable, but still the problems with video-audion sync. The same situation with inverse telecine from 27.97fps to 25fps). |
Code:
#!/bin/bash |
Scaling to correct VCD and SVCD aspects is not implemented in this script. There is useful page about video resolutions and aspect ratio conversions:
:arrow: http://www.uwasa.fi/~f76998/video/conversion/ :arrow: http://hkfanatic.com/widescreen/ Currently I use the script for pre- and post-processing for XVCD and SVCD. If somebody can add scaling into the script? Code:
#!/bin/bash |
Russiansexpat:
You appear to be having an interesting discourse with yourself! Can you or someone else explain what it is you are talking about? :roll: |
Quote:
This is an advanced topic, and very good information :cool: This is related to Linux and Unix systems. -kwag |
Sorry, I guess this is just out of my league :oops:
I was just curious what he was talking about, as noone else was responding. |
|
:lol:
|
Quote:
I use the following: (you need mplayer-cvs for this) Code:
#!/bin/bash Quote:
|
Below is a version of the script with constant quality encoding, and I put some comments in the code.
It appears to be faster and easy to use, just watch output line of mencoder - last field of this line is a current encoding bitrate, and also in this line you can see estimated time of completion and file size, so you can terminate the script if you don't like them. Compression is improved, maybe because of ":naq:dia=2:last_pred=2" adaptive quantisation and motion prediction parameters. Currently I can fit 1.5 hour movie at SVCD resolution with vbitrate around 1200 kbps into single CD. Constant quality is less than 6. (some minor problem with maxrate - when you select high quality, the maxrate is exceeded; nevertheless tcmplex clipped bitrates to 2300 max and vcdimager didn't complain.) Code:
#!/bin/bash |
That is a really nice thread, got some ideas. But to give you something back, here some thoughts:
if you use mplayer-cvs you can do it like japie wroteabove: audio encoding directly with mencoder, but can using a three pass method, in which you only encode audio once and get a prediction in the end of the first pass, which gives you an estimation of the bitrate one should use for video encoding. This can be used for setting the vbitrate automatically (as this estimation isn't meant for kvcds, it probably must be trimmed somewhat). Also, you can use cropdetect and crop to get rid of the black bands and the scale and expand to have your aspect ratio correct. So here are my modifications of the vbr script for trying yourself: Code:
#!/bin/bash Have Fun with KVCD in Linux! Greetings, Neturmel |
Quote:
cropdetect is nice to have, but you looking only into for first 50 frames. For ppl who wants to automate something in this cript, try use http://mpgtx.sourceforge.net and tcscan for transcode to get inormation about the source. |
Hi,
in my case, expand just adds enough black bands (below and above the movie) to keep the original aspect ratio of the movie without the need for the player to get its aspect correct by itself (infamous "feature" of the windows media player). But honestly, that was only added by trial and error and by verifying the result on different hard- and software players. So it is possible that it is utterly useless for anyone else... Cropdetect on only 50 frames is no problem if you only encode the main movie. If there are trailers or menus etc. , you certainly should use more frames. Otherwise, the bands really shouldn't change in the main movie. But if you really want to be sure that your crop parameters are correct, just do it for 10min of movie ( would be at most 30*60*10= 18000 frames ) 2) By coincidence, I just started to test mpgtx myself (for splitting movies longer than the size of the CD before burning). Works well for mpeg1, but not for mpeg2. P.S.: Since I make KVCDs out of VDR-Recordings, I have found vdrsync.pl (http://vdrsync.vdr-portal.de) for remultiplexing and joining of cutted VDR material extremely useful (also uses parts of transcode) Hope that others won't find this just boring... neturmel |
Another hint:
it really seems that by using 2-pass encoding and vqscale=2 in the first pass, you really hit your vbitrate value for the second pass pretty perfect, so it should be possible to use the predicted bitrate for the planned CD size which was printed in the first (audio encoding) pass, see above. But have to test a little bit further... Greetings, neturmel |
"The audio stream must be MPEG-1 layer II, with a bit-rate ranging
from 32 to 384 kbits/sec bit-rate (i.e. the audio stream _is_ allowed to be VBR!) with up to 2 stereo or 4 mono channels, or 1 extended MPEG-1/2 multichannel (5+1) surround sound stream." -- http://www.vcdimager.org/pub/vcdimag.../vcdimager.txt Thus the script now uses toolame for audio encoding, http://mikecheng.d2.net.au/ also toolame can encode joint stereo and use diffrent acoustic models. If you choose AUDIORATE in editable section equal "VAR" the script will downsample frequency to 22050 Hz and encode with variable audio bitrate in 8 - 160 Kbps band. Audio is still stereo! See results below in this thread. mplex from http://mjpeg.sourceforge.net/ is used for multiplexing audio and video (tcmplex can't handle variable rate mp2) and it is not bad after all, you don't have to install heavyweight transcode package. Code:
#!/bin/bash |
I've been doing some testing and must say that 2-pass encoding doesn't change much... (in the mencoder a+v commandline), it only broke a/v_sync (as reposted on mailinglist)
vbr mp2 is actualy very interesting, anyone now how to handle it with mencoder? |
1) Just bumped into the ugly fact that tcmplex can't multiplex variable rate mp2 properly, so I'm switching to mplex usage.
Unfortunately, mplex rely on mpeg2enc to insert sequence break points. mplex option: -S This option specifies the maximum size of output files in MBytes (2^10). The default is 2000 Mbytes (splitting output before 2G limits can hit). When the limit is reached a new file is started. Note: This option is _n_o_t suitable for splitting a long video across multiple VCD's or SVCD's. It simply splits a single long sequence into in a way that prevents bits of a video GOP(group of pic* tures) or audio frame being split between chunks. frame reasonable. This is fine for formats like that used for DVDs where all stream parameters appear every GOP. However, for VCD / SVCD it won't work as the players expect each file to start a new MPEG sequence. For VCD / SVCD a different technique is used. If mplex encounters a sequence break (sequence end followed by start) in the input video stream it starts a new output stream and file at the sequence start. Thus to split a long video across VCD's/SVCD's you have to get the MPEG video encoder to introduce sequence splits at the right points (see mpeg2enc(1) for details of how to do this). I just ignore suggested mpeg2enc and use -S option of mplex. It works. 2) Limitations of toolame encoding: Bitrate Ranges When making a VBR stream, the bitrate is only allowed to vary within set limits: 48kHz Stereo: 112-384kbps Mono: 56-192kbps 44.1kHz & 32kHz Stereo: 192-384kbps Mono: 96-192kbps 24kHz, 22.05kHz & 16kHz Stereo/Mono: 8-160kbps It is expected in VCD and SVCD that sampling rate is 44.1 KHz; it is nice to have variable lower bitrates, so the question is: can we stretch VCD/SVCD standard by using 48kHz dvd standard? Can standalone players handle that? ..Resampling from 44.1KHz to 48kHz is bad quality with standard tools, so I put resampling to 22kHz instead. This is test on 1.5 hour film: with stereo: VBR stats: 8 16 24 32 40 48 56 64 80 96 112 128 144 160 186 0 16 31 138 494 1104 2025 8672 19671 38521 21557 2752 336 Avg slots/frame = 705.675; b/smp = 4.90; bitrate = 108.056 kbps with joint stereo: VBR stats: 8 16 24 32 40 48 56 64 80 96 112 128 144 160 186 0 16 40 153 544 1242 2260 9837 24930 42033 13886 376 0 Avg slots/frame = 681.046; b/smp = 4.73; bitrate = 104.285 kbps The result is very good dispersion (not distortion) of audio bitrate. |
Quote:
However, if you do testing, maybe you can try vrc_eq= option mencoder, that is to specify rate control depends on the source. Quote:
|
Hi,
yes, acknowledged, 2-pass encoding doesn't change much, so one pass can be dumped. I just did a one pass encoding (first one pass audio) of a 90min movie using the mencoder predicted bitrate for a 650MB CD and hit (or should I say missed) the target with a bin file of 742MB. It is more than 50MB short of the CD capacity, so next time, I'll try the 700MB value and keep you informed. VBR Audio encoding directly with mencoder (with lavc=ffmpeg) is not possible at the moment :( Is VBR Audio encoding valid for a DVD ? To meet DVD recommendations, a sample rate of 48kHz is a must, but what about VBR ? Most DVD-Players play (S)VCD with 48kHz audio without any problem and as I sometimes burn those mpegs to DVD, I only encode with 48kHz audio, so that I don't have to reencode audio. BTW: My cheapo DVD-Player also plays (S)VCD and DVD with MP3 (also VBR) Audio, but since I like to encode to be compatible with more than my player, I don't use that. |
"Is Variable Bit Rate allowed in MPEG-1 Audio?
For Layer III, the answer is simply 'yes'. The average bit rate is the one given in the header of a Layer III frame, but as the bits may be distributed over several frames, this effectively implies a variable bit rate. For Layers I and II, according to the standard, it is not mandatory for decoders to support Variable Bit Rate (VBR). However, in practice the majority of the decoders do support Variable Bit Rate, and it is perfectly in line with the standard to specify for a certain application that decoders should support VBR. This is implemented by specifying for each audio frame separately the bit rate at which it is encoded. " -- http://www.chiariglione.org/mpeg/faq...mp1-aud.htm#15 As for DVD Book: http://www.mpeg.org/MPEG/DVD/Book_B/Audio.html it does not say that audio should be constant rate. SVCD specifications explicitely state that audio bitrate can be variable. So, if you see SVCD sticker on a DVD player and it does not play variable rate audio, you can take seller/vendor for legal ride. Of course, before that you have to purchase copy of ISO/IEC 13818-3 (MPEG-2 Audio) ISO/IEC 11172-3 (MPEG-1 Audio) Dolby AC-3 standard from ISO baggers, CHF44 each. As for DVD, you know, you are only allowed to play your region DVDs and pre-approved by Bill Hates. http://www.digitalfaq.com/archives/error.gif |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.