Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Lista Forumurilor Pe Tematici
|
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login
POZE MRRRR'S FORUM (VIEW ONLY)
Nu sunteti logat.
|
Nou pe simpatie: Anne98
| Femeie 25 ani Buzau cauta Barbat 25 - 50 ani |
|
Mrrrr
AdMiN
Inregistrat: acum 17 ani
Postari: 2228
|
|
Similarly to my post here:
You can use ffmpeg to extract just the audio and video streams from an .mp4 or .mkv file and create new video containers with just the 2, stripping any subtitles, global tags, or additional audio streams and thus reducing video container size.
Similarly to the aforementioned post, for a folder with multiple video files you can create a batch (.bat) script. Your video container might have multiple audio tracks so you must select the right one to extract. So first you would have to run the ffmpeg -i input_file.mp4 command and check which is the ID of the audio file. For example, I identified that the first audio track in a file is a dub, then the 2nd audio track in the file is the original - the one I want. Therefore in the code below, I would address the 2nd audio track, and since track ID starts from zero, a:0 would be the first audio track which is the dub, and a:1 is the 2nd audio track which is the original.
@echo off for %%a in (*.mp4) do ( ffmpeg -i "%%a" -map 0:v -map 0:a:1 -c copy "%%~na_1.mp4" ) pause |
• -map 0:a:1 will extract the 2nd audio track within an mp4 file
This process will take a little longer than just extracting the subtitles, since you practically make copy of the mp4 files within the same folder.
Additionally, assuming the audio track has a high bitrate which you do not require, and would like to also perform a conversion from, say 640 kbps E-AC-3 with a stream size of 15% of the total mp4 file, to a 256 kbps aac with a stream size of 6% of the total mp4 file, the above batch script would change -c copy to:
@echo off for %%a in (*.mp4) do ( ffmpeg -i "%%a" -map 0:v -map 0:a:1 -c:v copy -c:a aac -b:a 256k "%%~na_1.mp4" ) pause |
This process will take a even longer than just copying the audio track, since you have to convert it first.
The speed of audio conversion depends on several factors: - CPU performance - storage drive (HDD vs SSD) - use SSD for larger files - I/O Operations - writing to a different drive can improve performance; simply change "%%~na_1.mp4" to "PATH_TO_DESIRED_FOLDER\%%~na_1.mp4" - file size and compression - FFMPEG optimizations
Using either of the 2 improved methods mentioned above helped reduce the conversion time as follows for an initial 1.5 GB mp4 file (prior to conversion of audio track): - conversion in the same folder on the source HDD = ~ 5 minutes - conversion to a folder on a different HDD = ~ 4 minutes - conversion to a folder on a different SSD = ~ 3 minutes
_______________________________________
|
|
pus acum 2 saptamani |
|