Hi, please,
dealing with half a day but still a lot of problems, I have this script:
havent found "decomb.dll"Code:SetMemoryMax(8192) LoadPlugin("C:\Cesta\k\AviSynth\plugins\decomb.dll") inFile = "C:\!temp\avatar.mkv" outFile = "C:\!temp\avatar2.mkv" video = ffvideosource (inFile) left = video.SelectEven() right = video.SelectOdd() stacked = StackHorizontal(left, right) interleaved = Interleave(left, right) filtered = decomb(interleaved) stacked.Trim(0, video.FrameCount-1, 0) filtered.Trim(0, video.FrameCount-1, 0) final = Interleave(stacked, filtered) x265Encoder("c:\Apps\x265\x265.exe", final, outFile, crf=18, preset="slow", tune="ssim", frames=video.FrameCount, fps=video.FrameRateNum/video.FrameRateDen, threads=16)
so fails on: decomb, trim etc.
I'm a newbie, sorry
+ Reply to Thread
Results 1 to 26 of 26
-
-
Thank you!
Does this code choose only odd lines for the left and even lines for side right? Resize is unfortunately not enough. -
It assumes progressive SBS video as a source and re-arranges the 2 pictures as OU, 1920x1080.
"Lines" are not relevant.
If your 3D source is line interleaved rather than SBS then you would need another script of course. -
Thx. I watched full sbs made to just full ou and it really wasn't visibly so sharp. Surely correct odd rows for left and even rows for right gives better sharpness.
Is any way how to incorporate this into your code like the "field" function in ffmpeg?
Found this solution with ffmpeg:
Code:!seperate left and right ffmpeg -i avatar2.mkv -vf stereo3d=sbsl:ml -an -sn 1_L.mkv ffmpeg -i avatar2.mkv -vf stereo3d=sbsl:mr -an -sn 1_P.mkv !keep just odd and even rows ffmpeg -i 1_L.mkv -vf field=type=top 2_LH.mkv ffmpeg -i 1_P.mkv -vf field=type=bottom 2_PH.mkv !join and create half top OU ffmpeg -i 2_LH.mkv -i 2_PH.mkv -filter_complex vstack=inputs=2 3_HOU.mkv
Last edited by maysider; 6th Feb 2024 at 06:55.
-
Last edited by Sharc; 6th Feb 2024 at 07:10.
-
but does my or yours reduce the quality of the movie or is it just basically a copy?
oh, from a 21GB full SBS movie is cut left side with just 2.6GB without sound. What is wrong with this code? Why is the left side almost 10 time smaller when it should be around half the size? Level of AVC is changed from 5 to 4, does it mean anything?
Code:!seperate left and right ffmpeg -i avatar2.mkv -vf stereo3d=sbsl:ml -an -sn 1_L.mkv
Last edited by maysider; 6th Feb 2024 at 08:54.
-
You should compare apples with apples.
Your frame size is 960x1080, my script is for 1920x1080.
The file size depends on the compression. You selected crf 23 (default value of x264 AFAIK) which is pretty strong. -
no, from the full sbs 21GB 4Kx1K is cut just the left side and it is now 1920x1080 with 2.6GB. I didnt select crf. I thought it would just copy the stream not to compress and destroy the quality by every step I do
Last edited by maysider; 6th Feb 2024 at 09:51.
-
You didn't specify the crf so the encoder just used its default which is crf 23.
Secondly you compress the video twice: First for creating the left (right) views and then again to create the OU view. The intermediate views should be encoded lossless (or "visually lossless") to preserve the quality. -
so should I use this? or lower crf for standard high quality?
Code:! 1 - separate ffmpeg -i avatar2.mkv -vf stereo3d=sbsl:ml -c:v libx264 -crf 18 -an -sn 1_L.mkv ffmpeg -i avatar2.mkv -vf stereo3d=sbsl:mr -c:v libx264 -crf 18 -an -sn 1_P.mkv !2 - remove rows ffmpeg -i 1_L.mkv -vf field=type=top 2_LH.mkv ffmpeg -i 1_P.mkv -vf field=type=bottom 2_PH.mkv !3 - merge ffmpeg -i 2_LH.mkv -i 2_PH.mkv -filter_complex vstack=inputs=2 -c:v libx264 -crf 18 3_HOU.mkv
The result is correct: from 4Kx1K to the final result 2Kx1K (in detail 1920x1080)Last edited by maysider; 6th Feb 2024 at 10:18.
-
Or try something like this (for 1920x1080 frame size):
Code:ffmpeg -i "%~1" -vf "crop=iw/2:1080:0:0,scale=w=1920:h=540,setsar=1:1" -c:a copy -c:v libx264 -crf 0 "left.mp4" ffmpeg -i "%~1" -vf "crop=iw/2:1080:960:0,scale=w=1920:h=540,setsar=1:1" -c:a copy -c:v libx264 -crf 0 "right.mp4" ffmpeg -i "left.mp4" -i "right.mp4" -filter_complex:v "vstack" -c:a copy -c:v libx264 -crf 18 "OU_.mp4"
-
The quality suffers anyway when you convert from Full SBS to OU because the verical resolution is halved.
-
so you really helped me a lot, thank you! I havent found how to like your coments!
-
Most simple is probably (for 1920x2160 OU):
Code:ffmpeg -i "%~1" -vf stereo3d=sbsl:tb2l -c:a copy -c:s copy -c:v libx264 -crf 18 "OU.mp4"
Code:ffmpeg -i "%~1" -vf stereo3d=sbsl:tb2l,scale=1920:1080,setsar=1/1 -c:a copy -c:s copy -c:v libx264 -crf 18 "OU.mp4"
Last edited by Sharc; 6th Feb 2024 at 12:25.
-
Used "field" but had to change to "crop=iw/2:1080:1920:0" to cut the right half correctly
What about
ffmpeg -hwaccel vaapi -c:v h264_vaapi
?
Will it work with my AMD machine? Do I have to install anything more to make it work?
I have the most modern AMD GPU so is it ok, or any better tool for higher performance using AMD GPU?Last edited by maysider; 6th Feb 2024 at 15:09.
-
-
Btw ffmpeg is able to perform various stereoscopic formats too:
https://trac.ffmpeg.org/wiki/Stereoscopic
https://ffmpeg.org/ffmpeg-filters.html#stereo3d -
thx Sharc, implemented
what about GPU acceleration? it should be much faster, right? Tried but no success -
Code:
!HW 265 ffmpeg -i avatar2.mkv -c:v hevc_amf -qp_i 23 -qp_p 23 -qp_b 23 -an -sn -t 50 1_final_265.mkv !HW 264 ffmpeg -i avatar2.mkv -c:v h264_amf -qp_i 16 -qp_p 16 -qp_b 16 -an -sn -t 50 1_final_264.mkv
Last edited by maysider; 7th Feb 2024 at 05:05.
-
but now absolutely dont know how to set the parametres of hevc_amf to be maybe like h264 crf=16, for a very good quality movie with fast scenes
-
By lowering the -qp_x values I would assume (I am on NVIDIA though)
There is however no direct relation and comparison between 264 and 265, so it's basically trial and error to achieve the "same" quality (to be compared at same file size of course).
(Quality of GPU encoding is still considered inferior compared to CPU encoding AFAIK) -
btw, this should be enough quality for everything with a copy all the audio and sub streams through AMD HW coding to HEVC:
Code:ffmpeg -i "movie.mkv" -c:v hevc_amf -rc cqp -quality quality -qp_i 16 -qp_p 18 -map 0:v:0 -map 0:a -map 0:s 1_final_265.mkv
Last edited by maysider; 7th Feb 2024 at 09:56.
-
Similar Threads
-
BD3D2MK3D: Convert 3D BDs or MKV to 3D SBS, TAB or FS MKV - Support thread
By r0lZ in forum Blu-ray RippingReplies: 543Last Post: 19th Jan 2025, 07:01 -
Need Help Converting Top-Bottom 3D File to SBS
By crevice9 in forum Video ConversionReplies: 10Last Post: 13th Jan 2022, 12:05 -
padding top and bottom odd number: ffmpeg
By noctis90210 in forum EditingReplies: 3Last Post: 11th Mar 2021, 12:17 -
Convert .MTS files from a Sony HDR TD20 to SBS (or split L+R) on Mac ???
By restlessman in forum Video ConversionReplies: 2Last Post: 17th Nov 2020, 12:34 -
bd3d2mk3d and half-SBS or half-tab issue
By Scarredjoker in forum Blu-ray RippingReplies: 81Last Post: 30th Nov 2019, 07:23