Hi, I have a video I would like to convert (to lower it's quality, to make it easier to stream).
I want to use x264 and I have the settings I believe will work.
These are the setting I want to use:
Audio Codec AAC
Audio Bit Rate 128 Kbps
Video Res 720x404
Video Bit Rate 1275 Kbps
Video Crf 23
I have ffmeg installed, and the vfwx264 codec, so I think I'm ready to go. I'm just clueless about this command line stuff.
Any help will be greatly appreciated.
Thanks.
+ Reply to Thread
Results 1 to 13 of 13
-
-
Try:
Code:ffmpeg -i "input.whatever" -map 0:v:0 -map 0:a:0 -c:v libx264 -crf 23 -vf scale=w=720:h=480:force_original_aspect_ratio=decrease -c:a aac -ac 2 -b:a 128k "output.mp4"
- ffmpeg doesn't need or otherwise use x264vfw
- you either specifify a bitrate or crf, not both. ( https://trac.ffmpeg.org/wiki/Encode/H.264 )
- resize to 720x480 max: https://trac.ffmpeg.org/wiki/Scaling%20(resizing)%20with%20ffmpeg
(do you really need this low resolution? Most devides have no problems playing 1920x1080 or more.)
- includes (down)mixing to stereo if needed https://trac.ffmpeg.org/wiki/AudioChannelManipulation
- selects first video and audio stream: https://trac.ffmpeg.org/wiki/Map
Often, most things work automatic with the ffmpeg defaults. Then something simple like this will suffice:
Code:ffmpeg -i "input.whatever" "output.mp4"
-
You said you have ffmpeg "installed". How exactly? Simplest is if you add the path where "ffmpeg.exe" is residing into the Windows environment variable named %PATH%.
See this tutorial on how to add to %PATH% and run the command in the folder you want to work in (usually where your input file is):
http://adaptivesamples.com/how-to-install-ffmpeg-on-windows/ -
My goal is to create a streamable version of the file, my wifi on my iphone and ipad seem to struggle keeping the audio in sync on HD videos.
I am about to try your suggestions, I don't see why they wouldn't work
Thanks -
You probably also want to use the faststart option for online streaming:
Code:-movflags faststart
-
I'm going to do a test using just pure defaults, then I'll use the full comand line given here (adding -movflags faststart). Where in the command line do I add that? Can it go anywhere?
-
-map 0:v:0 -map 0:a:0 -c:v libx264 -crf 23 -vf scale=w=720:h=480:force_original_aspect_ratio=decr ease -movflags faststart -c:a aac -ac 2 -b:a 128k
[libx264 @ 0000000002589f00] height not divisible by 2 (720x405)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[aac @ 0000000000dc8820] Qavg: 65536.000
[aac @ 0000000000dc8820] 2 frames left in the queue on closing
Does anyone know what's going wrong? I don't understand what ffmpeg thinks has a resolution of 720x405. -
I believe the "force_original_aspect_ratio" is causing your requested 720x480 to change to 720x405 (16:9) -- you can't have odd (as in odd/even) frame sizes with most video codecs. I would even recommend multiples of 4 rather than multiples of 2. So just resize to 720x404 directly.
1920x720 would be a very unusual frame size. Are you sure it's not 1280x720? That would be more consistent with the 16:9 aspect ratio with force_original_aspect_ratio. -
-
That's tricky, actually. I don't know if there is a way to tell force_original_aspect_ratio to use mod2. If it's not possible it is pretty useless unless maybe you crop a line away which is ugly.
Using Google I found this:
Code:scale=floor(iw*min(1\,min(720/iw\,480/ih))/2+0.4999999)*2:-2
-
My command line looked like this:
-map 0:v:0 -map 0:a:0 -c:v libx264 -crf 23 -vf scale=floor(iw*min(1\,min(720/iw\,480/ih))/2+0.4999999)*2:-2 -c:a aac -ac 2 -b:a 128k -movflags faststart
At line:1 char:135
+ ... :0 -map 0:a:0 -c:v libx264 -crf 23 -vf scale=floor(iw*min(1\,min(720/ ...
+ ~
Missing argument in parameter list.
At line:1 char:144
+ ... 0:a:0 -c:v libx264 -crf 23 -vf scale=floor(iw*min(1\,min(720/iw\,480/ ...
+ ~
You must provide a value expression following the '/' operator.
At line:1 char:144
+ ... :0 -c:v libx264 -crf 23 -vf scale=floor(iw*min(1\,min(720/iw\,480/ih) ...
+ ~~~
Unexpected token 'iw\' in expression or statement.
At line:1 char:144
+ ... 0:a:0 -c:v libx264 -crf 23 -vf scale=floor(iw*min(1\,min(720/iw\,480/ ...
+ ~
Missing closing ')' in expression.
At line:1 char:168
+ ... 3 -vf scale=floor(iw*min(1\,min(720/iw\,480/ih))/2+0.4999999)*2:-2 -c ...
+ ~
Unexpected token ')' in expression or statement.
+ CategoryInfo : ParserError: ([], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingArgument -
Are you using PowerShell? You are probably not escaping the command correctly. (Probably easier to use cmd if you don't require PowerShell)
Similar Threads
-
How can I convert a walmart security video .avi(sn40 codex) to normal video
By DrBaheim in forum Newbie / General discussionsReplies: 20Last Post: 14th Jan 2025, 18:58 -
Video to Video won't convert full batched files
By technicality1 in forum Video ConversionReplies: 2Last Post: 28th Jan 2017, 04:01 -
Audio pitch after video is convert using handbrake or video coder
By Freelife2345 in forum AudioReplies: 3Last Post: 9th May 2016, 02:33 -
How to convert 15hour ( 30fps ) long video to timelapse video ( 15mins )?
By rplusj1 in forum EditingReplies: 9Last Post: 10th Oct 2015, 18:46 -
How do I convert a video authored for dvd to a downloadable video with navi
By steve baker in forum Newbie / General discussionsReplies: 16Last Post: 16th Feb 2015, 08:31