JAV1.x - Creating an Alternate Universe

Casshern2

Senior Member...I think
Mar 22, 2008
7,017
14,455
How would you like to take a JAV title and reduce the filesize by around 30% (estimated) with little to no quality loss*. Or have a 10 minute video file that actually has 40 minutes of content. Sounds impossible? Maybe. But I don't think so. I'm currently working on a process to accomplish just that. I'm not creating a new tool or compression algorithm, no, nothing like that. I am nowhere near smart enough. You may have noticed me trying to "champion" JAV60 (60fps) encoding. Some have found the difference as amazing as I did and are actively enjoying it, and all using FREE tools. Same for this process. I believe you can theortically split the scenes from a title and create a single file containing all of them that can be played indepedently with their appropriate audio track, but with only one video stream.

JAV - 1 video stream, multiple audio streams --> JAV1.x

There some pretty big kinks to work out, to be sure. But I think it can be done. I will be posting examples and progress so long as I don't start pulling my hair out. A proof of concept has already been produced. I was floored. But those kinks are haunting me.

:study:

I will lay it all out as time permits. Do comment with ideas or impressions.

* if encoding to JAV60 - and yes there is always quality loss when encoding but with JAV60 the difference is negligible IMO
 

Casshern2

Senior Member...I think
Mar 22, 2008
7,017
14,455
Now before you think I'm crazy, understand my logic, as I think it is sound.

If I clip a scene from a standard SD JAV title that is, say, 720x404 -1500kbs

picture.php


encode it to 1440x808, which would be enough to fit that original resolution into the frame four times (two rows/two columns)

picture.php


the video quality would be just awful. There isn't enough bitrate in the world to make it look good. You can't upscale without quality loss, especially a file that is only at around 1500kbs. But, if you encode to 1440x808 and include that 720x404 resolution frame within one of the quadrants that makes up the 1440x808 frame

picture.php


the image is not upscaled but merely positioned within the larger video dimension. In theory there should be very little quality loss. So long as you encode up to or higher than the original bitrate the picture shouldn't suffer much at all, right?

A thing about bitrate (and stop me if I'm wrong), but the bitrate is what strongly influences the file size. You can encode a 1080p video at 8000kbs and have a fantastic picture. Do it again at 1500kbs and it looks horrible, but the file size is significantly lower than the FDH counterpart. The dimensions of the video have much less to do with the file size as some might think. Back to this later...

But as you can see and imagine, we are taking a clip with dimensions one fourth the size of our output and because the image's dimensions weren't changed we should be able to get away with using the same or slightly higher bitrate, thus, in theory, the file size should be not much higher than the original SD clip. In practice...why encode a 1500kbs source to 8000kbs. Won't make a difference in terms of increased quality at all.

And that is where I think this can really get interesting.
 

Casshern2

Senior Member...I think
Mar 22, 2008
7,017
14,455
Okay, time only permitted me to try a two video stack. So I took two 5 minute scenes from a title and stacked them to 720x808 (two videos of 720x404) and gave it the 60fps treatment minus the audio. Using MeGUI again I created two AC3 audio files from each clip.

picture.php


Now, until I can work out those kinks...had to do the following:

<separate assets>
stack_final.mkv (720x808 at 60fps 2000kbs no audio)
D76051a_5min.ac3 (top video's audio 192kbs)
D76051d_5min.ac3 (bottom video's audio 192kbs)

I use these avisynth scripts to play each:

To play top 720x404 area
a=DirectShowSource("stack_final.mkv")
b=DirectShowSource("D76051a_5min.ac3")
AudioDub(a,b)
Crop(0,0,720,404)


picture.php


To play bottom 720x404 area
a=DirectShowSource("stack_final.mkv")
b=DirectShowSource("D76051d_5min.ac3")
AudioDub(a,b)
Crop(0,404,720,404)


picture.php


Notice the names of the files being played at the top left of Media Player Classic: playTop.avs and playBottom.avs. The scripts at work. :please:

What AudioDub() does is combine the MKV file with the specified AC3 file. The Crop() allows me to see only the specified 720x404 region of the full stacked 720x808 frame that was produced. So when I open the avisynth script file (playTop.avs) with Media Player Classic I am presented with a 720x404 video (the top one) with the appropriate audio.

I chose a bad file to test with just to see if SD files can be given some appeal. :joker: Picture is kind of bad (1800kbs source). The resulting MKV was at 2000kbs. But those who know will tell you 60fps makes it look rather nice.

But here are the facts --

Source File1 - D76051a_5min.wmv 65.5MB
Source File2 - D76051d_5min.wmv 63.9MB
Source Total - 129.4MB

FinalFile - stack_final.mkv 72.5MB
AC3 File1 - D76051a_5min.ac3 6.86MB
AC3 File2 - D76051d_5min.ac3 6.93MB
Total - 86.3MB

Started with two 5 minute clips totaling 10 minutes in length and 129.4MB in size. Ended up with one 5 minute video clip and two 5 minute audio clips totaling only 86.3MB and the 1kb (per) avisynth scripts with which to properly play them. One 5 minute video...10 minutes worth of video.

Again, until I can figure out the scripting to have the MKV file with the video and both audio tracks included and be able to play the appropriate audio track this is what I'll be experimenting with. As of now there isn't a practical end result here. I'm sure many will believe there never will be. But for PC playback and sheer curiosity I'm going forward with it just to see if I can do it. :notagain:
 

Casshern2

Senior Member...I think
Mar 22, 2008
7,017
14,455
Notice also in the above screenshots the total clip time: 05:04 is shown on all. The stack_final.mkv is encoded with both scenes (video stream only) so they will play simultaneously. Using the scripts the same is happening, the full video is playing but you are only seeing either the top or the bottom region (clip) with the corresponding audio track. Hence one 5min clip if simply viewed, two 5min clips when viewed properly.

* Edit - ...and I forgot to mention the above sample would be considered JAV1.2. One video stream, Two audio streams
 

Casshern2

Senior Member...I think
Mar 22, 2008
7,017
14,455
Thank you to forum member lannalen for providing Ryushare links to GXAZ-006. This will serve as a good test for a full title encoding. The title already comes in two parts with two scenes a piece. Pick this one up! Saki Yuna is gorgeous!

This will be put through the JAV60 ringer along with my temporary separate asset viewing encoding process. It'll run tonight. I'll post the results some time tomorrow.
 

Casshern2

Senior Member...I think
Mar 22, 2008
7,017
14,455
Fail :notagain:

I'm hoping it has to do with the fact the title was already split. Didn't notice that they are slightly different when viewed by MediaInfo. The audio isn't synced at all. The tests I've done that have been working for me were done using a full title cut from one file.

I'll try again with a different title. Still THANK YOU lannalen!

Thank you to forum member lannalen for providing Ryushare links to GXAZ-006. This will serve as a good test for a full title encoding. The title already comes in two parts with two scenes a piece. Pick this one up! Saki Yuna is gorgeous!

This will be put through the JAV60 ringer along with my temporary separate asset viewing encoding process. It'll run tonight. I'll post the results some time tomorrow.
 

Casshern2

Senior Member...I think
Mar 22, 2008
7,017
14,455
I'm taking a break from this until I have time to research some advanced scripting techniques. I'm still hopeful this can work the way I think it can.

On a positive note, for my friend barba who likes to watch a screen full of multiple videos...encoding four scenes into one like shown in the original post works just fine. All you would need is the script to encode the four into one large frame and then mux the four audio files into it. Then you could watch all four at once and change the audio to the one you want to focus on.