Popular Post caffrey Posted May 2, 2013 Popular Post Posted May 2, 2013 Were having problems with Ipads filling up with unnecessary bluray quality movie files, also somehow they are managing to record these videos upside down (and portrait) so I created a few batch scripts for this, just thought I'd share. The scripts fix the video, reencode to wmv at half size at a bitrate of 5k (dvd ish quality) significantly cuts down on the huge Ipad videos First create a folder under c: called IpadVideos. In that folder download a copy of ffmpeg.exe into it. Then in that folder create 4 folders called Converted, Flip, Resize and Rotate Now create 3 batch files in the IpadVideos folder. Flip.bat For %%A in (Flip\*.*) do ffmpeg -y -i "%%A" -vcodec wmv2 -acodec wmav2 -b:v 6000k -b:a 160k -r 25 -vf scale=iw/2:-1,hflip,vflip "c:\IpadVideos\Converted\%%~nA".wmv Resize.bat For %%A in (Resize\*.*) do ffmpeg -y -i "%%A" -vcodec wmv2 -acodec wmav2 -b:v 6000k -b:a 160k -r 25 -vf scale=iw/2:-1 "c:\IpadVideos\Converted\%%~nA".wmv Rotate.bat For %%A in (Rotate\*.*) do ffmpeg -y -i "%%A" -vcodec wmv2 -acodec wmav2 -b:v 6000k -b:a 160k -r 25 -vf scale=iw/2:-1,transpose=1 "c:\IpadVideos\Converted\%%~nA".wmv So any antipodean videos put them in the Flip folder, portrait in the rotate folder and resize in the resize folder, then run the batch files, the videos will end up in the converted folder. Hope it's some use 5
mullet_man Posted May 12, 2016 Posted May 12, 2016 Thanks for this. Would this be easily changed to convert to MP4s?
Arthur Posted May 12, 2016 Posted May 12, 2016 (edited) Would this be easily changed to convert to MP4s? These should do what you want... Flip.cmd @echo off pushd "%~dp0" for %%A in ("Flip\*.*") do ffmpeg -y -i "%%A" -c:v libx264 -b:v 6000k -crf 18 -preset slow -c:a aac -b:a 160k -vf scale=iw/2:-1,hflip,vflip "Converted\%%~nA.mp4" popd Resize.cmd @echo off pushd "%~dp0" for %%A in ("Resize\*.*") do ffmpeg -y -i "%%A" -c:v libx264 -b:v 6000k -crf 18 -preset slow -c:a aac -b:a 160k -vf scale=iw/2:-1 -pix_fmt yuv420p "Converted\%%~nA.mp4" popd Rotate.cmd @echo off pushd "%~dp0" for %%A in ("Rotate\*.*") do ffmpeg -y -i "%%A" -c:v libx264 -b:v 6000k -crf 18 -preset slow -c:a aac -b:a 160k -vf scale=iw/2:-1,transpose=1 "Converted\%%~nA.mp4" popd WMV seems a bit of a bizarre choice. Edited May 12, 2016 by Arthur 1
caffrey Posted May 12, 2016 Author Posted May 12, 2016 Yeah that was 2013, when the kids liked movie maker
mullet_man Posted May 13, 2016 Posted May 13, 2016 Getting this error Codec is experimental but experimental codecs are not enabled, try -strict -2 But added in -strict -2 after aac and its working. Thanks.
Arthur Posted May 13, 2016 Posted May 13, 2016 Glad to hear it's working for you now. Codec is experimental but experimental codecs are not enabled, try -strict -2 Were you using the latest ffmpeg.exe from zeranoe.com?
mavhc Posted May 13, 2016 Posted May 13, 2016 you could probably integrate these ideas into my python script that searches a folder you drag to it recursively https://github.com/mavhc/shrink-video-recursive-python
mullet_man Posted May 13, 2016 Posted May 13, 2016 Glad to hear it's working for you now. Were you using the latest ffmpeg.exe from zeranoe.com? Just checked and yes.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now