Modifications to the System and Structure of a Himalaya Part.1 - MDA II, XDA II, 2060 Windows Mobile 6 Upgrading

Modifications To The System And Structure Of A Himalaya's Part.1
Hello from the fact that my work on OS-em-and the Himalaya, have been suspended, I decided to write about cooking light kursik to our old, but the active device. All the tools and commands tyczą only that device. If you do not, although basically in that you do not know, do not start the following modifications to the memory ROM. Let's say that the tutorial is intended for advanced users, or young kuchcików. Starting kuchcenie, we must bear in mind the reasonable thinking, and before any wgramy ROM, our authorship, we must be sure that the changes made responsible. Let's start! :​
Compatible:
O2 XDA II, T-Mobile MDA II, Qtek 2020, iMate Phone Edition, TSM500, and other variants PH10
1) Cookware:
To facilitate the work, the light we create an application based on the console (command line).
So, we open any text editor, which uses a record format in a text file -> *. Bat, *. cmd, *. nt (U me it's Notepad + +)
Open the editor and we enter a string of commands:
Code:
@ echo off
: Intro
cls
echo.
echo.
echo.
echo. Designed for Models:
echo. O2 XDA II, T-Mobile MDA II, Qtek 2020,
echo. iMate Phone Edition, TSM500, and other PH10 device
echo.
echo.
echo.
echo.
pause
cls
: phone
echo.
echo.
echo. [1] - This ROM dump
echo. [2] - REGISTRY. Dv To. Rgu
echo. [3] - Change Initflashfiles
echo. [4] - Dump ROM to NK.NBF
echo.
echo.
echo.
echo.
Set / P Choice = Choose:
IF '% Choice %'==' 1' GOTO: 1
IF '% Choice %'==' 2' GOTO 2
IF '% Choice %'==' 3' GOTO: 3
IF '% Choice %'==' 4' GOTO: 4
IF '% Choice %'=='' GOTO: EXIT
set choice =
GOTO: Intro
====================================================================
: 1
cls
echo.
set choice =
echo. in the course of his work ...
title Convert Image System .....
TOOLS \ xda2nbftool-x nk.nbf nk.nba 0x20040304
echo.
pause
title Preparation of system files .....
TOOLS \ prepare_imgfs.exe nk.nba
echo.
pause
title Dump System ..............
TOOLS \ viewimgfs.exe imgfs_raw_data.bin
pause
set compatible = yes
echo. Done!
GOTO: PHONE
====================================================================
: 2
cls
echo.
set choice =
echo.
echo.
set _FLATRELEASEDIR =. \ dump
TOOLS \ rgucomp.exe-nologo-o dump \ default.hv> default.rgu
TOOLS \ rgucomp.exe-nologo-o dump \ user.hv> user.rgu
echo.
echo.
echo.
echo.
echo.
echo.
echo ...
echo.
pause
copy default.rgu TOOLS \ For default.hv \ boot.rgu
TOOLS \ For default.hv \ boot_rgu__default_hv.bat
move TOOLS \ For default.hv \ default.hv dump \ default.hv
set compatible = yes
echo. Done!
GOTO: PHONE
==================================================================================
: 3
cls
echo.
set choice =
mkdir INITFLASHFILES
copy dump \ initflashfiles.dat initflashfiles.dat.txt
initflashfiles.dat.txt
echo.Change this txt.
echo. Save to ....
pause
attrib dump \ initflashfiles.dat-r-h
the dump \ initflashfiles.dat
copy initflashfiles.dat.txt dump \ initflashfiles.dat
attrib dump \ initflashfiles.dat + r
echo.
set compatible = yes
echo. Done!
GOTO: PHONE
==================================================================================
4
cls
echo.
set choice =
title Image Filing System ....
echo. in the course of his work ...
echo.
TOOLS \ BuildImgfs.exe
TOOLS \ make_imgfs.exe nk.nba
TOOLS \ xda2nbftool.exe-c-u nk.nba
TOOLS \ xda2nbftool.exe-x nk.nba nk.nbf 0x20040304
@ move nk.nbf Upgrade \ nk.nbf
@ CD. \ Upgrade \
@ HimaUpgradeUt_noID.exe
Upgrade DEL \ nk.nbf
set compatible = yes
echo. Done!
GOTO: PHONE
Save the file in a format -> *. bat - for example, something called Cook_Rom
* Remember that this process will be repeated in order to build the \ in the line ..
Info:
-> [1] - This ROM dump - spread your ROM - the file nk.nbf on parts (Files and Modules)
-> [2] - REGISTRY. dv To. rgu - default.hv extract the files and registry user.hv, compiles to. rgu, which gives us the freedom of its readability and modification
* IMPORTANT: we need to remember that each of these files:
- In the first line had entered the name "REGEDIT4"
- Between each row, you must free at least one line
- All the registry files must be encoded in Unicode - the aforementioned editor has such a function
-> [3] - Change Initflashfiles - this file is compiled with. dat to. txt, mainly used for relocation and arrangement of folders on your system
-> [4] - Dump ROM to NK.NBF - Our modified, or ported ROM together, that is, the file nk.nbf
After:
Spread shell ROM into:
• Create a directory eg Hima_Cook
• Copy to the:
- The basis of our work, namely the file -> nk.nbf
- We created above Create_Rom
• In Hima_Cook, create a subfolder:
- TOOLS
The subfolder Tools , we copy the necessary tools:
• xda2nbftool.exe
• prepare_imgfs.exe
• viewimgfs.exe
• BuildImgfs.exe
• make_imgfs.exe
• RecMod.exe
• rgucomp.exe
• cereg400.dll
• cecompr_nt.dll
• HimaUpgradeUt_noID.exe - this is one of the applications that our upgrade snapshot of the phone in Bootloader mode
Create another subfolder called "Upgrade" - Copy to him HimaUpgradeUt_noID.exe
In a further process, find out why some of the commands and the names of folders and tools are the essential, only to say that we need to carefully watch all of our lines *. bat . In this file there are commands to copy, move, modify, and run different applications and files.
Over time, understand the functionality and capabilities, which gives us this form of cooking.​
Features:
The --title gives us the ability to change the information in the process of the upper beam on the console​
Outro:
Everything described above gives us mainly TRADE dump folder and open all sorts. All tools and folders are arranged in an appropriate manner, so we can be sure of our small stoves that can not cause any error, when pichceniu. Another positive side, this is well and that our system consists in a single whole
In the following parts of the course, we'll include as a basis to modify, add applications, etc. I invite you to Part Two ...
Next part of the course coming soon....
​

just ask for sumthin,,,
this is good post(best i think)
but i wanna i ask you sumthin,, can u share what software are u use for,,coz for me learning by doing was better than just watch...thanx for your hard works...

THX, for the beginner is the science .... to better understand the whole principle of subsidies. I will finish this course, as soon as possible ....

This is a good service...
This is a good service to my friends thank you very much.

Very please

i m done with
USER.HV
DEFAULT.HV
still cant find BOOT.RGU in dump folder...
i've also checked the hidden files....

where to get TOOLS FROM?
CAN ANYONE GIVE A LINK
CANNOT FIND =
The subfolder Tools , we copy the necessary tools:
• xda2nbftool.exe
• prepare_imgfs.exe
• viewimgfs.exe
• BuildImgfs.exe
• make_imgfs.exe
• RecMod.exe
• rgucomp.exe
• cereg400.dll
• cecompr_nt.dll
all ok now found files in many himalaya kitchens...

I invite you to Part Two ...
hey nosker ...
any news or will it happen-I invite you to Part Two ...
will you do a part two ???
would be good for himalaya users!

Nokser no longer have a himalaya.

advanced15 said:
hey nosker ...
any news or will it happen-I invite you to Part Two ...
will you do a part two ???
would be good for himalaya users!
Click to expand...
Click to collapse
try and pm him.

Related

Problem to dump stock Rom

First of all - I'm Newbie. Yesterday I got my Diamond. After reading tons of threads today I tried to dump my german vodafone-branded diamond. Here a list of things I did:
1. installed active sync
2. copied and installed Cert_SPCS.cab and EnableRapi.cab
3. ran> pdocread.exe -l
3. ran> pdocread -w -d DSK1: -p Part02 0 0x6f20000 Part02.raw (Part0-3)
4. ran> prepare_imgfs.exe Part02.raw -nosplit
5. ran> viewimgfs.exe imgfs_raw_data.bin
6. ran> buildimgfs.exe
At step 6 buildimgfs aborted. Then I tried to repeat and the program stops again at the same line: Processing "pxl.lnk" as file. After that I repeated steps 3-6 with the same result. Could anyone help me plz?
bg
Felix
Hi,
can you upload the *.raw files please?
Yes for sure. Here you can dowload the full dump Part00-Part03.raw.
Here is the link
I have the same problem with these raw-files

Modifications to the System and Structure of a Himalaya Part.2

MODIFICATIONS
In this part of the course, as a general rule, we modify our system.
It connects to the addition and removal of various types: application, file or even substitutions skins and overlays system. But we must remember not to reload the ROM to us, because when it comes to our device is limited to 32 MB.
Let's start now, modify the presentation of the sample. This applies in particular for new cooks. In this process, we can breathe lightly and not to think that somehow our uwalimy device. It is rare that the phone is not included in the substitution or deletion of a program.
Remember - all the changes shown in this article are just an example. The need to know (for this example) which add and remove what ... .. To do the work ....
​
First what we need in our oven, and a folder to obtain "dump"
Open kitchen, based on the command line, which is created in the first part of this course:
We viewed the 4 position, select:
[1] - This ROM dump
I wait until the process is complete ... ... ..
Upon completion, we can see each other, exactly the folder.
Then, for the subsequent work click on:
[2] - REGISTRY. dv To. rgu
In the root, we have established the following two files:
-default.hv
-user.hv
Both files opened with - Notepad + + . See a string, something like this:
Code:
REGEDIT4
[HKEY_CLASSES_ROOT \. Zip]
@ = "zipfile"
[HKEY_CLASSES_ROOT \. Rar]
@ = "PocketRAR"
[HKEY_CLASSES_ROOT \ SimToolkit.UI]
@ = "UI Toolkit"
[HKEY_CLASSES_ROOT \ SimToolkit.UI \ CLSID]
@ = "(7B58F1D9-1C13-440f-894B-B90680570A2D)"
[HKEY_CLASSES_ROOT \ ExSMime.MimeReader.1]
@ = "MIME Reader"
Important:
-> In the beginning we have to enter the registry:REGEDIT4
-> Also, see if between each key is at least one blank line, ie there is no entry
-> All files. Rgu save in UNICODE, so we have opened such as default.rgu in Notepad + + click File> Encoding> Unicode
-> New keys entered by us, can not double the old
In this way we have prepared a record, we can now freely edit.
Now, we'll file Initflashfiles.dat
With this file we will not have in total, no problems. The only thing we will be interested to add or remove tracks, of course, they are dependent on the arrangement of folders and applications, or the peaks appearing in them.
For a deeper understanding of an application to add a ROM, but it must be in OEM format, how to do this? This is described at some length on the Internet. The second of the output, are designed for the software, which of the files. Cab form OEM
Insert into the application:
Consider, for example, the Pocket RAR in OEM format. Open the folder, we are interested in it:
- inietflaszfiles.txt,
- *. rgu - Registry File
- PocketRAR.exe - program
- PocketRAR.lnk - shortcut
In the first instance, to copy the folder dump: - PocketRAR.exe - software
I PocketRAR.lnk - shortcut
Open your file initflaszfiles.txt to the OEM:
Code:
Directory ( "\ Windows \ Start Menu \ Programs"):-Directory ( "Accessories")
Directory ( "\ Windows \ Start Menu \ Programs \ Accessories"):-File ( "Pocket RAR.lnk", "\ Windows \ RAR.lnk Pocket")
copy its contents to the main Initflashfiles.dat from the dump. This is to look like this.
This is the end of the passage of this file:
Code:
......
;================================================= =========================
; SAP MASD customization settings
;================================================= =========================
Directory ( "\ Windows \ AppButtons"):-File ( "Calendar.lnk", "\ Windows \ calendar.lnk")
Directory ( "\ Windows \ AppButtons"):-File ( "Contacts.lnk", "\ Windows \ addrbook.lnk")
Directory ( "\ Windows \ AppButtons"):-File ( "Tasks.lnk", "\ Windows \ tasks.lnk")
Directory ( "\ Windows \ AppButtons"):-File ( "Record.lnk", "\ Windows \ voice.lnk")
Directory ( "\ Windows \ AppButtons"):-File ( "Camera.lnk", "\ Windows \ camera.lnk")
Directory ( "\ Windows \ AppButtons"):-File ( "Messaging.lnk", "\ Windows \ tmail.lnk")
Directory ( "\ Windows \ AppButtons"):-File ( "Camera.lnk", "\ Windows \ Camera.lnk")
Directory ( "\ Windows \ AppButtons"):-File ( "Comm Manager.lnk", "\ Windows \ CommManager.lnk")
Directory ( "\ Windows \ StartUp"):-File ( "BPInsert.lnk", "\ Windows \ BPInsert.lnk")
Directory ( "\ Windows \ StartUp"):-File ( "coldinit.lnk", "\ Windows \ coldinit.lnk")
Directory ( "\ Windows \ StartUp"):-File ( "bugtrap.lnk", "\ Windows \ bugtrap.lnk");
Directory ( "\ Windows \ StartUp"):-File ( "poutlook.lnk", "\ Windows \ poutlook.lnk")
Directory ( "\ Windows \ StartUp"):-File ( "HandsFree.lnk", "\ Windows \ HandsFree.lnk")
Directory ( "\ Windows \ StartUp"):-File ( "Welcome.lnk", "\ Windows \ welcome.lnk")
Directory ( "\ Windows \ StartUp"):-File ( "ScreenRotate.lnk", "\ Windows \ ScreenRotate.lnk")
;================================================= =========================
; End - SAP MASD customization settings
;================================================= =========================
;================================================= ================================================
; Pocket RAR Home
;================================================= ================================================
Directory ( "\ Windows \ Start Menu \ Programs"):-Directory ( "System")
Directory ( "\ Windows \ Start Menu \ Programs \ System"):-File ( "Pocket RAR.lnk", "\ Windows \ RAR.lnk Pocket")
;================================================= ================================================
; Pocket RAR End
;================================================= ================================================
Then, open *.rgu and copy its contents to default.rgu or user.rgu.
Writing kluchy, is dependent on its path. Each new path has to be in this part of the registry where the key begins in the same way.
An example of a registry entry for PocketRAR:
Code:
[HKEY_CLASSES_ROOT \. zip]
@ = "PocketRAR"
[HKEY_CLASSES_ROOT \. Rar]
@ = "PocketRAR"
So we have to place it where keys start with:
Code:
[HKEY_CLASSES_ROOT]
If the operation completed successfully, that the application will work poprawnie.Do modify the registry, are the various outputs, my way is not a last resort. This type of keys, and their removal also save our memory, which is extremely low.
We can also replace the driver or a new version of the program such as File Explore - in this case, replace the virtual memory address and the address of relocation, because otherwise this application does not start. Saved as a module, which is different from the file? Look up to our dump, you can see the difference at first glance, the content is located in the directory.
The fact is that the conversion module, with the newer ROM version, we also need to replace these two values as described above. Podmieniając file, we do not have the obligation to relocate, even under the old addresses.
Welcome to Part three of this Course
To translate the system - the relationship and functionality of files and modules ....
​

Is there any software which can automaticaly close HTC Sense?

I am using a diamond with Energy rom, very nice interface but it eat up a lot of ram.
each time i want to run my garmin i have to go to setting home and disable htc sense in order to gain enough memory.
is there any application which can automatically help me switch off sense when i launch garmin, and restart sense when i close garmin?
would appreciate if anybody can give me a idea.
thanks.
there is a script (.cab file) h**p://forum.xda-developers.com/showthread.php?t=598342
sry for ** i cant make links
this is the script (iGo-launcher.mscr), that you still have to adjust for garmin
Code:
If ( ProcExists("igo8.exe") )
Exit
EndIf
PRG=1
STR=2
# WWE
dirs[1][PRG]= "Program Files"
dirs[1][STR]= "Storage Card" [COLOR="Red"]<<<< path from you internal storage, you must edit for diamond !!![/COLOR]
# ITA
dirs[2][PRG]= "Programmi"
dirs[2][STR]= "Scheda di Memoria"
# GER
dirs[3][PRG]= "Programme"
dirs[3][STR]= "Interner Speicher"
# DUT
dirs[4][PRG]= "Programmabestanden"
dirs[4][STR]= "Opslagkaart"
# SPA
dirs[5][PRG]= "Archivos de programa"
dirs[5][STR]= "Tarjeta de almacenamiento"
lang_count= 4
lang= 0
i= 0
While ( lang=0 and i<lang_count )
i= i+1
If ( DirExists( "\" \ dirs[i][STR] \ "\" ) )
lang= i
EndIf
EndWhile
If ( lang = 0 )
Message ( "Unsupported language." )
Exit
EndIf
ShowWaitCursor
manilastate= ProcExists("manila.exe")
If (manilastate)
RegWriteDword ("HKLM","Software\Microsoft\Today\Items\HTC Sense","Enabled",0)
RedrawToday
Close(ActiveWindow())
RedrawToday
endif
Kill("Messaging_Client.exe")
Kill("fexplore.exe")
HideWaitCursor
If ( FileExists("\Windows\htcAddicts_cleanRAM.exe") )
RunWait("\Windows\htcAddicts_cleanRAM.exe")
ElseIf ( FileExists( "\" \ dirs[lang][PRG] \ "htcaddicts cleanram\htcAddicts_cleanRAM.exe") )
RunWait( "\" \ dirs[lang][PRG] \ "htcaddicts cleanram\htcAddicts_cleanRAM.exe" )
ElseIf ( FileExists( "\" \ dirs[lang][STR] \ dirs[lang][PRG] \ "htcaddicts cleanram\htcAddicts_cleanRAM.exe") )
RunWait( "\" \ dirs[lang][STR] \ dirs[lang][PRG] \ "htcaddicts cleanram\htcAddicts_cleanRAM.exe") )
EndIf
RunWait( "\" \ dirs[lang][STR] \ "iGO8\igo8.exe" )
Sleep(5000)
Kill("Repllog.exe")
While ( ProcExists("igo8.exe") )
IdleTimerReset
Sleep(500)
EndWhile
If (manilastate)
ShowWaitCursor
RegWriteDword ("HKLM","Software\Microsoft\Today\Items\HTC Sense","Enabled",1)
Run("\windows\manila.exe")
HideWaitCursor
RedrawToday
endif
it works perfect for igo8.
I hope I could help you a bit and sorry for my english, am from germany
bye

[TOOL][WIN][v1.86b][Updated]Bootanimation.zip to Mp4 Video and converter/porter

This is a Windows tool that will convert your bootanimation.zip into a Mp4 video.
This is a Boot Animation emulator, it unzips the zip file then takes information from the desc.txt file, and does what android would do with all of the images and folders. You can either pull your bootanimation file from your device with this program, or put bootanimation zip files in the "zips" folder that gets created first time you run this program.
This is ideal for making Youtube videos as it takes every detail from your bootanimation file, and uses it like android would. If an image is called to pause for 25 frames after a part has played, then replay the folder with a 3 frame pause, it will. You may also play with framerates, and resolutions.
Videos made can also be strung together in the program through a search of a string in the video name, ie resolution, or you can concatenate all of them.
Updated March 23rd, 2014
V1.86b
-Added support for Mp4 style boot animations
-Added quickport, where you can easily change the resolution of a bootanimation zip
-Added a converter to go from a Jpg/Png style bootanimation to Mp4 style or vice versa
-Changed all file/folder location references to full paths for speed, and reliability
-Added logging to help troubleshoot any issues that may arise
-Added an option to scale Gifs to a different size​
Click the button below for an explanation of what I do, and see exactly how the process works.
When you load a zip file, it is automatically unzipped, and searched for a desc.txt file in the root directory. It moves the zipped file, if it was pulled from your device, into the "zips" folder. It then reads your desc.txt file and finds the first line that starts with a number. That will be your resolution and framerate. Then it gets the rest of the folder information for putting the animation together. I never alter your actual bootanimation file.
Most bootanimations have something similar to this in their last line: p 0 0 part6 That first 0 after the p indicates to android, to play continuously until the device OS is loaded. Some have a: c 0 0 part6 This is almost the same thing, but it will play at least once, and it will play all of the way through the animation of part6, no matter what the boot status is of your device.
Since we a making a video out of all this, we have to simulate boot. So if you have any parts with the 0 immediately after the p or c, then you will be prompted to input how many times you want that folder to loop for the video.
You are ready to make a video now. This is where the complexity of the whole process happens. You don't have to worry about it though. Some folders of images will have a pause frame at the end of the part, so I copy that image X number of times, renumber all the files, make the video for that part, and trim the files back to the original images. The video is then saved in a temp folder as the rest of the videos are made for each folder call, using the same process, which actually may be different (it all depends on what the desc.txt file calls for). At the end, the different videos are concatenated together, with folder repeats included, to form the final video and or Gif.
This happens a lot quicker than it sounds!
I am not responsible if you brick your phone or fry your computer. Always make backups!
Download Bootanimation to Mp4 v1.86b
This rar archive contains the programs:
ADB - Used to communicate between your computer and device
7ZA - Used to zip and unzip the boot animation zip files
FFMPEG - Used to convert media from one type to another
It also contains two dll files for ADB. These five files are in the 'bin' folder in the download. The last file included is the batch script named RUNba2mp4v186b.bat. Run this file.
The batch file can be found in these two posts #22 and #23 in this thread:
Part 1 of 2
Part 2 of 2
Some versions of Windows (particularly XP and/or Win2k) dropped support for the choice command for a couple of years then picked it back up. I use the choice command extensively for my menus. Ba2mp4 will not work without this command. To see if you have choice, you can simply open up a command prompt window anywhere, and type "choice"
- If you are prompted with [Y,N]? then you have the choice command and are good to go.
- If you see 'choice' is not recognized as an internal or external command..... then you don't have it.
You can download choice.com or choice.exe from a number of websites. If you are unsure of what to download feel free to pm me and I will help you out, or make a version that will work for you. Please don't download an executable program from an untrusted site, you could do serious damage to your computer and/or your past, present, and future data can all be compromised. There are too many trusted sites for me to list with different versions for different operating systems.​
If you experience a video that looks messed up:
Almost every time this happens, it is because your computer can not keep up with the huge amounts of data streams some of the higher resolution boot animations can create. You can usually tell if it is your computer or the video file by simply letting it play one time, then let it loop back and replay the video, and all of the sudden everything is smooth. If you upload it to Youtube it will play perfect. If you play the video on a nicer computer, it will play perfect. lol You may set the compression level a little lower if you are just making a video for yourself on your computer.​This guy is a really good animator. I doubled the resolution on this one, and set the end to repeat 6 times. This animation was done by @overhauling and can be found here!
I did not make this bootanimation, or any of these, just the videos. Here is the link to the thread.
These next two I doubled the resolution on to make Youtube give the "HD" option. Some of them, it seems, might be 720x1280 but Youtube won't view it as 720p because it is portrait mode. Thanks to @Frigorio for the first one below. Here is the link to his thread.
This video below shows the concatenation feature. I used only videos in my "videos" folder that contained the string "x1280" and came up with this video. I wish I would of doubled the resolution on them to make Youtube give me the "HD" option, but you get the point.
Thanks to @raishiro for the following sweet animations, also the black and white funky one up above. Here is the forum link to these bootanimations.
Changelog:
v1.0 2/16/14Initial upload​v1.1 2/16/14Fixed bug in repeating folders that weren't the last folder
Added fps and frames in each folder when inputting repeats of the folders with repeat "0"
Changed the number of lines in zip file select screen from 200 to 70
Several small changes​v1.6 2/21/14Added support for endless folders, repeats
Fixed error for using jpgs in one folder and pngs in another
Tightened up code making the video to make it faster
Added frame counters and timing indicators​v1.61 2/22/14Reduced calls in loops surrounding/in video processing
Added Gifs folder for ... gifs
Added check in system\media in case zip file is a flashable zip
Added a check in # of zip files to know whether to expand window or not that displays them​v1.86b 3/23/14Added support for Mp4 style boot animations
Added quickport, where you can easily change the resolution of a bootanimation zip
Added a converter to go from a Jpg/Png style bootanimation to Mp4 style or vice versa
Changed all file/folder location references to full paths for speed, and reliability
Added logging to help troubleshoot any issues that may arise
Added an option to scale Gifs to a different size​
Click the button below for the batch script:
Code:
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
MODE CON:COLS=57 LINES=80
color 0B
SET "vers=1.61"
TITLE Boot Animation to Mp4 v%vers%
SET /A colines=80
SET "outputtogif="
SET "androidfolder=/data/local/"
SET "savefolder=videos"
SET "ext=jpg"
SET "savename=bootanimation"
SET "quality=-crf 23"
SET "videotype=mp4"
SET "ffdebug=-loglevel fatal"
SET "ffshowb=-hide_banner"
SET "stno=-start_number 0"
SET "stnorng=-start_number_range 99"
IF "%~1"=="-d" (
SET "debugmode=1"
SET "ffdebug=-loglevel debug"
SET "ffshowb=%"
MODE CON:COLS=140 LINES=4000
COLOR 07
)
IF NOT EXIST gifs MKDIR gifs
IF NOT EXIST zips MKDIR zips
IF NOT EXIST %savefolder% MKDIR %savefolder%
IF EXIST concatallthese.txt DEL concatallthese.txt
IF EXIST copylist.txt DEL copylist.txt
IF EXIST temp\ RMDIR temp /s /q
:MAINMENUBA2MP4
IF EXIST concatallthese.txt DEL concatallthese.txt
IF EXIST temp\ RMDIR temp /s /q
CALL :COUNTFILES >NUL 2>&1
CALL :DRAWHEADBA2MP4
CALL :RESETVALUES
ECHO Please choose one of the following...
ECHO[
ECHO 1 - Use ADB to pull your boot animation.
ECHO[
ECHO 2 - Convert zips in the folder "zips"
ECHO[
ECHO 3 - Combine videos in "videos" into one.
ECHO[
ECHO 4 - Exit
ECHO[
CHOICE /C:1234
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF ERRORLEVEL 3 SET K=3
IF ERRORLEVEL 4 SET K=4
IF %K%==1 GOTO :ADBTOGETIT
IF %K%==2 GOTO :BAZIPSFOLDER
IF %K%==3 GOTO :CONCATALL
IF %K%==4 GOTO :FINISH
GOTO :MAINMENUBA2MP4
:ADBTOGETIT
CALL :GETBA
CALL :UNZIP "%savename%.zip"
SET "filename=%savename%.zip"
CALL :STRIP
CALL :READDESC
GOTO :YOURSETTINGS
GOTO :MAINMENUBA2MP4
:BAZIPSFOLDER
IF %filesinbaz% LSS 1 GOTO :MAINMENUBA2MP4
SET /a index=1
FOR /F "delims=" %%E IN ('dir zips\ /a-d-h /b *.zip') DO (
SET "zipfile[!index!]=%%E"
SET /a index+=1
)
SET /A themost=index-1
IF %themost% GTR 72 SET /A colines=%themost% + 10
IF NOT DEFINED debugmode MODE CON:COLS=57 LINES=%colines%
FOR /l %%I in (1,1,%themost%) DO ECHO %%I. !zipfile[%%I]!
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO Choose a number and press enter...
ECHO[
:LOOPBACK
SET /p pickazip=:
IF "%pickazip%"=="" GOTO :LOOPBACK
IF %pickazip% LSS 1 GOTO :LOOPBACK
IF %pickazip% GTR %themost% GOTO :LOOPBACK
SET savename=!zipfile[%pickazip%]!
IF NOT DEFINED debugmode MODE CON:COLS=57 LINES=80
CALL :UNZIP "zips\%savename%"
SET "filename=%savename%"
CALL :STRIP
CALL :READDESC
GOTO :YOURSETTINGS
:STRIP
SET savename=%savename:.zip=%
SET savename=%savename:(=%
SET savename=%savename:)=%
SET savename=%savename: =%
SET savename=%savename:&=%
GOTO :EOF
:RESETVALUES
SET append=
SET "savename=bootanimation"
SET outputtogif=
SET gif=
SET strang=
SET width=
SET height=
SET fps=
SET fpsout=
GOTO :EOF
:FILLTHEVOID
CALL :DRAWSETTINGS
ECHO[
ECHO[
ECHO[
ECHO When you have a 'p'with'0' as the first number on a line
ECHO Android will play the folder until booted. Since there
ECHO will not be a boot, you need to enter how many times you
ECHO want this folder to loop for the video. A "c" then "0"
ECHO is a little different, but if you have a 'c' then '0'
ECHO I would still need a loop value for the video.
ECHO _________________________________________________________
ECHO[
ECHO[
ECHO[
:LOOP2
FOR /L %%P IN (1,1,%staticfoldercount$%) DO (
IF !folderrepeats[%%P]! EQU 0 (
SET /A secondsperloop[%%P]=!frames[%%P]!/%fps% >NUL 2>&1
SET /A secondsperlooprem[%%P]=!frames[%%P]!%%%fps% >NUL 2>&1
ECHO[
ECHO FOLDER %%P: !folder[%%P]! NEEDS A VALUE TO LOOP FOR VIDEO
ECHO[
ECHO One loop of this folder will last !secondsperloop[%%P]! !secondsperlooprem[%%P]!/%fps% seconds
ECHO[
SET /P folderrepeats[%%P]=:
IF "!folderrepeats[%%P]!"=="" GOTO :LOOP2
IF !folderrepeats[%%P]! LSS 1 GOTO :LOOP2
ECHO[
)
)
GOTO :EOF
:DRAWSETTINGS
CLS
ECHO[
ECHO File:%filename%
ECHO ______________________________________________________-_-
FOR /l %%z IN (1,1,%staticfoldercount$%) DO (
SET /A totalwithrepeats[%%z]=!frames[%%z]!*!folderrepeats[%%z]!
SET /A stime[%%z]=!totalwithrepeats[%%z]!/%fps% >NUL 2>&1
SET /A dtime[%%z]=!totalwithrepeats[%%z]!%%%fps% >NUL 2>&1
ECHO %%z: !foldertype[%%z]! !folderrepeats[%%z]! !pauselastframe[%%z]! !folder[%%z]!
)
ECHO _________________________________________________________
FOR /l %%M IN (1,1,%staticfoldercount$%) DO ECHO !folder[%%M]! Frames: !frames[%%M]! x !folderrepeats[%%M]! Length: !stime[%%M]! !dtime[%%M]!/%fps% seconds
ECHO _________________________________________________________
SET /A grandtotal=0
FOR /L %%R IN (1,1,%staticfoldercount$%) DO SET /A grandtotal=!grandtotal!+!totalwithrepeats[%%R]!
ECHO Total frames: %grandtotal%
SET /A totaltime=%grandtotal% / %fps%
SET /A fractiontime=%grandtotal%%%%fps
ECHO Total time: %totaltime% %fractiontime%/%fps% seconds
ECHO _________________________________________________________
ECHO[
ECHO Resolution: %width%X%height% @ %fps%fps in and %fpsout%fps out
ECHO[
ECHO FFmpeg quality is set at %quality% on a scale of 0 to 51
ECHO _________________________________________________________
GOTO :EOF
:YOURSETTINGS
CALL :GETEXT 1
CALL :DRAWSETTINGS
SET K=
ECHO[
ECHO[
ECHO[
ECHO[
ECHO Please choose one of the following...
ECHO[
ECHO[
ECHO[
ECHO[
ECHO 1 - Continue, and make %videotype%.
ECHO[
ECHO 2 - Continue, and make %videotype% ^& gif.
ECHO[
ECHO 3 - Change the video compression level.
ECHO[
ECHO 4 - Change the resolution.
ECHO[
ECHO 5 - Change the fps.
ECHO[
ECHO 6 - Reload desc.txt ^<^<reset fps/resolution/repeats^<^<
ECHO[
ECHO 7 - Go back to the Main Menu
ECHO[
ECHO 8 - Exit
ECHO[
ECHO[
ECHO[
CHOICE /C:12345678
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF ERRORLEVEL 3 SET K=3
IF ERRORLEVEL 4 SET K=4
IF ERRORLEVEL 5 SET K=5
IF ERRORLEVEL 6 SET K=6
IF ERRORLEVEL 7 SET K=7
IF ERRORLEVEL 8 SET K=8
IF %K%==1 GOTO :LETSDOIT
IF %K%==2 SET "gif=true" & GOTO :LETSDOIT
IF %K%==3 CALL :CHANGECRF
IF %K%==4 CALL :CHANGERES
IF %K%==5 CALL :CHANGEFPS
IF %K%==6 CALL :READDESC
IF %K%==7 GOTO :MAINMENUBA2MP4
IF %K%==8 GOTO :FINISH
GOTO :YOURSETTINGS
:CHANGECRF
CALL :DRAWSETTINGS
ECHO[
ECHO[
ECHO[
ECHO[
ECHO _________________________________________________________
ECHO The default crf value is 23. You can set it all the way
ECHO to 0 for lossless compression. Your video player more
ECHO than likely won't even play it. Youtube will though!
ECHO _________________________________________________________
:LOOP3
ECHO[
SET /p crf=What quality (0-51)?
IF "%crf%"=="" GOTO :LOOP3
IF %crf% LSS 0 GOTO :LOOP3
IF %crf% GTR 51 GOTO :LOOP3
SET "quality=%quality:~0,5%%crf%"
GOTO :EOF
:CHANGEFPS
CALL :DRAWSETTINGS
ECHO[
ECHO[
ECHO[
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO Your inbound fps is what you will see the animation being
ECHO[
ECHO rendered at. Your outbound fps is how many fps the video
ECHO[
ECHO will be encoded at.
ECHO _________________________________________________________
ECHO[
SET /P fps=Enter your inbound fps?
ECHO[
SET /P fpsout=Enter your outbound fps?
ECHO[
GOTO :EOF
:CHANGERES
CALL :DRAWSETTINGS
ECHO[
ECHO[
ECHO[
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO Some boot animations have a very narrow height. A mp4
ECHO[
ECHO may turn out corrupt because of this. If you have an
ECHO[
ECHO issue with a boot animation of this type, add 100 pixels
ECHO[
ECHO or so to the HEIGHT.
ECHO _________________________________________________________
ECHO[
SET /P width=Enter the width?
ECHO[
SET /P height=Enter the height?
ECHO[
GOTO :EOF
:GETBA
SET "androidfolder=/data/local/"
IF EXIST temp\ RMDIR temp /s /q
CALL :DRAWHEADBA2MP4
ECHO _________________________________________________________
ECHO The default location to get your bootanimation.zip is
ECHO %androidfolder%
ECHO _________________________________________________________
ECHO[
ECHO Please choose one of the following...
ECHO[
ECHO 1 - Pull bootanimation.zip from /data/local/
ECHO[
ECHO 2 - Specify a different location.
ECHO[
ECHO 3 - Specify a different filename ^& location.
ECHO[
ECHO 4 - Go back to the main menu.
ECHO[
ECHO 5 - Exit
ECHO[
ECHO[
CHOICE /C:12345
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF ERRORLEVEL 3 SET K=3
IF ERRORLEVEL 4 SET K=4
IF ERRORLEVEL 5 SET K=5
IF %K%==1 (SET "androidfolder=/data/local/"
SET "savename=bootanimation"
CALL :PULLBA
GOTO :EOF)
IF %K%==2 CALL :NEWFOLDER
IF %K%==3 CALL :NEWFOLDERANDFILE
IF %K%==4 GOTO :MAINMENUBA2MP4
IF %K%==5 GOTO :FINISH
SET "androidfolder=/data/local/"
GOTO :EOF
:NEWFOLDER
CALL :DRAWHEADBA2MP4
ECHO[
ECHO Enter the location in the format of /folder/folder/
ECHO OR /folder/
ECHO[
SET /P androidfolder=:
SET "savename=bootanimation"
CALL :PULLBA
GOTO :EOF
:NEWFOLDERANDFILE
CALL :DRAWHEADBA2MP4
ECHO[
ECHO Enter the location in the format of /folder/folder/
ECHO OR /folder/
ECHO[
SET /P androidfolder=:
ECHO[
ECHO Enter the name of the zip file.
ECHO[
SET /P savename=:
SET savename=%savename:.zip=%
CALL :PULLBA
GOTO :EOF
:PULLBA
ADB kill-server -d >NUL 2>&1
ECHO[
ECHO[
ADB pull %androidfolder%%savename%.zip %savename%.zip >NUL 2>&1
IF ERRORLEVEL 1 (cls
ECHO[
ECHO THERE WAS AN ERROR!
ECHO[
ECHO Either %savename%.zip wasn't in %androidfolder%
ECHO[
ECHO OR....
ECHO ______________________________________________________
ECHO Adb is not properly connected.
ECHO[
ECHO Try "Safely Removing" your device from your computer
ECHO[
ECHO Then unplug your usb cable, and reinsert it.
ECHO ______________________________________________________
ECHO[
ECHO[
ECHO Press any key to try again.
ECHO[
ECHO[
PAUSE >NUL
GOTO :GETBA
)
SET filename=%savename%.zip
GOTO :EOF
:DRAWHEADBA2MP4
CLS
ECHO[
ECHO ______________________________________________________-_-
ECHO[
ECHO Boot Animation 2 %videotype% v%vers%
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO Written by makers_mark
ECHO[
ECHO _________________________________________________________
ECHO[
GOTO :EOF
:READDESC
SET /a staticfoldercount$=0
FOR /F "tokens=1-3 delims= " %%L IN ('FINDSTR /I "^[0-9]" "%~dp0temp\desc.txt"') DO CALL :GETRES %%L %%M %%N
FOR /F "tokens=1-4 delims= " %%L IN ('FINDSTR /I "^P ^C" "%~dp0temp\desc.txt"') DO CALL :FOLDERS %%L %%M %%N %%O
CALL :FILLTHEVOID
GOTO :EOF
:GETRES
SET /A width=%1
SET /A height=%2
SET /A fps=%3
SET /A fpsout=%fps%
GOTO :EOF
:FOLDERS
SET /A staticfoldercount$+=1
FOR /F %%A in ('dir temp\%~4\*.* /a-d-s-h /b ^| FIND /v /c ""') DO SET /A filesinfolder[%staticfoldercount$%]=%%A
SET foldertype[%staticfoldercount$%]=%1
SET /A folderrepeats[%staticfoldercount$%]=%2
SET /A pauselastframe[%staticfoldercount$%]=%3
SET folder[%staticfoldercount$%]=%4
SET /A frames[%staticfoldercount$%]=!filesinfolder[%staticfoldercount$%]! + !pauselastframe[%staticfoldercount$%]!
CALL :GETEXT %staticfoldercount$%
GOTO :EOF
:GETEXT
FOR %%f IN (temp\!folder[%~1]!\*.*) DO SET "ext=%%f"
SET extinfolder[%~1]=!ext:~-3!
GOTO :EOF
:LETSDOIT
CALL :DRAWSETTINGS
ECHO[
CALL :NAMEPREFIX
IF DEFINED gif SET "outputtogif=-y gifs\%savename%.gif"
SET /A checkheight=%height%%%2
SET /A checkwidth=%width%%%2
IF %checkheight% EQU 1 (SET /A height-=1 & ECHO Height has been adjusted 1 pixel)
IF %checkwidth% EQU 1 (SET /A width-=1 & ECHO Width has been adjusted 1 pixel)
ECHO Working..
FOR /L %%A IN (1,1,%staticfoldercount$%) DO (
ECHO %%A/!staticfoldercount$!...!folder[%%A]!..........
IF !pauselastframe[%%A]! GEQ 1 CALL :COPYREPEATEDFRAMES %%A >NUL 2>&1
CALL :RENUM "!folder[%%A]!" !extinfolder[%%A]! >NUL 2>&1
FFMPEG %ffdebug% %ffshowb% %stno% %stnorng% -f image2 -r %fps% -i temp\!folder[%%A]!\%%08d.!extinfolder[%%A]! -tune stillimage -c:v libx264 -s %width%x%height% -vf "fps=%fpsout%, format=yuv420p" %quality% -y "temp\buffer\%%A%savename%.%videotype%" || GOTO :FFVIEW
ECHO !folder[%%A]! complete
IF !pauselastframe[%%A]! GEQ 1 CALL :TRIMFRAMES %%A >NUL 2>&1
FOR /L %%J in (1,1,!folderrepeats[%%A]!) DO ECHO file temp\\buffer\\%%A%savename%.%videotype%>>copylist.txt
)
IF %checkheight% EQU 1 SET /A height+=1
IF %checkwidth% EQU 1 SET /A width+=1
SET checkheight=
SET checkwidth=
GOTO :FINISHVIDEO
:TRIMFRAMES
SET /A piks=!filesinfolder[%~1]!
FOR /F "skip=%piks% eol=: delims=" %%F IN ('dir "temp\!folder[%~1]!\*.!extinfolder[%~1]!" /a-d-h/b /on ') DO DEL temp\!folder[%~1]!\%%F
GOTO :EOF
:COPYREPEATEDFRAMES
FOR /F "delims=" %%t IN ('dir "temp\!folder[%~1]!\*.!extinfolder[%~1]!" /a-d-h /on /b') DO SET "filetocopy=%%t"
FOR /L %%Y IN (1,1,!pauselastframe[%~1]!) DO COPY temp\!folder[%~1]!\%filetocopy% temp\!folder[%~1]!\z%%Y%filetocopy%
GOTO :EOF
:NAMEPREFIX
SET append=%TIME::=_%
SET append=%append:.=%
SET savename=%fps%_%fpsout%_%width%X%height%_crf%quality:~-2%_%savename%%append%
SET savename=%savename: =%
GOTO :EOF
:FINISHVIDEO
FFMPEG %ffdebug% %ffshowb% -f concat -i copylist.txt -vcodec copy -y %savefolder%\%savename%.%videotype% %outputtogif% || GOTO :FFVIEW
IF NOT EXIST %savefolder%\%savename%.%videotype% GOTO :FFVIEW
ECHO ______________________________________________________-_-
ECHO[
ECHO \\\\\\\\\\\\\\\\\\\\\\\\\\DONE///////////////////////////
ECHO[
ECHO Video saved as:\%savefolder%\
ECHO %savename%.%videotype%
IF DEFINED outputtogif (
ECHO _________________________________________________________
ECHO Gif saved as:\gifs\
ECHO %savename%.gif
ECHO[
)
ECHO[
ECHO //////////////////////////DONE\\\\\\\\\\\\\\\\\\\\\\\\\\\
ECHO _________________________________________________________
SET "outputtogif="
SET gif=
SET "savename=%filename%"
CALL :STRIP
ECHO Press a key to continue
PAUSE >NUL
DEL /Q temp\buffer\*.%videotype%
DEL copylist.txt
GOTO :YOURSETTINGS
:CONCATALL
IF %filesinbav% LSS 1 GOTO :MAINMENUBA2MP4
IF EXIST concatallthese.txt DEL concatallthese.txt
CALL :DRAWHEADBA2MP4
ECHO[
ECHO _________________________________________________________
ECHO This will put all videos together that are currently in
ECHO[
ECHO the folder videos\ You might experience errors with
ECHO[
ECHO the video or no video produced if the resolutions are
ECHO[
ECHO different on a video to video comparison basis.
ECHO _________________________________________________________
ECHO I highly recommend you to hit option 2 to only use
ECHO[
ECHO %videotype%'s that share a common string in the name.
ECHO _________________________________________________________
ECHO[
ECHO 1 - Concatenate ALL videos
ECHO[
ECHO 2 - Concatenate videos that have a common string in name
ECHO[
ECHO 3 - Go back to the main menu
ECHO[
ECHO 4 - Exit
ECHO[
CHOICE /C:1234
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF ERRORLEVEL 3 SET K=3
IF ERRORLEVEL 4 SET K=4
IF %K%==1 CALL :ALL
IF %K%==2 CALL :SOME
IF %K%==3 GOTO :MAINMENUBA2MP4
IF %K%==4 GOTO :FINISH
GOTO :MAINMENUBA2MP4
:SOME
SET strang=
CALL :DRAWHEADBA2MP4
SET /a index=1
FOR /F %%E in ('dir %savefolder%\*.%videotype% /a-d-h /b') DO (
SET "videofile[!index!]=%%E"
SET /a index+=1
)
SET /a themost=index-1
SET /a linesinsome=%themost% + 40
IF NOT DEFINED debugmode MODE CON:COLS=57 LINES=%linesinsome%
ECHO _________________________________________________________
FOR /l %%I in (1,1,%themost%) DO ECHO !videofile[%%I]!
ECHO _________________________________________________________
ECHO[
ECHO Please enter a search string. I will put together all
ECHO[
ECHO the files that contain whatever you type. Don't mix
ECHO[
ECHO files with different compression settings, and in some
ECHO[
ECHO cases resolutions. The compression setting value for
ECHO[
ECHO each file can be found right after the resolution in the
ECHO[
ECHO the file name. Default is crf 23.
ECHO[
ECHO An idea for a search string is the resolution...
ECHO or the crf value.....
ECHO[
:TRYITAGAIN
SET /P strang=:
ECHO[
FOR /F %%E IN ('dir %savefolder%\*.%videotype% /a-d-h /b^|findstr /rmic:"%strang%"') DO (ECHO file %savefolder%\\%%E>>concatallthese.txt
ECHO %savefolder%\%%E.%videotype% Added.
)
IF NOT EXIST concatallthese.txt GOTO :TRYITAGAIN
ECHO _________________________________________________________
ECHO[
ECHO These are the files matching: %strang%
ECHO[
ECHO 1 - Go back to the main menu
ECHO[
ECHO 2 - Continue
ECHO[
CHOICE /C:12
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 (IF NOT DEFINED debugmode (MODE CON:COLS=57 LINES=80)
GOTO :MAINMENUBA2MP4)
IF %K%==2 CALL :NAMECONCATALL %strang%
CALL :MAKECONCAT
IF NOT DEFINED debugmode (MODE CON:COLS=57 LINES=80)
GOTO :MAINMENUBA2MP4
:ALL
FOR /F %%E IN ('dir %savefolder%\*.%videotype% /a-d-h /b') DO (ECHO file %savefolder%\\%%E>>concatallthese.txt
ECHO %savefolder%\%%E Added.
)
CALL :NAMECONCATALL
CALL :MAKECONCAT
GOTO :MAINMENUBA2MP4
:MAKECONCAT
IF NOT EXIST concatallthese.txt GOTO :EOF
ECHO[
ECHO _________________________________________________________
ECHO[
FFMPEG %ffdebug% %ffshowb% -f concat -i concatallthese.txt -vcodec copy -y %savefolder%\%savename%.%videotype% || GOTO :FFVIEW
ECHO[
ECHO Saved as:%savefolder%\%savename%.%videotype%
PAUSE >NUL
IF NOT DEFINED debugmode (MODE CON:COLS=57 LINES=80)
IF EXIST concatallthese.txt DEL concatallthese.txt
GOTO :MAINMENUBA2MP4
:RENUM
SET "index=00000000"
SET /A Q=1%index%
FOR /F "delims=" %%a IN ('dir temp\%~1\*.%~2/a-d-h /b *.%~2^|findstr /rxvc:"......[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\.%~2"') DO (
SET /a Q+=1
SET "name=%%~na"
REN "temp\%~1\%%~a" "!Q:~-8!%%~xa"
)
GOTO :EOF
:UNZIP
IF NOT EXIST temp\ MKDIR temp\
cd temp
IF NOT EXIST buffer\ MKDIR buffer\
cd..
CALL :DRAWHEADBA2MP4
7ZA -y x %1 -o"%~dp0temp" >NUL 2>&1
IF NOT EXIST temp\desc.txt 7za -y x temp\system\media\*.zip -o"%~dp0temp" >NUL 2>&1
IF NOT EXIST temp\desc.txt (
CALL :DRAWHEADBA2MP4
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO There isn't a desc.txt file in that zip...
ECHO[
ECHO Error was with the following zip file.
ECHO[
ECHO %1
ECHO[
ECHO Press any key to continue to the main menu.
ECHO[
PAUSE >NUL
RMDIR temp /s /q
GOTO :MAINMENUBA2MP4)
IF NOT EXIST zips\ MKDIR zips\
MOVE %~1 zips\%~1 >NUL 2>&1
GOTO :EOF
:NAMECONCATALL
SET savename=%TIME::=_%
SET savename=%savename:.=%
SET savename=%savename: =%
SET savename=%~1%savename%CC
GOTO :EOF
:COUNTFILES
FOR /F %%A IN ('dir videos\*.%videotype% /a-d-s-h /b ^| FIND /v /c ""') DO SET /A filesinbav=%%A >NUL 2>&1
FOR /F %%A IN ('dir zips\*.zip /a-d-s-h /b ^| FIND /v /c ""') DO SET /A filesinbaz=%%A >NUL 2>&1
GOTO :EOF
:FFVIEW
ECHO[
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO[
ECHO[
ECHO There was an error within FFmpeg. Run ba2mp4.bat -d
ECHO[
ECHO ^(with the parameter -d at the end^). The easiest way to
ECHO[
ECHO do this is right click in windows on ba2mp4 file and
ECHO[
ECHO in the menu select create shortcut. Right click on
ECHO[
ECHO the new shortcut, it will be "ba2mp4.bat - Shortcut"
ECHO[
ECHO select "Properties" and at the end of the target
ECHO[
ECHO (outside of the quote marks) put a -d
ECHO[
ECHO Now double click on the shortcut you made and see what
ECHO[
ECHO error messages come up while you try and repeat the
ECHO[
ECHO error in FFmpeg. If you PM me I will try and help you.
PAUSE >NUL
:FINISH
ADB kill-server -d >NUL 2>&1
IF EXIST temp\ RMDIR temp /s /q
ENDLOCAL
EXIT
Thanks! I´ll give it a try after work
Android-Andi said:
Thanks! I´ll give it a try after work
Click to expand...
Click to collapse
Any feedback is gratefully appreciated!:good:
Ain't got no windows... i've tried this before, in linux, and ffmpeg, and was able to get the video done for a particular folder, not for all the folders, and then, just merge the videos...
don't understand much of windows batch scripting (due to long term linux exposure)... if you'd say what you'd done to 'merge' the folders, and make a video?
It's great work, thanks for your share. i'll try.
thewisenerd said:
Ain't got no windows... i've tried this before, in linux, and ffmpeg, and was able to get the video done for a particular folder, not for all the folders, and then, just merge the videos...
don't understand much of windows batch scripting... if you'd say what you'd done to 'merge' the folders, and make a video?
Click to expand...
Click to collapse
Absolutely!
After a folder is made into a video I use the following line in the script:
Code:
FOR /L %%J in (1,1,!folderrepeats[%%A]!) DO ECHO file temp\\buffer\\%%A%savename%.%videotype%>>copylist.txt
This is a loop that is going to loop the number of times a folder is going to repeat (the first number after p). Each iteration of the loop it will write in regular text "file temp.....(the directory of the video file that was just saved).. to the file "copylist.txt" . Notice the >> double. In batch that appends to the file already (if one exists, if the file doesn't exist then that'll be your first line).
Copylist.txt is a text file that in the end will have a list of the small mp4 file locations in the specific format required by ffmpeg. Here is an example of a copylist.txt.
Code:
file temp\\buffer\\130_30_480X854_crf23_orangeDroidDoes20_48_3137.mp4
file temp\\buffer\\230_30_480X854_crf23_orangeDroidDoes20_48_3137.mp4
file temp\\buffer\\330_30_480X854_crf23_orangeDroidDoes20_48_3137.mp4
file temp\\buffer\\330_30_480X854_crf23_orangeDroidDoes20_48_3137.mp4
file temp\\buffer\\330_30_480X854_crf23_orangeDroidDoes20_48_3137.mp4
file temp\\buffer\\330_30_480X854_crf23_orangeDroidDoes20_48_3137.mp4
Those are the 6 videos that will be put together in the end with the ffmpeg concat filter. There are actually 3 different videos with the last one repeated 4 times. I chose 4 to loop the last one to simulate waiting for boot. See the naming prefix on the files 1,2,3,3,3,3.
In windows you have to use the double backslashes because the first backslash escapes the second one, so that when it goes back into ffmpeg (as a command) it is actually seen as one backslash. You would just put your directory normally if you are using Linux.
Thats all pretty simple and works out great for a loop. In the end I put all of the animations together with the "concat" filter in ffmpeg. Here is the line:
Code:
FFMPEG %ffdebug% %ffshowb% -f concat -i copylist.txt -vcodec copy -y %savefolder%\%savename%.%videotype% %outputtogif% || GOTO :FFVIEW
You may have to check with your version of ffmpeg, as some of the Linux versions are a bit older: So I can't say for sure whether or not you'll have access for it. I hope you do, it is seamless and backs the frames up perfectly.
EDIT: Just so you know. The text file I am writing to can be called anything, it doesn't have to be "copylist.txt" As long as it's referenced in the above line for ffmpeg to concat "yourlistyounamewhateveryouwant.txt" You don't even have to add the txt extension.
Just came by to say great work. Saw this on the XDA portal so I hope more devs will give video previews of their bootanimations
thx for the useful util..
i tried to run the batch file and got "Choice is not an internal or external command" error, and it exited..
for the record im using WinXP Professional..
iamelton said:
thx for the useful util..
i tried to run the batch file and got "Choice is not an internal or external command" error, and it exited..
for the record im using WinXP Professional..
Click to expand...
Click to collapse
I am sorry, some versions of XP and 2000 don't support "choice" which is a simple command in Windows to get user input. Just out of curiosity, do you have service pack 2?
One way to get it working is install the windows resource kit. Thank you for pointing that out I will update op today.
Thank you for this useful tool! I created this simple video using this.
http://youtu.be/-pG6J03_-gg
:good:
makers_mark said:
I am sorry, some versions of XP and 2000 don't support "choice" which is a simple command in Windows to get user input. Just out of curiosity, do you have service pack 2?
One way to get it working is install the windows resource kit. Or you can go here for a link to choice.com. Thank you for pointing that out I will update op today.
Click to expand...
Click to collapse
im using WinXP SP3.. but never mind its just my work pc.. and XP is going to die (or dead already)..
at home im using Win7 and it works fine.. with just a minor display issue..
on some screens the command window is so "long" that it extends beyond my display vertically.. is it possible to limit the window height so that it wont go beyond my screen? tia..
MatyiFKBT said:
Thank you for this useful tool! I created this simple video using this.
http://youtu.be/-pG6J03_-gg
:good:
Click to expand...
Click to collapse
You are welcome!:good:
iamelton said:
im using WinXP SP3.. but never mind its just my work pc.. and XP is going to die (or dead already)..
at home im using Win7 and it works fine.. with just a minor display issue..
on some screens the command window is so "long" that it extends beyond my display vertically.. is it possible to limit the window height so that it wont go beyond my screen? tia..
Click to expand...
Click to collapse
Yeah, I won't knock XP ( I preferred win 2000 for stability) but you should try and sway your employer to upgrade for no reason other than security's sake.
But here is v1.61 slightly modified (I took all the script lines that added screen lines out except for the debug option)
If your handy at copying and pasting::cyclops:
-Copy all the text behind the 'show content' button below and paste it into RUNba2mp4.bat file
If you are NOT proficient in the art of copying and pasting: Follow these instructions below
-Click the button on down in this post to "show content"
-Select ALL the text and copy it to your clipboard
-Open/edit your RUNba2mp4.bat file in any text editor.
-Select ALL of that text
-Right click on it and select 'Paste'
-Save
In the first couple lines of this new batch program, you'll see two variable declarations: cols$ and lines$
Change the values to whatever suits your screen. There isn't a way in batch, that I am aware of, to get the resolution of a users screen.
Code:
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET /A cols$=57
SET /A lines$=60
MODE CON:COLS=%cols$% LINES=%lines$%
COLOR 0B
SET "vers=1.61"
TITLE Boot Animation to Mp4 v%vers%
SET "outputtogif="
SET "androidfolder=/data/local/"
SET "savefolder=videos"
SET "ext=jpg"
SET "savename=bootanimation"
SET "quality=-crf 23"
SET "videotype=mp4"
SET "ffdebug=-loglevel fatal"
SET "ffshowb=-hide_banner"
SET "stno=-start_number 0"
SET "stnorng=-start_number_range 99"
IF "%~1"=="-d" (
SET "debugmode=1"
SET "ffdebug=-loglevel debug"
SET "ffshowb=%"
MODE CON:COLS=140 LINES=4000
COLOR 07
)
IF NOT EXIST gifs MKDIR gifs
IF NOT EXIST zips MKDIR zips
IF NOT EXIST %savefolder% MKDIR %savefolder%
IF EXIST concatallthese.txt DEL concatallthese.txt
IF EXIST copylist.txt DEL copylist.txt
IF EXIST temp\ RMDIR temp /s /q
:MAINMENUBA2MP4
IF EXIST concatallthese.txt DEL concatallthese.txt
IF EXIST temp\ RMDIR temp /s /q
CALL :COUNTFILES >NUL 2>&1
CALL :DRAWHEADBA2MP4
CALL :RESETVALUES
ECHO Please choose one of the following...
ECHO[
ECHO 1 - Use ADB to pull your boot animation.
ECHO[
ECHO 2 - Convert zips in the folder "zips"
ECHO[
ECHO 3 - Combine videos in "videos" into one.
ECHO[
ECHO 4 - Exit
ECHO[
CHOICE /C:1234
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF ERRORLEVEL 3 SET K=3
IF ERRORLEVEL 4 SET K=4
IF %K%==1 GOTO :ADBTOGETIT
IF %K%==2 GOTO :BAZIPSFOLDER
IF %K%==3 GOTO :CONCATALL
IF %K%==4 GOTO :FINISH
GOTO :MAINMENUBA2MP4
:ADBTOGETIT
CALL :GETBA
CALL :UNZIP "%savename%.zip"
SET "filename=%savename%.zip"
CALL :STRIP
CALL :READDESC
GOTO :YOURSETTINGS
GOTO :MAINMENUBA2MP4
:BAZIPSFOLDER
IF %filesinbaz% LSS 1 GOTO :MAINMENUBA2MP4
SET /a index=1
(FOR /F "delims=" %%E IN ('dir zips\ /a-d-h /b *.zip') DO (
SET "zipfile[!index!]=%%E"
SET /a index+=1
)) >NUL 2>&1
SET /A themost=index-1
FOR /l %%I in (1,1,%themost%) DO ECHO %%I. !zipfile[%%I]!
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO Choose a number and press enter...
ECHO[
:LOOPBACK
SET /p pickazip=:
IF "%pickazip%"=="" GOTO :LOOPBACK
IF %pickazip% LSS 1 GOTO :LOOPBACK
IF %pickazip% GTR %themost% GOTO :LOOPBACK
SET savename=!zipfile[%pickazip%]!
CALL :UNZIP "zips\%savename%"
SET "filename=%savename%"
CALL :STRIP
CALL :READDESC
GOTO :YOURSETTINGS
:STRIP
SET savename=%savename:.zip=%
SET savename=%savename:(=%
SET savename=%savename:)=%
SET savename=%savename: =%
SET savename=%savename:&=%
GOTO :EOF
:RESETVALUES
SET append=
SET "savename=bootanimation"
SET outputtogif=
SET gif=
SET strang=
SET width=
SET height=
SET fps=
SET fpsout=
GOTO :EOF
:FILLTHEVOID
CALL :DRAWSETTINGS
ECHO[
ECHO[
ECHO[
ECHO When you have a 'p'with'0' as the first number on a line
ECHO Android will play the folder until booted. Since there
ECHO will not be a boot, you need to enter how many times you
ECHO want this folder to loop for the video. A "c" then "0"
ECHO is a little different, but if you have a 'c' then '0'
ECHO I would still need a loop value for the video.
ECHO _________________________________________________________
ECHO[
ECHO[
ECHO[
:LOOP2
FOR /L %%P IN (1,1,%staticfoldercount$%) DO (
IF !folderrepeats[%%P]! EQU 0 (
SET /A secondsperloop[%%P]=!frames[%%P]!/%fps% >NUL 2>&1
SET /A secondsperlooprem[%%P]=!frames[%%P]!%%%fps% >NUL 2>&1
ECHO[
ECHO FOLDER %%P: !folder[%%P]! NEEDS A VALUE TO LOOP FOR VIDEO
ECHO[
ECHO One loop of this folder will last !secondsperloop[%%P]! !secondsperlooprem[%%P]!/%fps% seconds
ECHO[
SET /P folderrepeats[%%P]=:
IF "!folderrepeats[%%P]!"=="" GOTO :LOOP2
IF !folderrepeats[%%P]! LSS 1 GOTO :LOOP2
ECHO[
)
)
GOTO :EOF
:DRAWSETTINGS
CLS
ECHO[
ECHO File:%filename%
ECHO ______________________________________________________-_-
FOR /l %%z IN (1,1,%staticfoldercount$%) DO (
SET /A totalwithrepeats[%%z]=!frames[%%z]!*!folderrepeats[%%z]!
SET /A stime[%%z]=!totalwithrepeats[%%z]!/%fps% >NUL 2>&1
SET /A dtime[%%z]=!totalwithrepeats[%%z]!%%%fps% >NUL 2>&1
ECHO %%z: !foldertype[%%z]! !folderrepeats[%%z]! !pauselastframe[%%z]! !folder[%%z]!
)
ECHO _________________________________________________________
FOR /l %%M IN (1,1,%staticfoldercount$%) DO ECHO !folder[%%M]! Frames: !frames[%%M]! x !folderrepeats[%%M]! Length: !stime[%%M]! !dtime[%%M]!/%fps% seconds
ECHO _________________________________________________________
SET /A grandtotal=0
FOR /L %%R IN (1,1,%staticfoldercount$%) DO SET /A grandtotal=!grandtotal!+!totalwithrepeats[%%R]!
ECHO Total frames: %grandtotal%
SET /A totaltime=%grandtotal% / %fps%
SET /A fractiontime=%grandtotal%%%%fps
ECHO Total time: %totaltime% %fractiontime%/%fps% seconds
ECHO _________________________________________________________
ECHO[
ECHO Resolution: %width%X%height% @ %fps%fps in and %fpsout%fps out
ECHO[
ECHO FFmpeg quality is set at %quality% on a scale of 0 to 51
ECHO _________________________________________________________
GOTO :EOF
:YOURSETTINGS
CALL :DRAWSETTINGS
SET K=
ECHO[
ECHO[
ECHO[
ECHO[
ECHO Please choose one of the following...
ECHO[
ECHO[
ECHO[
ECHO[
ECHO 1 - Continue, and make %videotype%.
ECHO[
ECHO 2 - Continue, and make %videotype% ^& gif.
ECHO[
ECHO 3 - Change the video compression level.
ECHO[
ECHO 4 - Change the resolution.
ECHO[
ECHO 5 - Change the fps.
ECHO[
ECHO 6 - Reload desc.txt ^<^<reset fps/resolution/repeats^<^<
ECHO[
ECHO 7 - Go back to the Main Menu
ECHO[
ECHO 8 - Exit
ECHO[
ECHO[
ECHO[
CHOICE /C:12345678
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF ERRORLEVEL 3 SET K=3
IF ERRORLEVEL 4 SET K=4
IF ERRORLEVEL 5 SET K=5
IF ERRORLEVEL 6 SET K=6
IF ERRORLEVEL 7 SET K=7
IF ERRORLEVEL 8 SET K=8
IF %K%==1 GOTO :LETSDOIT
IF %K%==2 SET "gif=true" & GOTO :LETSDOIT
IF %K%==3 CALL :CHANGECRF
IF %K%==4 CALL :CHANGERES
IF %K%==5 CALL :CHANGEFPS
IF %K%==6 CALL :READDESC
IF %K%==7 GOTO :MAINMENUBA2MP4
IF %K%==8 GOTO :FINISH
GOTO :YOURSETTINGS
:CHANGECRF
CALL :DRAWSETTINGS
ECHO[
ECHO[
ECHO[
ECHO[
ECHO _________________________________________________________
ECHO The default crf value is 23. You can set it all the way
ECHO to 0 for lossless compression. Your video player more
ECHO than likely won't even play it. Youtube will though!
ECHO _________________________________________________________
:LOOP3
ECHO[
SET /p crf=What quality (0-51)?
IF "%crf%"=="" GOTO :LOOP3
IF %crf% LSS 0 GOTO :LOOP3
IF %crf% GTR 51 GOTO :LOOP3
SET "quality=%quality:~0,5%%crf%"
GOTO :EOF
:CHANGEFPS
CALL :DRAWSETTINGS
ECHO[
ECHO[
ECHO[
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO Your inbound fps is what you will see the animation being
ECHO[
ECHO rendered at. Your outbound fps is how many fps the video
ECHO[
ECHO will be encoded at.
ECHO _________________________________________________________
ECHO[
SET /P fps=Enter your inbound fps?
ECHO[
SET /P fpsout=Enter your outbound fps?
ECHO[
GOTO :EOF
:CHANGERES
CALL :DRAWSETTINGS
ECHO[
ECHO[
ECHO[
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO Some boot animations have a very narrow height. A mp4
ECHO[
ECHO may turn out corrupt because of this. If you have an
ECHO[
ECHO issue with a boot animation of this type, add 100 pixels
ECHO[
ECHO or so to the HEIGHT.
ECHO _________________________________________________________
ECHO[
SET /P width=Enter the width?
ECHO[
SET /P height=Enter the height?
ECHO[
GOTO :EOF
:GETBA
SET "androidfolder=/data/local/"
IF EXIST temp\ RMDIR temp /s /q
CALL :DRAWHEADBA2MP4
ECHO _________________________________________________________
ECHO The default location to get your bootanimation.zip is
ECHO %androidfolder%
ECHO _________________________________________________________
ECHO[
ECHO Please choose one of the following...
ECHO[
ECHO 1 - Pull bootanimation.zip from /data/local/
ECHO[
ECHO 2 - Specify a different location.
ECHO[
ECHO 3 - Specify a different filename ^& location.
ECHO[
ECHO 4 - Go back to the main menu.
ECHO[
ECHO 5 - Exit
ECHO[
ECHO[
CHOICE /C:12345
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF ERRORLEVEL 3 SET K=3
IF ERRORLEVEL 4 SET K=4
IF ERRORLEVEL 5 SET K=5
IF %K%==1 (SET "androidfolder=/data/local/"
SET "savename=bootanimation"
CALL :PULLBA
GOTO :EOF)
IF %K%==2 CALL :NEWFOLDER
IF %K%==3 CALL :NEWFOLDERANDFILE
IF %K%==4 GOTO :MAINMENUBA2MP4
IF %K%==5 GOTO :FINISH
SET "androidfolder=/data/local/"
GOTO :EOF
:NEWFOLDER
CALL :DRAWHEADBA2MP4
ECHO[
ECHO Enter the location in the format of /folder/folder/
ECHO OR /folder/
ECHO[
SET /P androidfolder=:
SET "savename=bootanimation"
CALL :PULLBA
GOTO :EOF
:NEWFOLDERANDFILE
CALL :DRAWHEADBA2MP4
ECHO[
ECHO Enter the location in the format of /folder/folder/
ECHO OR /folder/
ECHO[
SET /P androidfolder=:
ECHO[
ECHO Enter the name of the zip file.
ECHO[
SET /P savename=:
SET savename=%savename:.zip=%
CALL :PULLBA
GOTO :EOF
:PULLBA
ADB kill-server -d >NUL 2>&1
ECHO[
ECHO[
ADB pull %androidfolder%%savename%.zip %savename%.zip >NUL 2>&1
IF ERRORLEVEL 1 (cls
ECHO[
ECHO THERE WAS AN ERROR!
ECHO[
ECHO Either %savename%.zip wasn't in %androidfolder%
ECHO[
ECHO OR....
ECHO ______________________________________________________
ECHO Adb is not properly connected.
ECHO[
ECHO Try "Safely Removing" your device from your computer
ECHO[
ECHO Then unplug your usb cable, and reinsert it.
ECHO ______________________________________________________
ECHO[
ECHO[
ECHO Press any key to try again.
ECHO[
ECHO[
PAUSE >NUL
GOTO :GETBA
)
SET filename=%savename%.zip
GOTO :EOF
:DRAWHEADBA2MP4
CLS
ECHO[
ECHO ______________________________________________________-_-
ECHO[
ECHO Boot Animation 2 %videotype% v%vers%
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO Written by makers_mark
ECHO[
ECHO _________________________________________________________
ECHO[
GOTO :EOF
:READDESC
SET /a staticfoldercount$=0
FOR /F "tokens=1-3 delims= " %%L IN ('FINDSTR /I "^[0-9]" "%~dp0temp\desc.txt"') DO CALL :GETRES %%L %%M %%N
FOR /F "tokens=1-4 delims= " %%L IN ('FINDSTR /I "^P ^C" "%~dp0temp\desc.txt"') DO CALL :FOLDERS %%L %%M %%N %%O
CALL :FILLTHEVOID
GOTO :EOF
:GETRES
SET /A width=%1
SET /A height=%2
SET /A fps=%3
SET /A fpsout=%fps%
GOTO :EOF
:FOLDERS
SET /A staticfoldercount$+=1
FOR /F %%A in ('dir temp\%~4\*.* /a-d-s-h /b ^| FIND /v /c ""') DO SET /A filesinfolder[%staticfoldercount$%]=%%A
SET foldertype[%staticfoldercount$%]=%1
SET /A folderrepeats[%staticfoldercount$%]=%2
SET /A pauselastframe[%staticfoldercount$%]=%3
SET folder[%staticfoldercount$%]=%4
SET /A frames[%staticfoldercount$%]=!filesinfolder[%staticfoldercount$%]! + !pauselastframe[%staticfoldercount$%]!
CALL :GETEXT %staticfoldercount$%
GOTO :EOF
:GETEXT
FOR %%f IN (temp\!folder[%~1]!\*.*) DO SET "ext=%%f"
SET extinfolder[%~1]=!ext:~-3!
GOTO :EOF
:LETSDOIT
CALL :DRAWSETTINGS
ECHO[
CALL :NAMEPREFIX
IF DEFINED gif SET "outputtogif=-y gifs\%savename%.gif"
SET /A checkheight=%height%%%2
SET /A checkwidth=%width%%%2
IF %checkheight% EQU 1 (SET /A height-=1 & ECHO Height has been adjusted 1 pixel)
IF %checkwidth% EQU 1 (SET /A width-=1 & ECHO Width has been adjusted 1 pixel)
ECHO Working..
FOR /L %%A IN (1,1,%staticfoldercount$%) DO (
ECHO %%A/!staticfoldercount$!...!folder[%%A]!..........
IF !pauselastframe[%%A]! GEQ 1 CALL :COPYREPEATEDFRAMES %%A >NUL 2>&1
CALL :RENUM "!folder[%%A]!" !extinfolder[%%A]! >NUL 2>&1
FFMPEG %ffdebug% %ffshowb% %stno% %stnorng% -f image2 -r %fps% -i temp\!folder[%%A]!\%%08d.!extinfolder[%%A]! -tune stillimage -c:v libx264 -s %width%x%height% -vf "fps=%fpsout%, format=yuv420p" %quality% -y "temp\buffer\%%A%savename%.%videotype%" || GOTO :FFVIEW
ECHO !folder[%%A]! complete
IF !pauselastframe[%%A]! GEQ 1 CALL :TRIMFRAMES %%A >NUL 2>&1
FOR /L %%J in (1,1,!folderrepeats[%%A]!) DO ECHO file temp\\buffer\\%%A%savename%.%videotype%>>copylist.txt
)
IF %checkheight% EQU 1 SET /A height+=1
IF %checkwidth% EQU 1 SET /A width+=1
SET checkheight=
SET checkwidth=
GOTO :FINISHVIDEO
:TRIMFRAMES
SET /A piks=!filesinfolder[%~1]!
FOR /F "skip=%piks% eol=: delims=" %%F IN ('dir "temp\!folder[%~1]!\*.!extinfolder[%~1]!" /a-d-h/b /on ') DO DEL temp\!folder[%~1]!\%%F
GOTO :EOF
:COPYREPEATEDFRAMES
FOR /F "delims=" %%t IN ('dir "temp\!folder[%~1]!\*.!extinfolder[%~1]!" /a-d-h /on /b') DO SET "filetocopy=%%t"
FOR /L %%Y IN (1,1,!pauselastframe[%~1]!) DO COPY temp\!folder[%~1]!\%filetocopy% temp\!folder[%~1]!\z%%Y%filetocopy%
GOTO :EOF
:NAMEPREFIX
SET append=%TIME::=_%
SET append=%append:.=%
SET savename=%fps%_%fpsout%_%width%X%height%_crf%quality:~-2%_%savename%%append%
SET savename=%savename: =%
GOTO :EOF
:FINISHVIDEO
FFMPEG %ffdebug% %ffshowb% -f concat -i copylist.txt -vcodec copy -y %savefolder%\%savename%.%videotype% %outputtogif% || GOTO :FFVIEW
IF NOT EXIST %savefolder%\%savename%.%videotype% GOTO :FFVIEW
ECHO ______________________________________________________-_-
ECHO[
ECHO \\\\\\\\\\\\\\\\\\\\\\\\\\DONE///////////////////////////
ECHO[
ECHO Video saved as:\%savefolder%\
ECHO %savename%.%videotype%
IF DEFINED outputtogif (
ECHO _________________________________________________________
ECHO Gif saved as:\gifs\
ECHO %savename%.gif
ECHO[
)
ECHO[
ECHO //////////////////////////DONE\\\\\\\\\\\\\\\\\\\\\\\\\\\
ECHO _________________________________________________________
SET "outputtogif="
SET gif=
SET "savename=%filename%"
CALL :STRIP
ECHO Press a key to continue
PAUSE >NUL
DEL /Q temp\buffer\*.%videotype%
DEL copylist.txt
GOTO :YOURSETTINGS
:CONCATALL
IF %filesinbav% LSS 1 GOTO :MAINMENUBA2MP4
IF EXIST concatallthese.txt DEL concatallthese.txt
CALL :DRAWHEADBA2MP4
ECHO[
ECHO _________________________________________________________
ECHO This will put all videos together that are currently in
ECHO[
ECHO the folder videos\ You might experience errors with
ECHO[
ECHO the video or no video produced if the resolutions are
ECHO[
ECHO different on a video to video comparison basis.
ECHO _________________________________________________________
ECHO I highly recommend you to hit option 2 to only use
ECHO[
ECHO %videotype%'s that share a common string in the name.
ECHO _________________________________________________________
ECHO[
ECHO 1 - Concatenate ALL videos
ECHO[
ECHO 2 - Concatenate videos that have a common string in name
ECHO[
ECHO 3 - Go back to the main menu
ECHO[
ECHO 4 - Exit
ECHO[
CHOICE /C:1234
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF ERRORLEVEL 3 SET K=3
IF ERRORLEVEL 4 SET K=4
IF %K%==1 CALL :ALL
IF %K%==2 CALL :SOME
IF %K%==3 GOTO :MAINMENUBA2MP4
IF %K%==4 GOTO :FINISH
GOTO :MAINMENUBA2MP4
:SOME
SET strang=
CALL :DRAWHEADBA2MP4
SET /a index=1
FOR /F %%E in ('dir %savefolder%\*.%videotype% /a-d-h /b') DO (
SET "videofile[!index!]=%%E"
SET /a index+=1
)
SET /a themost=index-1
ECHO _________________________________________________________
FOR /l %%I in (1,1,%themost%) DO ECHO !videofile[%%I]!
ECHO _________________________________________________________
ECHO[
ECHO Please enter a search string. I will put together all
ECHO[
ECHO the files that contain whatever you type. Don't mix
ECHO[
ECHO files with different compression settings, and in some
ECHO[
ECHO cases resolutions. The compression setting value for
ECHO[
ECHO each file can be found right after the resolution in the
ECHO[
ECHO the file name. Default is crf 23.
ECHO[
ECHO An idea for a search string is the resolution...
ECHO or the crf value.....
ECHO[
:TRYITAGAIN
SET /P strang=:
ECHO[
FOR /F %%E IN ('dir %savefolder%\*.%videotype% /a-d-h /b^|findstr /rmic:"%strang%"') DO (ECHO file %savefolder%\\%%E>>concatallthese.txt
ECHO %savefolder%\%%E.%videotype% Added.
)
IF NOT EXIST concatallthese.txt GOTO :TRYITAGAIN
ECHO _________________________________________________________
ECHO[
ECHO These are the files matching: %strang%
ECHO[
ECHO 1 - Go back to the main menu
ECHO[
ECHO 2 - Continue
ECHO[
CHOICE /C:12
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 GOTO :MAINMENUBA2MP4
IF %K%==2 CALL :NAMECONCATALL %strang%
CALL :MAKECONCAT
GOTO :MAINMENUBA2MP4
:ALL
FOR /F %%E IN ('dir %savefolder%\*.%videotype% /a-d-h /b') DO (ECHO file %savefolder%\\%%E>>concatallthese.txt
ECHO %savefolder%\%%E Added.
)
CALL :NAMECONCATALL
CALL :MAKECONCAT
GOTO :MAINMENUBA2MP4
:MAKECONCAT
IF NOT EXIST concatallthese.txt GOTO :EOF
ECHO[
ECHO _________________________________________________________
ECHO[
FFMPEG %ffdebug% %ffshowb% -f concat -i concatallthese.txt -vcodec copy -y %savefolder%\%savename%.%videotype% || GOTO :FFVIEW
ECHO[
ECHO Saved as:%savefolder%\%savename%.%videotype%
PAUSE >NUL
IF EXIST concatallthese.txt DEL concatallthese.txt
GOTO :MAINMENUBA2MP4
:RENUM
SET "index=00000000"
SET /A Q=1%index%
FOR /F "delims=" %%a IN ('dir temp\%~1\*.%~2/a-d-h /b *.%~2^|findstr /rxvc:"......[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\.%~2"') DO (
SET /a Q+=1
SET "name=%%~na"
REN "temp\%~1\%%~a" "!Q:~-8!%%~xa"
)
GOTO :EOF
:UNZIP
IF NOT EXIST temp\ MKDIR temp\
cd temp
IF NOT EXIST buffer\ MKDIR buffer\
cd..
CALL :DRAWHEADBA2MP4
7ZA -y x %1 -o"%~dp0temp" >NUL 2>&1
IF NOT EXIST temp\desc.txt 7za -y x temp\system\media\*.zip -o"%~dp0temp" >NUL 2>&1
IF NOT EXIST temp\desc.txt (
CALL :DRAWHEADBA2MP4
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO There isn't a desc.txt file in that zip...
ECHO[
ECHO Error was with the following zip file.
ECHO[
ECHO %1
ECHO[
ECHO Press any key to continue to the main menu.
ECHO[
PAUSE >NUL
RMDIR temp /s /q
GOTO :MAINMENUBA2MP4)
IF NOT EXIST zips\ MKDIR zips\
MOVE %~1 zips\%~1 >NUL 2>&1
GOTO :EOF
:NAMECONCATALL
SET savename=%TIME::=_%
SET savename=%savename:.=%
SET savename=%savename: =%
SET savename=%~1%savename%CC
GOTO :EOF
:COUNTFILES
FOR /F %%A IN ('dir videos\*.%videotype% /a-d-s-h /b ^| FIND /v /c ""') DO SET /A filesinbav=%%A >NUL 2>&1
FOR /F %%A IN ('dir zips\*.zip /a-d-s-h /b ^| FIND /v /c ""') DO SET /A filesinbaz=%%A >NUL 2>&1
GOTO :EOF
:FFVIEW
ECHO[
ECHO[
ECHO _________________________________________________________
ECHO[
ECHO[
ECHO[
ECHO There was an error within FFmpeg. Run ba2mp4.bat -d
ECHO[
ECHO ^(with the parameter -d at the end^). The easiest way to
ECHO[
ECHO do this is right click in windows on ba2mp4 file and
ECHO[
ECHO in the menu select create shortcut. Right click on
ECHO[
ECHO the new shortcut, it will be "ba2mp4.bat - Shortcut"
ECHO[
ECHO select "Properties" and at the end of the target
ECHO[
ECHO (outside of the quote marks) put a -d
ECHO[
ECHO Now double click on the shortcut you made and see what
ECHO[
ECHO error messages come up while you try and repeat the
ECHO[
ECHO error in FFmpeg. If you PM me I will try and help you.
PAUSE >NUL
:FINISH
ADB kill-server -d >NUL 2>&1
IF EXIST temp\ RMDIR temp /s /q
ENDLOCAL
EXIT
This could also prove handy for phones like the Moto G that use an mp4 as the bootanimation
raithsphere said:
This could also prove handy for phones like the Moto G that use an mp4 as the bootanimation
Click to expand...
Click to collapse
That's pretty cool, I didn't know the Moto G & X use mp4's for their boot animation. I could easily make it export a zip file that would turn a regular boot animation zip into a mp4 one; videodesc.txt and all. But...They also play regular bootanimations too, don't they? It really wouldn't be that practical if the Moto G & X will play a regular one, other than you might get a LOT smaller file size with an mp4 style boot animation, as opposed to having a bunch of images.
ReaLly ammazEd....:beer:
via Tapatalk
makers_mark said:
That's pretty cool, I didn't know the Moto G & X use mp4's for their boot animation. I could easily make it export a zip file that would turn a regular boot animation zip into a mp4 one; videodesc.txt and all. But...They also play regular bootanimations too, don't they? It really wouldn't be that practical if the Moto G & X will play a regular one, other than you might get a LOT smaller file size with an mp4 style boot animation, as opposed to having a bunch of images.
Click to expand...
Click to collapse
I have not tried a regular boot animation yet
raithsphere said:
I have not tried a regular boot animation yet
Click to expand...
Click to collapse
You mind trying a mp4 one? If so here it is, and as always make a backup first, I'm not responsible for bricks.:good:
These mp4's are branded 'isom'. Most of the ones I checked, but not all, were branded 'mp42'. Not real sure if it will make a difference or not, I've seen someone post a bootanimation, mp4 style, that was branded the same as these mp4 files. I think it will work.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
that worked
D/BootAnimation(32587): Parsed Video[0] minPlays=1 repeat=0
D/BootAnimation(32587): Parsed Video[1] minPlays=1 repeat=0
D/BootAnimation(32587): Parsed Video[2] minPlays=0 repeat=1
Click to expand...
Click to collapse
raithsphere said:
that worked
Click to expand...
Click to collapse
Thanks! Mind trying one more?
This one has a little higher bit rate.
Xda upload isn't working at the moment..
bootanimation.zip

Reduce shell code (and/or debug)

Could you give me a little hand to reduce this code and make it more bearable because they (codes) will be a series of consecutive actions, and in a single command line in Tasker.
What I want to do in short?
1. Compress a file (or folder)
2. Add a name to the final file
3. Apply compression to the generated file
4. Delete ONLY contents of the folder that ended compress
5. Move the file was created before to the empty folder
Here is the code:
Code:
cd /xxx && tar -cf xxx_%DATE.xxx "$$$" && gzip -x xxx_%DATE.xxx && cd "###" && rm -r * .* && cd /xxx && mv -f xxx_%DATE.rar.gz "€€€"
And this is the description that I will offer users who use it:
Code:
[cd /'xxx'] = path to backup folder (parent dir) ; ['xxx'_%DATE] = file name (no name spaces) ; ['$$$'] = folder with files to back up ; [gzip -'x'] = compression level (1-9) ; [%DATE.'xxx'] = files container (.zip/.rar/.tar) ; ['###'] = same as -> '$$$' ; ['€€€'] = same as -> '###' & '$$$'
Mmmm, I'm sure you have several questions, so I will try to answer all possible question you could ask:
- What is the path that you think to work on?
-> If possible, in the external memory (SD Card)
- Why did you use in all commands the '&&' concatenation?
-> Just because I don't want to run the following command if the above fails for X reason. Just for security.
- What the variable '% DATE' does in your generated files?
-> All the code you see above is part of a larger task that will be used to create backups of various things, in short: BACKING UP. Well I include that variable because I want Tasker to add to the file name the date when the backup was created.
- Why do you offer the ability of choose the container file extension?
-> At first I thought it would not be possible and that failure or something would occur, but as I tested it, nothing happened. So I offer users the ability to generate the container they want. And as the final file (.gz) after compression, you can easily open it, so...
- Why do you use the quotes in some parts of the code that refer to a directory to compress, or to dump the created contents (move)?
-> Not really would take, well at least that I've experienced. But I decided to added it because, in my case, I have folders which their names have spaces, and without adding those quotation marks ("...") I can not find the directory that want to access, I guess it can happen to other people.
- When you begun using the command to create file container, like moving file, why do you position yourself in the directory first and then do the action, rather than perform all in the same code?
-> This is what I've tried so far, but do not know why I couldn't. Every combination I tested: FAILED, then I decided to separate positioning directory commands of leading compression actions, moving files, etc.
Well, I think the rest of you get the idea of that or how it works, but if not, ask to me.

Categories

Resources