Before uploading the video, I have this MKV file,
so I used ffmpeg to convert it to MP4 and hard code the ass subtitle into it.
Now my question is
When I simply converting the video without a sub and uploaded it, so the video retained it original vcodec,
The video (vcodec MPEG-1/2) is played with 16:9 ratio on Youtube.ffmpeg -i "input.mkv" -c:v copy -c:a aac "output.mp4"
However, when I put a sub on it, so the video need to be re-encoded. (In this case, I chose to preserve the quality by making it lossless.)
Now the subbed video has vcodec of H.264.ffmpeg -i "input.mkv" -preset veryslow -crf 0 -c:a aac -vf "ass=sub.ass" "output.mp4"
However, Youtube player still keep its original aspect of 720x480 and there is a black bar on the side of the video.
Therefore, I am curious why is it such a case? even though VLC told me that both has the same resolution of 720x480.
-----------------------------------------------------------------------------------------------------------------------------------------------
I just tried adjust the one with the sub with Youtube recommended scale of 854x480.
and confirmed that it has this resolution with VLC, but Youtube still play with the original 720x480.ffmpeg -i "input.mkv" -preset veryslow -crf 0 -s 854x480 -c:a aac -vf "ass=sub.ass" "output.mp4"
-----------------------------------------------------------------------------------------------------------------------------------------------
UPDATE:
I followed the suggestion from these kind users, so I wanna update my result here ^ ^
VLC: vcodec=720x480
Youtube: 854 x 470
File Size: same the the 2nd video
VLC: vcodec=848x480
Youtube: 848x480
BUT create the biggest file size
VLC: vcodec=720x480
Youtube: 854 x 480
File Size: same the the 2nd video
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
Try StreamFab Downloader and download streaming video from Youtube, Netflix, Amazon! Download free trial.
+ Reply to Thread
Results 1 to 15 of 15
Thread
-
Last edited by parumaru; 26th Jun 2017 at 05:10.
-
DVDs are anamorphic. Try -vf "ass=sub.ass,setsar=40:33"
or:
-vf "ass=sub.ass,scale=848:480,setsar=1:1" -
-
I don't know. Aspect ratio information can be in MPEG stream and/or in mkv container elements. Possible that Youtube reads those.
-
-
Yes, these days YouTube resizes taking into account the DAR if your source is some kind of an MPEG.
I have no idea how it handles that for H.264 sources. Since they're going to resize anyway, you'd be better off resizing them yourself before the upload.
Instantly use 16:9 with it?Last edited by manono; 25th Jun 2017 at 22:15.
-
Thank you for your reply. I did what you said and
The first video with no sub;
- VLC: MPEG-1/2 (mpgv) 720x480
- Youtube: 854x480
The 2nd video with sub
-VLC: H264-MPEG-4 AVC (part 10) (avc1)
-Youtube:720x480
Does this mean Youtube reencoded the first video to this size?
Sorry for so many questions, I really wanna try learning more about this!!Last edited by parumaru; 25th Jun 2017 at 19:05.
-
This video is encoded with the MPEG 16:9 display aspect ratio (DAR) flag. Youtube is obeying the DAR flag and resizing to 854x480. 480 * 16 / 9 = 853.333... but YV12 video must use even frame sizes. so 853.333 rounds up to 854. Personally, I would round to 852 (mod 4) or 856 (mod 8) to avoid a mod 2 frame size -- and accept the slightly larger aspect ratio error.
When you encoded this video you lost the DAR flag. Encode with a SAR of 32:27 and youtube might resize it correctly. The x264 command line option is "--sar 32:27". I don't know how you specify it in ffmpeg.
The general equation for video aspect ratios:
Code:DAR = FAR * SAR DAR = display aspect ratio, the shape of the final picture that's displayed FAR = frame aspect ratio, the ratio of the frame width:height SAR = sampling aspect ratio, the relative distance between pixels, horizontally:vertically
For a 720x480 16:9 DVD the MPEG data specifies the DAR, not the SAR:
Code:DAR = FAR * SAR DAR / FAR = SAR (16/9) / (720/480) = SAR (16 * 480) / (9 * 720) = SAR 7680 / 6480 = SAR (divide both by 240) 32 / 27 = SAR 32:27 = SAR
-
Thank you so much for taking your time to explain this to me.
There are so much thing that I need to be learnt!
I finally understand the actual meaning of Anamorphic video just now OTL, sorry for being so stupid...
Ohhh Does this mean that original video is intentionally required to be seen in 16:9, which is why there are 16:9 DAR in the first place?
Hence I should “unsqueezed” the 2nd video by using -aspect 16:9 to make it 854x480 on Youtube right?
--------------------------------------------------------------------------------------------------------------------------------
I also checked the original specification of the video from the website and it said
16:9LB/片面2層/リニアPCM => 16:9LB/One side 2 layers????/Linear PCM
--------------------------------------------------------------------------------------------------------------------------------
I also uploaded both videos for you to see
A: 720x480
https://youtu.be/rWKPiyIyA5g
B: 854x480 using -> -aspect 16:9 command
https://youtu.be/NTrzElMcIaM
My apologies for so many questions guys! I'm trying hard to understand this !!Last edited by parumaru; 26th Jun 2017 at 07:41.
-
It comes from the original usage in film:
https://en.wikipedia.org/wiki/Anamorphic_format
Yes.
Yes. Or maybe flag the DAR/SAR before uploading. I don't know if youtube will respond to the flags in formats other than MPG.
I don't know what that's saying.
That would match the earlier explanations. -
-
@jagabo @ @manono
Thank you so much for your help
Now I am encountering another problem T-T
so the video looks perfect on VLC !!!, but the quality was not as good on Youtube (even though I already selected 480p).
The color is faded and the subtitle was not as sharp (the stroke of the font is slightly blurr)
I guess this is because I go over the bitrate too much? (I guess from making the video lossless....)
since the recommended for 480p is 2.5 Mbps..... or do you think there are something else?
https://support.google.com/youtube/answer/1722171?hl=en-GB
Last edited by parumaru; 26th Jun 2017 at 14:06.
-
It never is as YouTube reencodes everything using low bitrates. Download it and compare the bitrate YouTube used with your source video. And the more complex the video (the more movement), the worse it will look on YouTube. One way to get around that is to do some filtering to make it more compressible. It might look worse on your computer but better on YouTube.
-
Thank you for your suggestion. I did what you said and my 480p video was only give only 500-600 kb/s.
However, I found a way to get around this!!!! so I will share this here ^ ^ (in case someone who need help like me found this post lol)
Basically, you just encode video with a higher resolution, so I just go with 1280x720 and everything looks perfect like VLC! (I mean not as good as, but still...)
The colour no longer faded and the video was give a bitrate of 1900ish kb/s.
I think you can get a higher bitrate by making the video 1080p as well, but I think I'm satisfied with mine.
Now I can finally work on something else aaaaaaa
Similar Threads
-
Export for youtube via adobe premiere and the H.264/AVC codec.
By sergbot in forum EditingReplies: 1Last Post: 21st Apr 2017, 15:55 -
iFFMpeg / MKV to H.264 MP4 / YouTube
By kivi in forum Video Streaming DownloadingReplies: 3Last Post: 5th Nov 2013, 14:50 -
Ripping the H.264 AAC version of a video from youtube
By ROBO731 in forum Video Streaming DownloadingReplies: 10Last Post: 17th Jul 2013, 20:30 -
Free flash based web-video player (which has HW h.264 acceleration option)
By Stears555 in forum Video Streaming DownloadingReplies: 8Last Post: 12th Jan 2013, 09:40 -
youtube doesn't like joined .MP4 h.264 files
By Driber in forum Newbie / General discussionsReplies: 4Last Post: 29th Jun 2012, 11:21