Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Video compression

  • 03-12-2016 6:51pm
    #1
    Moderators, Category Moderators, Entertainment Moderators, Science, Health & Environment Moderators, Regional East Moderators Posts: 18,665 CMod ✭✭✭✭


    Hey all,

    Have an old video from the 60s or so that I'm looking to bring to the Christmas party for the extended folks. It was originally VHS until I copied it to a Windows PC, as mpg, iirc. It came in a ~ 3.4GB and is just under 60 minutes long. I recently put it through Handbrake (am not that knowledgeable on it, tbh) and that brought it down to the about 2.98GB as an mp4. Is there a way of reducing down further? It would make it easier to share.


Comments

  • Registered Users, Registered Users 2 Posts: 13,381 ✭✭✭✭Paulw


    Might get better response in the audio-video editing section on boards.

    In short, in will depend on the codec used, compression and output format, as well as resolution you output to.

    Guys in the audio-video section will be better able to give specific help. Just ask a mod to move the post.


  • Moderators, Category Moderators, Entertainment Moderators, Science, Health & Environment Moderators, Regional East Moderators Posts: 18,665 CMod ✭✭✭✭The Black Oil


    Ah, there is no audio. I'm not all that worried about resolution. The footage was recorded in the 60s and 70s, maybe even a little earlier. On 8mm or whatever was around before, Cinefilm? Just trying to carry it forward with each generation of tech, it's backed up on the cloud for safe keeping.


  • Registered Users, Registered Users 2 Posts: 13,381 ✭✭✭✭Paulw


    Try here - http://www.boards.ie/vbulletin/forumdisplay.php?f=404

    You might get more technical answers and better help.


  • Moderators, Business & Finance Moderators, Sports Moderators Posts: 15,120 Mod ✭✭✭✭whiterebel


    Can you make DVD copies of it? Tidy it up a bit and use titles etc in iMovie.


  • Moderators, Category Moderators, Entertainment Moderators, Science, Health & Environment Moderators, Regional East Moderators Posts: 18,665 CMod ✭✭✭✭The Black Oil


    Hi mods,

    Could you move the thread? Thanks.


  • Advertisement
  • Moderators, Category Moderators, Entertainment Moderators, Science, Health & Environment Moderators, Regional East Moderators Posts: 18,665 CMod ✭✭✭✭The Black Oil


    I did DVDs for a wedding, but who watches discs any more? :P Anyway, mental note - bring footage to the family Christmas thing.


  • Registered Users, Registered Users 2 Posts: 7,903 ✭✭✭frozenfrozen


    Sorry for not seeing this sooner

    can you give more info

    Is it a very bad quality VHS i.e. lots of grain and flickering, are there lots of scan lines at the top and bottom of the frame, how long exactly is it & do you need the whole length, how small would you like the file to be. will you be showing it on a large screen or will it be watched on phones etc where a smaller file size would be much more important than fidelity.

    is it black and white or colour

    is it a tv program type thing or a home video? (If it's a tv program we could try find a higher quality copy online)


    my recommendation would be to work from the original copy you made of the VHS, I don't know handbrake but if you want then get "ffmpeg" which is free

    it is a command line tool but once you figure out how to get going with it for vhs something along these lines will work:
    ffmpeg -i VHS.mp4 -vf "yadif=1:1,hqdn3d=6,format=yuv420p" -crf 28 -preset medium -c:a aac -movflags +faststart outputname.mp4
    

    yadif is deinterlace. hqdn3d is a denoiser. level 3 is default, higher is more denoising, don't go too far or it'll look very blurry, but less noise means you can have better compression.

    'format yuv' is so it will play in more players.

    crf is the quality, higher number is lower quality. preset medium is for the speed of the encoding, slower means better results, medium is default

    c:a aac is aac audio. movflags and fast start are more things to get it to play nicely if you put it on something like dropbox so people can play it without downloading


    if you have lots of scan lines at the bottom you can add a black bar to cover them to get the file smaller.


    we can fine tune & or do a 2 pass vbr:
    ffmpeg -y -i VHS.mp4 -c:v libx264 -preset medium -b:v X -pass 1 -c:a libfdk_aac -b:a 192k -f mp4 /dev/null && ffmpeg -i VHS.mp4 -c:v libx264 -preset medium -b:v X -pass 2 -c:a libfdk_aac -b:a 192k -movflags +faststart outputname.mp4
    


    replace X with the bitrate you want. so if you have a number in mind like 500MB

    (500 * 8192) / exact length of the video in seconds = wanted bitrate

    take 192k from that to account for sound, and then the video will come out nearly exactly the size you want it to be.


    if you want to do the above to a small section of video to test the quality add something like -ss 600 -t 15 to encode 15 seconds of footage starting from 600 seconds in (10 minutes)


    *so as an example say it's 60 minutes long exactly, 60*60 = 3600 seconds

    (500 * 8192) / 3600 = 1137.77777778 - 192 = 946
    ffmpeg -y -i VHS.mp4 -c:v libx264 -preset medium -b:v 946k -pass 1 -c:a libfdk_aac -b:a 192k -f mp4 /dev/null && ffmpeg -i VHS.mp4 -c:v libx264 -preset medium -b:v 946k -pass 2 -c:a libfdk_aac -b:a 192k -movflags +faststart outputname.mp4
    

    I just re-read and saw there's no audio so you can skip that part, I'll leave it in in-case anyone else comes across this thread looking for info


  • Moderators, Category Moderators, Entertainment Moderators, Science, Health & Environment Moderators, Regional East Moderators Posts: 18,665 CMod ✭✭✭✭The Black Oil


    Thanks for the comprehensive reply. It's a home video. Right now, it's H.264, AAC, colour profile: (5-1-6) and length is 56:24. But, that's just how Handbrake has done it. ffmpeg rings a bell from somewhere...not sure I have the original mpeg anywhere.

    Here's a shot.


  • Registered Users, Registered Users 2 Posts: 7,903 ✭✭✭frozenfrozen


    It would be more ideal to work with the original copy from the original scan, but it is no matter if you can't put it to hand.

    if that pillar-boxing is all the way though we could crop it and you could get the file size down a bit more. But if the edges of the film are drifting slightly then it's not worth it as you'll lose some detail at the edges of frame.

    For that quality I think it would be a shame to do as much de-noising as I have written above, maybe level 2 or 3 would be more appropriate since you could lose a lot of detail otherwise. File size will definitely take a hit and in general be quite hard to get down with that type of footage as nearly every pixel could be changing from frame to frame due to film drifting and that sort of thing.


    What would be the ideal size you would want and we can try get it down to that. If there's no audio we can cut the AAC stream and save a small bit of size straight away.

    What way are you going to be sharing this, just on a usb stick and asking people to copy it or something along those lines? Just to get an idea of how large a file could get away with to try preserve as much quality as possible.


    If it's just a case of having 'watchable' quality to share some very aggressive compression could be done but if there's an element of sharing it out so the video is never lost then it would be a shame to reduce the quality as much.

    I haven't really said much there in this big comment so apologies for that but simply, how small do you want it, how are you going to share it, and then let's do that :D


  • Registered Users, Registered Users 2 Posts: 16,414 ✭✭✭✭Trojan


    Play with the Avg Bitrate between 7000 (high quality) and 1500 (low quality). For me the sweet spot of output filesize to quality is between 2200 and 3000.

    Suggestion: cut a 2 minute clip out of your video and process that at different bitrates to see the different levels of quality.

    Here are my Handbrake settings:

    http://i.imgur.com/N7MAn2s.png

    http://i.imgur.com/1bgO9di.png

    http://i.imgur.com/YlCdBrd.png


  • Advertisement
Advertisement