I have a ton of video files, all in various formats, various bitrates, various sizes. A lot are in higher quality than I really care to keep around and archive (waste of space)
I am looking to get a script created, ideally could run cross platform, but Linux shell is preferred.
It would:
1) Use a "sane" bitrate or quality factor (to be determined; I have videos that are 10-15x smaller than their 1080p counterparts and look just as good to me for normal viewing)
2) Reduce the resolution as necessary
3) Maintain the original aspect ratio and frame rate. Basically just downsize the video and allow some quality loss (that's only really noticeable the larger the video is blown up)
I'd be willing to toss a few bucks at the right solution too
For example I have a video with the specs below and it is about 90% of what I am looking for. Just need to know the ideal command line, and then maybe a couple tweaks or suggestions. I probably want to bump up the video quality a little bit... having a single variable to adjust would be nice. Audio doesn't need to be anything special - 128k maximum is good.
This is a nearly 26 minute video that is 166MB. I think I could live with 10 minutes being roughly 150MB, so I could easily double this video size (get a little more quality) - but I definitely don't need 12.6Mbps 3.5 gig 40 minute videos ;p
Tips/thoughts/command line tool suggestions? It mainly gets tricky for me when having to deal with aspect ratios. It seems like the original tool that created the sample video left in a bunch of flags, but I am not sure which are reasonable, which tool is better to use (mencoder, ffmpeg, HandbrakeCLI) etc.
Any help is appreciated!
Code:General Complete name : D:\video.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom File size : 166 MiB Duration : 25mn 54s Overall bit rate mode : Variable Overall bit rate : 896 Kbps Writing application : Lavf55.21.100 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.1 Format settings, CABAC : Yes Format settings, ReFrames : 4 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 25mn 54s Bit rate : 803 Kbps Width : 720 pixels Height : 404 pixels Display aspect ratio : 16:9 Original display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 29.970 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.092 Stream size : 149 MiB (90%) Writing library : x264 core 140 r2377 1ca7bb9 Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=18 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=21.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 Language : English Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 25mn 54s Bit rate mode : Variable Bit rate : 84.4 Kbps Maximum bit rate : 128 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 44.1 KHz Compression mode : Lossy Delay relative to video : 67ms Stream size : 15.7 MiB (9%) Language : English
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 7 of 7
Thread
-
-
You can pretty easy shrink all video with same video and audio bitrate.
But it gets much more complex if you want to adjust resolution. You need a script that reads the source information and so.
Do you have any programming skills? Perl? PHP? dos batch? Java?? -
Procedural PHP, can hack some bash around. I could write a php based one if I knew all the individual commands to strand together. Or bash.
-
You could then use
http://ffmpeg-php.sourceforge.net/
After you installed it works like
Code:$movie = new ffmpeg_movie("filepath"); $width = $movie->getFrameWidth(); $height = $movie->getFrameHeight();
http://www.phpro.org/tutorials/Video-Conversion-With-FFMPEG.html
Or ask Selur ( creator of hybrid) to make a complete program/script for you. -
Thanks, at one point I used ffmpeg-php, but then it became too unstable. Not sure how robust it is now. I still wind up not necessarily getting things right (I sorta don't trust myself. "Scene rip packs" seem to work magically, usually, whereas what I do I am not sure)
-
ffmpeg-php doesn't seem to be updated since 2008...maybe not that good.
-
For videos as you mentioned, that I do not mind the size and quality so much, I use one I wrote that is for trimming but will do whole movie if you leave the times 000. It uses FFMpeg and has defaults that can be changed to others in FFmpeg. It copies what I want or the whole video in whatever format the original was unless the box is checked in the lower right to force it to a format. It's a work in progress so far but it hasn't failed me yet. Quality is adjusted as qscale or CRF depending on the codec. It pulls info on original file and pads and crops to keep aspect correct for whatever you put in the resolution. If the video is 640x480 and you want 720x480, you are going to get pillar bars since it's already 480. It creates the script in a pseudo dos window and lets you change or add if you are familiar with FFMpeg.
Sound like what you were trying to do?
ADDED INFO : BTW.. the cursor location is to assist in using the delogo settings.
Last edited by Budman1; 28th Mar 2014 at 23:26. Reason: added information
Similar Threads
-
Peak Level batch script
By elmuz in forum AudioReplies: 0Last Post: 22nd Oct 2012, 09:06 -
MKVExtract and MyMP4Box batch script
By mkr10001 in forum Video ConversionReplies: 18Last Post: 14th Mar 2012, 11:31 -
AviDemux batch script
By jakhazell in forum Newbie / General discussionsReplies: 5Last Post: 21st Aug 2011, 21:16 -
Simple Script to Prepare Your DivX/Xvid AVIs for Transcoding
By Soopafresh in forum Video ConversionReplies: 17Last Post: 13th Jul 2009, 20:30 -
3ivx Batch Conversion Available? Possible Script?
By fitch.j in forum Newbie / General discussionsReplies: 2Last Post: 12th Jun 2009, 05:24