FYI:
Just terminated an encoding using mencoder predicted 700MB bitrate: a perfect hit with 793MB .bin ! So if you are heading for 1CD-KVCDs perfectly filled, try it this way! (only true for CBR audio...) Greetings, neturmel |
Quote:
Most of audio bitrates will gather around 192 kbps, but depends on audio demand they can go up and down in a band 112-384kbs. http://www.digitalfaq.com/archives/error.gif |
Code:
#!/bin/bash |
Quote:
Actualy I can't find ANY setting wich changes much to the libavcodec quality, even changing max and min bitrates doesn't change that much (unless using very weird values) |
This version of the script uses mencoder 1.0pre3, it is availabe now in source and rpm. Mencoder now is capable to encode mp2 audio.
The script contains part with encoding to variable mp2 with resampling to frequency 48kHz in 112-384kbs band; usually, audio encoded around 160kbs with good audio rate dispersion. Other important changes: vrc_eq=tex:vrc_buf_size=$VBuffer (default parameters maybe not good for xvcd, svcd encoding). mbd=1 (previously mbd=2 produced streams with bitrate spikes, not suitable for multiplexing). You can experiment with vrc_eq, mbd, mbcmp parameters - maybe you can find better. So far, I have achieved 1CD fit for 480*576 mpeg2 of 1h23m movie video quality 4, gop 15, audio 192. Code:
#!/bin/bash |
:bugeyes:
Changes in -lavcopts string and minimum video quality. Depends on video source, the script sometimes failed to produce valid stream, becase of video bitrate control - bitrate going over the top and therefore video/audio failed to multiplex. Code:
#!/bin/bash |
Quote:
|
I use mplex (or tcmplex) to split the result into multiple CDs
and for separate audio encoding with variable audiorate. By the way, do you know any video bitrate viewer in unix? |
Apparently root of previous reported problems was broken audio-video sync in a source avi file.
In my case, the source has 24.999 frame rate instead of standard 25 fps PAL, it is enough to cause the problem of audio/video sync encoding. It appears that use of the same algorithm for decoding and encoding can fix frame rate deviation from ugly encoded source (see idct=0 in -lavdopts and -lavcopts). I still use mplex, because tcmplex produced muted audio with variable audio rate, however tcmplex is more tolerant to input video/audio files. Also, I have restored vqmin=2, added :vmax_b_frames=1:vb_strategy=1 encoding with B frames and :tcplx_mask=0.05:scplx_mask=0.05 quantisation adjustment to complexity (have to be used with :naq). Video buffer is default size, but you can increase it. Code:
#!/bin/bash |
Added expand to scaling, changed order in video processing chain, because frame rate conversion and video filters like denoise should be done before frame resolution scaling.
Video buffer size for encoding and multiplexing is 46Kbytes for XVCD and 112 Kbytes for SVCD (46/112 is approximately 1152/2778 video+audio bitrates for XVCD/SVCD). If you have buffer underruns warnings during multiplexing, you can try to increase video buffer size. Usually you can encode 1h30min movie as SVCD mpeg2 480x576 resolution with variable audio rate around 160kbps and video quality 5 or even 4 to fit single 80min CD. Code:
#!/bin/bash |
I have added audio filter to the script, it is requred if source have audio sample rate different from 44.1kHz.
I use variable audio rate encoding, but keep the section with standard frequency 44.1kHz for purists. To say again, variable audio is completely according to SVCD standard (the only deviation from the standard that I use frequency 48kHz like dvd) and it is playable on every standalone I tried. I have added crop option for sources with ugly black bands; use extend option according to aspect view you choose, for example use 480:360 if aspect ratio is 4/3. Template script below is mpeg1 encoding; with celeron 933mHz and RAM 512MB the speed of encoding is 1x movie time. Code:
#!/bin/bash |
First off, thanks for these excellent scripts.
I have tried out your latest version (posted Dec.29) w/o any success in multiplexing. I get: ++ WARN: [mplex] Stream e0: data will arrive too late sent(SCR)=41652225 required(DTS)=41609503 ++ WARN: [mplex] Audio c0: buf= 4096 frame=017695 sector=00002742 ++ WARN: [mplex] Video e0: buf= 45075 frame=011555 sector=00025060 **ERROR: [mplex] Too many frame drops -exiting Any ideas as to what causes this or what parameter I can change? I am doing VCD mpeg1 encoding w/ CBR audio of 96 |
I using that script but audio have delay ....
U no have these problem ? |
Yes, I have had a problem with video and audio out of sync (slightly), but since the last verson of the script with "-srate 44100" and "-af resample=44100" the problem is gone.
If you read mencoder manpage, it is saying the -srate option adjusts video frame rates according to audio frequency. In all my cases video and audio out of sync was caused the the source (avi file) had a frame rate slightly diffrent from the standard, for example 24.999 fps instead of 25 fps. As result, I think, video got out of sync after splitting mpg file into video and audio and then re-multiplexing. If you do only constant audio bitrate it is not necessary to split video and audio, resample audio into 48kHz and encode into variable audio bitrate; just take .mpg file produced by mencoder and create .bin and .cue with vcdimager. I think that DTS and SCR delayes gettig out of hand because video buffer (see corresponding varibale in the script) become too small for incoming video packets. There is no standard specs for the size of video buffer, so it can be changed and 46KB and 112KB buffer sizes is far too low then all moder standalones buffer memory. I'll try to keep you posted and if you can run some tests, the help is appreciated. Because current results are promising; I just encoded 2h07m movie into standard SVCD quality 5 with resolution 480x576 and gop 25. and i use varibale audio bitrate with toolame encoder, so audio quality is excellent and if you use mctoolame audio encoder you can put 5.1 surround audio (unfortunately i don't have this audio at home, only left-right and subwoofer). |
russiansexpat, thanks ... can u copy the last script here ?
I am using script mkxvcd.sh you know this ? in your opinion its good ? Thanks again :D |
mkxvcd.sh script is interactive script, and of course it is good - a few people worked it out in kvcd4nix project. It is based on mjpegtools (and optionally transcode). encoder mpeg2enc in fact is origin of tmpgenc (another name tsunami) for windose folks and currently have K-matrix option.
Still it is at least twice slower than mencoder or ffmpeg. I was trying to create a script that it is using just one mencoder/ffmpeg library because the number of option in mencoder is many and allow to tune the result (see ulavcopts options in my script). If you are not interested in VBR audio, you don't have to re-multiplex video/audio and also you can use tcmplex instead of mplex or original mplex from http://www.linuxtv.org/download/dvb/ it multiplexes prefectly, but can't handle vbr audio, only constant bitrate audio. Current verson of my script is below: Code:
#!/bin/bash |
Correct me if I am wrong, but tcmplex can't split the mpg for multiplexing over several CDs, only mplex can do that?
|
Of course, tcmplex also can split mpeg files into multiple CDs.
Look at my modifications of these 2 scripts (please pass respects to original authors): http://dvdripping-guid.berlios.de/fo...?t=157&start=1 they entirely based on mjpegtools and use tcmplex for multiplexing. I fully tested them but then start using K-matrix and mencoder. |
Note, in new version of mplex (1.6.1.92)need remove "-m" in that lines :
SVCD MUXMODE="-f 5 -m 2 -V -b 112" VCD MUXMODE="-f 2 -m 1 -V -b 46" |
This is a release of the script, version 0.2.
I have tested it on many avi files and tv captures. For example, in a last test on tv capture 320*240 wmv the script fitted single 80 min CD with 150 minutes quality=4 of standard vcd mpeg1 at 1.4x speed on celeron 933MHz. It is working with both cbr and vbr mp2 audio; you can take out normalize out of the script and feed toolame from fifo pipe, but I found normalize is significantly improving soundtrack hearing. Compared to the previous version vlelim and vcelim quantisation thresholds have been taken out, and trell quantisation has been added. I put compulsary parameters in capital caps and optional parameters in small cups in editable section; however optional parameters worked well on all sources. Code:
#!/bin/bash |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.