Hello,
I used the following ffmpeg command to further compress a video:
Notice the "-2" which I read somewhere.Code:ffmpeg -i input.mkv -c:v libx264 -vf scale=720:-2 -pix_fmt yuv420p -c:a aac -b:a 128k -ac 2 -ar 44100 -threads 2 -f mp4 output.mp4
Still, the frame ratio isn't preserved (as reported by ffprobe.exe):
Is there a simple way to tell ffmpeg to not mess with the frame ratio?Code:Input #0, matroska,webm, from 'input.mkv': Metadata: ENCODER : Lavf57.71.100 Duration: 00:23:55.84, start: 0.000000, bitrate: 9229 kb/s Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR64:45 DAR 16:9], SAR 1:1 DAR 5:4, 25 fps, 25 tbr, 1k tbn, 50 tbc (default) Metadata: DURATION : 00:23:55.840000000 Stream #0:1(unknown): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default) Metadata: DURATION : 00:23:55.816000000 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.83.100 Duration: 00:00:27.20, start: 0.000000, bitrate: 600 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576 [SAR 1:1 DAR 5:4], 464 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(unk): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : SoundHandler
Thank you.
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 8 of 8
Thread
-
Last edited by yetanotherlogin; 15th Dec 2017 at 08:02.
-
Do you really need scale? It seems to me be redundant.
I think -2 means the resulted height will be even number. (I think) -1 means keep aspect ratio when resizing.
But scaling seem to be here as I mentioned above, try setdar=16/9 to your command line to be sure it is 16/9 set.
BernixLast edited by Bernix; 15th Dec 2017 at 07:13.
-
Thanks.
Yes, I do need it, because the output looks weird. The original is at the top:
Here's the command I used:
Code:ffmpeg -i input.mkv -c:v libx264 -vf setdar=dar=4/3 -vf scale=720:-1 -pix_fmt yuv420p -c:a aac -b:a 128k -ac 2 -ar 44100 -threads 2 -f mp4 output.mp4
Edit: Found it. It was "setdar=16:9":
Code:ffmpeg -i input.mkv -c:v libx264 -vf scale=720:-1,setdar=16:9 -pix_fmt yuv420p -c:a aac -b:a 128k -ac 2 -ar 44100 -threads 2 -f mp4 output.mp4
Last edited by yetanotherlogin; 15th Dec 2017 at 08:01.
-
There's still a bit of a problem: How can I get rid of the black bars on both sides?
-
Why don't you just specify the height along with the width?
Code:-vf scale=720:404
Similar Threads
-
ffmpeg vs ffprobe frame count speed
By Anime4000 in forum Newbie / General discussionsReplies: 6Last Post: 12th May 2019, 05:05 -
Use ffmpeg to replace frame with previous frame if frames are X % different
By dkrichards16 in forum ffmpegX general discussionReplies: 0Last Post: 29th Apr 2017, 16:27 -
Preserving anamorphic aspect ratio while cropping
By ackboo in forum Newbie / General discussionsReplies: 20Last Post: 29th Apr 2015, 09:36 -
FFMPEG error: first frame is not keyframe
By marcorocchini in forum Newbie / General discussionsReplies: 0Last Post: 29th Sep 2013, 15:37 -
ffmpeg frame grab question
By johnp12 in forum Newbie / General discussionsReplies: 1Last Post: 21st Jul 2013, 17:16