Any suggestions of a ffmpeg script to encode a lossless HuffYUV UHD file into a codec suitable for uploading into YouTube, So basically I just want to reduce the file size to stay below the YT file size limit, I would like to keep the 4:2:2 chroma sub and audio as PCM if possible, I've always uploaded lossless HD to YT since bandwidth is not an issue for me but 4k/UHD exceeds YT file size limit for uploading. I know YT compresses everything and makes it much worse, this is the exact reason I keep the file as lossless as possible before uploading so it gets butchered only once. A sample file is attached.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
Try StreamFab Downloader and download streaming video from Youtube, Netflix, Amazon! Download free trial.
+ Reply to Thread
Results 1 to 27 of 27
Thread
-
-
What is youtubes bitrate limit ? THe only thing I see is a maximum 256 GB per file
-
My problem is not the bitrate, the file size is the limit.
-
Something like (in a drag/drop batch file):
Code:ffmpeg -y -i %1 -pix_fmt yuv422p10le ^ -c:v libx265 -preset slow -profile:v main422-10 -crf 15 -colorspace bt709 ^ -c:a copy "%~n1.x265.main422-10.mkv"
-
Well it's related.
a 30 minute file @ 1000kbs and a 15 minute file at 2000kbps would be about the same size...
so then the run time AND bit rate become a factor.
Your file is marked interlaced but it's progressive.
Encoded it in vdub2 using ffv1 lossless compression @ 422 chroma, PCM audio and received a file at about 55MBs
I -
-
-
I think jagabo's approach is better. Will give you the option to upload much longer files and shorter upload times.
I don't think it's necessary to keep it lossless, although on my PC, a bit on the slow side, the lossless encoding is quicker -
It's a drag-and-drop batch file. Put the code in a bat file (a plain text file with the extension .bat rather than .txt), then drag/drop a video file onto the bat file. Or put the bat file in your Send To folder. Then you can right click on a video file and select Send To -> (name of bat file) from the context menu.
Of you can type:
Code:ffmpeg -y -i "input.avi" -pix_fmt yuv422p10le -c:v libx265 -preset slow -profile:v main422-10 -crf 15 -colorspace bt709 -c:a copy "output.mkv"
Last edited by jagabo; 26th Oct 2024 at 21:09.
-
For some reason that -y caracter at the beginning of the the second script did not process the file, so I removed it and it worked, Here is both lossless and encoded files uploaded to YouTube:
Lossless: https://youtu.be/mGse2ZN94GQ
Encoded: https://youtu.be/h9j1KNmxnzA -
If 256GiB is your problem then i need to ask what kind of length and bitrate are expected to be dealt... Personally if i need to upload something on YT then i prefer encoding speed instead file size (so i prefer preset rather fast/faster than medium/slow) - also i would probably avoid B frames at all (i use only I and P type - my observation leading me that there is less quantizer "pumping" visible in final render).
-
Small side question: Does it make sense to upload 4:2:2 content to YouTube, afaik. YouTube always converts to 4:2:0?
users currently on my ignore list: deadrats, Stears555 -
I was wondering the same thing. Especially since the OP appears to be working with upscaled VHS.
Also, there's a rec.601 vs rec.709 color difference between the two youtube videos in post #12. The command line I gave explicitly flagged the video as rec.709. I assumed that because it was upscaled to 4K, though it's not flagged as such in the earlier huffyuv AVI.
That's weird because -y tells ffmpeg not to warn you if its output is going to overwrite an existing file, it just overwrites it. If there is no existing file the switch is ignored.Last edited by jagabo; 27th Oct 2024 at 10:37.
-
Anywhere from minutes to hours depends on the material, For me quality is the priority, I would prefer to upload large file sizes because that doesn't bother me at all, No cap in data, upload speed is very high and I don't have to sit next to it to watch it uploading, The only limit is YT file size, hence encoding. One tape I'm uploading that initially exceeds YT file size limit, I was able to cut the size down using the FFV1 in vdub2 but it is only 41min, longer tapes will eventually go over.
Unless we know how YT algorithm handles both 4:2:2 and 4:2:0 as inputs, Sure everything is going to be mushed down, that's the whole reason. to keep the losses at minimum. The same way for resolution, did you think I want to upscale SD from VHS to 4K?
I do convert that to rec.709 in vdub output, Haven't used your script yet for an actual long file, Will try it later. -
Then if possible i would go with fixed QP (something reasonable like 8..16) and only I and P frames thats all - as Google will recompress this anyway then i would not bother trying to squeeze bitrate within refined preset - especially if you claim your upload speed is high (IMHO it can be justified to reduce filesize as much as possible even at a cost of longer encoding if upload speed will be slow but if your upload is fast then why bother to perform computationally expensive encoding) - quality is outcome of available bitrate and this is deciding factor - more sophisticated encoding tools are focusing on bitrate reduction even at a quality cost.
-
Yes, if you don't need a lot of compression you can use a faster preset, a lower quantizer, and no b-frames.
Something like:
Code:ffmpeg -y -i %1 -pix_fmt yuv422p10le ^ -c:v libx265 -preset veryfast -profile:v main422-10 -crf 8 -x265-params bframes=0 -colorspace bt709 ^ -c:a copy "%~n1.x265.main422-10.mkv"
-
So math is simple 256GB means there is 2048 Gb available for file, this mean that let say file is 3600 seconds (1 hour) long then for 1 sec we have over 568Mb available so if your source HUFFYUV encoded was around 1400Mbps then H.265 need to compress source approx 2,5 times more efficient than HUFFYUV - let say HUFFYUV can provide 3 times compression so in overall HEVC need to be able compress source with factor 8 - this should be quite easy and it should provide quasi lossless compression. Of course this is quite simplistic estimation and for material longer than 1 hour compression must be more efficient but it should be not so difficult as in real life we expects compression factors at least one order higher than your case - probably 3 hour+ long source should be able to fit within 256GB limit.
-
All makes sense, Thank you guys.
-
This is the 138GB lossless version upload:
https://youtu.be/YWZsX_EGOK4 -
So YT offers your video at best with 16.4Mbps - there is long way from 448Mbps in your source.
-
Imagine 16.4Mbps from 8Mbps, This is the point.
-
-
I uploaded two videos into YouTube recently resizing to 4k but for now I'm just uploading the lossless versions, I'm amazed how good the quality came out, I compared the original SD file playing in VLC side by side with the YT window playing in 4K and I can hardly see the difference, the 4k version is so damn close to the original SD version, I think we can call this a success, we finally beat YouTube's compression .... until they come up with an AI algorithm that analyses the original resolution and then we're screwed again.
https://youtu.be/2jYVx9xA8ck
https://youtu.be/mc7A5pi_tcM -
What did you expect? Multi-giga file sizes for You Tube? Of course you're going to get a great result. The catastrophist evil YT destruction of video espoused by some people is just nonsense in my experience. Give it decent bitrate at 1440 or above and YT has always done a great job of reproducing the original video.
As always, the quality of the tape is the overriding factor. Your first video above is decidedly average and IMO hardly worth the huge bitrate you must have given it.
The second is much better because of the recording quality. -
Will consider an encoding pass in the future, Although it's just an extra step for me that I have to do for no reason other than maybe reduce the upload time from 2 hours to something shorter.
Similar Threads
-
Looking for ffmpeg script with AV1 encoder, HLS Encoding Linux
By Yamiraan in forum Video ConversionReplies: 0Last Post: 16th Mar 2024, 06:21 -
Linux full ffmpeg x264 bash script for quick & dirty & fast video encoding
By M.Shiver in forum LinuxReplies: 16Last Post: 6th Nov 2023, 11:30 -
Youtube stress test. Did the YT encoding quality improve since past years?
By Truthler in forum Video Streaming DownloadingReplies: 34Last Post: 21st Mar 2022, 11:22 -
youtube-dl FFmpeg script drag drop paste url download convert
By vaype_naysh in forum Newbie / General discussionsReplies: 0Last Post: 20th Sep 2021, 15:12 -
Looking for Batch MP4 Normalization Script of existing script
By VideoFanatic in forum Video ConversionReplies: 6Last Post: 31st Jul 2021, 20:50