View Single Post
Old 2nd November 2013, 20:18   #14  |  Link
Lenchik
Registered User
 
Join Date: Nov 2005
Location: Russia
Posts: 62
This is how i encoded some screencapture

How i've done Hi444PP 10bit VFR mkv
Source: YV24 or RGB screencapture done with virtualdub.

Source framerate was not completely constant, thus to sync with audio:
Code:
audiodubex(FFVideoSource(source=source, fpsnum=30000, fpsden=1000, threads=1), FFAudioSource(source=source))
To make some still video parts made of one frame multiplied i used ReMapFrames.
Code:
RemapFrames(filename="capture_RemapFrames.txt")
As i wanted VFR and Hi444PP in the resulting mkv Decomb521VFR and TIVTC (TFM + TDecimate) vfr making instructions couldn't help me. First of all because they don't support YV24. And as a second note i didn't find the way to erase really big parts of duplicated frames.
DeDup using idea was more intersting but probably had same problem with YV24 (didn't test actually).
I have found ExactDeDup, with YV24 support and DeDup ability to remove big blocks of duplicated frames.

I used it in two passes. First one to linearly "walk" through whole source:
Code:
#ExactDeDup 1pass
ExactDedup(firstpass = true, maxdupcount=80000, keeplastframe=false, dupinfo="dup.txt", times="ExactDedup_times.txt")
maxdupcount - maximum size of block with duplicated frames that wil be removed except first frame in block.
times - timecodes file for muxing with mkvmerge from mkvtoolnix to get VFR mkv file.
This first pass can be done either by "Run video analysis pass" of VirtualDub, or from commandline with avs2pipemod:
Code:
avs2pipemod.exe -benchmark capture.avs
In second pass i commented out first pass line of avisynth script and wrote second pass code:
Code:
#ExactDeDup 1pass
#ExactDedup(firstpass = true, maxdupcount=80000, keeplastframe=false, dupinfo="dup.txt", times="ExactDedup_times.txt")

#ExactDeDup 2pass
ExactDedup(firstpass=false, dupinfo="dup.txt")
As a result i've got avs source without duplicates. It had 16 thousand frames (compare with over 300 thousands of source frames).

While encoding in x264 i have found that using --tcfile-in option is breaking many resulting frames (tested on 2145 JEEB build, and 2358 and 2377 komisar builds). Solution is to mux timecodes in mkvmerge only.
This is how i sent video to x264:
Code:
"%avs2pipemod_path%" -rawvideo "%source1%" | "%x264-10bit_64_path%" --demuxer raw --input-depth 8 
--input-res 1280x960 --input-csp i444 --profile high444 --level 4.1 --preset veryslow --scenecut 80 --sar 1:1 
--colormatrix bt709 --transfer bt709 --colorprim bt709 --crf 19 --min-keyint 1 --vbv-maxrate 50000 
--vbv-bufsize 62500 --output-csp "i444" --frames 16080 --log-file 
"%source_path%%source_filename1%-log_type2.txt" --output "%coded_video1%" - 2> 
"%source_path%%source_filename1%-log.txt"
Next step was encoding sound to HE-AAC and muxing it with video and timecodes inside mkv file. It was an easy part.

Bottom line
Pros. One of the good features of that VFR is its small encoding time. I don't know yet about size compared to CFR encode (it is encoding right now.
Now to the cons. Bad support by players (or splitters+decoders - no matter from user side). MPC-HC 1.6.8 (without internal LAVFilters) defaults have some sound pauses while seeking and sometimes desync after seeking. LAVSplitter (internal for newest MPC-HC or external) read wrong size and even not start playing. AVSplitter (with potplayer) read wrong size but is OK with sound while seeking.

Last edited by Lenchik; 13th November 2013 at 19:14.
Lenchik is offline   Reply With Quote