VideoHelp Forum


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
  1. Member
    Join Date
    Jun 2017
    Location
    United Kingdom
    Search Comp PM
    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,

    ffmpeg -i "input.mkv" -c:v copy -c:a aac "output.mp4"
    The video (vcodec MPEG-1/2) is played with 16:9 ratio on Youtube.

    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.)
    ffmpeg -i "input.mkv" -preset veryslow -crf 0 -c:a aac -vf "ass=sub.ass" "output.mp4"
    Now the subbed video has vcodec of H.264.

    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.

    ffmpeg -i "input.mkv" -preset veryslow -crf 0 -s 854x480 -c:a aac -vf "ass=sub.ass" "output.mp4"
    and confirmed that it has this resolution with VLC, but Youtube still play with the original 720x480.

    -----------------------------------------------------------------------------------------------------------------------------------------------

    UPDATE:

    I followed the suggestion from these kind users, so I wanna update my result here ^ ^

    Originally Posted by sneaker View Post
    Try -vf "ass=sub.ass,setsar=40:33"
    VLC: vcodec=720x480
    Youtube: 854 x 470
    File Size: same the the 2nd video

    Originally Posted by sneaker View Post
    -vf "ass=sub.ass,scale=848:480,setsar=1:1"
    VLC: vcodec=848x480
    Youtube: 848x480
    BUT create the biggest file size

    Originally Posted by jagabo View Post
    "-aspect 16:9"
    VLC: vcodec=720x480
    Youtube: 854 x 480
    File Size: same the the 2nd video
    Last edited by parumaru; 26th Jun 2017 at 05:10.
    Quote Quote  
  2. DVDs are anamorphic. Try -vf "ass=sub.ass,setsar=40:33"

    or:
    -vf "ass=sub.ass,scale=848:480,setsar=1:1"
    Quote Quote  
  3. Or "-aspect 16:9"
    Quote Quote  
  4. Member
    Join Date
    Jun 2017
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by sneaker View Post
    DVDs are anamorphic. Try -vf "ass=sub.ass,setsar=40:33"

    or:
    -vf "ass=sub.ass,scale=848:480,setsar=1:1"
    Thank you for the reply!
    so does this mean that Youtube recognised MPEG1/2 as anamorphic -> Instantly use 16:9 with it?
    Sorry for so many questions, I really want to try understand the cause of it.
    Quote Quote  
  5. I don't know. Aspect ratio information can be in MPEG stream and/or in mkv container elements. Possible that Youtube reads those.
    Quote Quote  
  6. Originally Posted by parumaru View Post
    so does this mean that Youtube recognised MPEG1/2 as anamorphic -> Instantly use 16:9 with it?
    Probably. Because all DVDs and most video captures are anamorphic. 720x480 (3:2) is used for both 16:9 and 4:3 NTSC DVD, or with PAL DVD 720x576 (5:4) is used for both.
    Quote Quote  
  7. Originally Posted by parumaru View Post
    so does this mean that Youtube recognised MPEG1/2 as anamorphic -> Instantly use 16:9 with it?
    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?
    They're not just using the DAR to stretch it during playback. It's been resized to 854x480 or somesuch. Play the video and right-click the screen followed by hitting 'Stats For Nerds' to see the reencoded resolution of the video.
    Last edited by manono; 25th Jun 2017 at 22:15.
    Quote Quote  
  8. Member
    Join Date
    Jun 2017
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by manono View Post
    They're not just using the DAR to stretch it during playback. It's been resized to 854x480 or somesuch. Play the video and right-click the screen followed by hitting 'Stats For Nerds' to see the reencoded resolution of the video.
    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.
    Quote Quote  
  9. Originally Posted by parumaru View Post
    The first video with no sub;
    - VLC: MPEG-1/2 (mpgv) 720x480
    - Youtube: 854x480
    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.

    Originally Posted by parumaru View Post
    The 2nd video with sub
    -VLC: H264-MPEG-4 AVC (part 10) (avc1)
    -Youtube:720x480
    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
    Note that SAR is sometimes called pixel aspect ratio (PAR), the shape of individual pixels. But theoretically, pixels are dimensionless points, not little boxes. So the term SAR is more accurate.

    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
    Quote Quote  
  10. Member
    Join Date
    Jun 2017
    Location
    United Kingdom
    Search Comp PM
    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...

    Originally Posted by jagabo View Post
    This video is encoded with the MPEG 16:9 display aspect ratio (DAR) flag.
    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?

    Originally Posted by jagabo View Post
    When you encoded this video you lost the DAR flag.
    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
    For 16:9LB, so does this mean that when the video is played on 4:3 screen, there will be a letter box?

    --------------------------------------------------------------------------------------------------------------------------------

    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.
    Quote Quote  
  11. Originally Posted by parumaru View Post
    I finally understand the actual meaning of Anamorphic video
    It comes from the original usage in film:
    https://en.wikipedia.org/wiki/Anamorphic_format

    Originally Posted by parumaru View Post
    Originally Posted by jagabo View Post
    This video is encoded with the MPEG 16:9 display aspect ratio (DAR) flag.
    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?
    Yes.

    Originally Posted by parumaru View Post
    Originally Posted by jagabo View Post
    When you encoded this video you lost the DAR flag.
    Hence I should “unsqueezed” the 2nd video by using -aspect 16:9 to make it 854x480 on Youtube right?
    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.

    Originally Posted by parumaru View Post
    --------------------------------------------------------------------------------------------------------------------------------

    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
    For 16:9LB, so does this mean that when the video is played on 4:3 screen, there will be a letter box?

    --------------------------------------------------------------------------------------------------------------------------------
    I don't know what that's saying.

    Originally Posted by parumaru View Post
    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 !!
    That would match the earlier explanations.
    Quote Quote  
  12. Originally Posted by parumaru View Post
    For 16:9LB, so does this mean that when the video is played on 4:3 screen, there will be a letter box?
    Yes, that's what it means. It might have also been set up as 16:9 PS (Pan and Scan) meaning when viewed on 4:3 televisions it would be cropped on the sides and fill the screen.
    Quote Quote  
  13. Member
    Join Date
    Jun 2017
    Location
    United Kingdom
    Search Comp PM
    @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)

    Click image for larger version

Name:	VLC.png
Views:	62
Size:	519.2 KB
ID:	42109Click image for larger version

Name:	Youtube.png
Views:	61
Size:	395.0 KB
ID:	42110

    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

    Click image for larger version

Name:	Screen Shot 2017-06-26 at 7.49.57 PM.png
Views:	62
Size:	44.7 KB
ID:	42111
    Last edited by parumaru; 26th Jun 2017 at 14:06.
    Quote Quote  
  14. Originally Posted by parumaru View Post
    but the quality was not as good on Youtube...
    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.
    Quote Quote  
  15. Member
    Join Date
    Jun 2017
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by manono View Post
    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
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!