Is there a way to command line combine multiple video files into one while keeping the file actually playable and adding black bars to vertical clips?

This functionality kind of works when using MP4Joiner, but it is fairly slow to add files and it crashes very often when trying to combine 100+ files or some files that are broken for whatever playback reason.
The output is also often choppy and video files become garbled at points and playback is not possible. (MPC HC but eventually planning to upload to youtube unlisted)
However the addition of black bars is excellent and from my task manager i can see many files are being re-encoded with ffmpeg while the process is going on.


When using MP4Box, the videos combine, but playback is not possible a lot of the time and vertical clips are streched to fit the first horizontal size.
My command is this - i've tried some variations and removal of bs-switching as well.

`$command = '"C:\Program Files (x86)\MP4Tools\bin\MP4Box" -bs-switching merge -force-cat' ; (Get-ChildItem *.mp4 | sort { [regex]::Replace($_.Name, '\d+', { $args[0].Value.PadLeft(20) }) } )  | foreach { $command += " -cat $_" } ; $command += " combined.mp4" ;$command ; cmd /c $command`
(i have also tried the newest GPAC mp4box.exe files)

With this i get a full list of mp4's and they are all -cat'ed into the command.

Here are some sample files and the mp4 that is created when i combine with the mp4box command.
https://www.dropbox.com/scl/fo/auvvmk03oeoq2k7w175qv/h?rlkey=387jb5ccu9b6vvdv3k55qd1c9&dl=0

In these test files the mp4joiner file is also quite broken after combining. But the mp4box combined file handles vertical even worse.

How could i re-encode these to make the files actually play? I cant find a way right now, but it would be awesome to be able to combine my live photo clips to a movie.
combining multiple small video files (iphone live photo clips) into one file - horizontal and vertical files
This is a GitHub Issue
repo:gpac
owner:gpac
Title : combining multiple small video files (iphone live photo clips) into one file - horizontal and vertical files
Issue date:

--- start body ---
Is there a way to command line combine multiple video files into one while keeping the file actually playable and adding black bars to vertical clips?

This functionality kind of works when using MP4Joiner, but it is fairly slow to add files and it crashes very often when trying to combine 100+ files or some files that are broken for whatever playback reason.
The output is also often choppy and video files become garbled at points and playback is not possible. (MPC HC but eventually planning to upload to youtube unlisted)
However the addition of black bars is excellent and from my task manager i can see many files are being re-encoded with ffmpeg while the process is going on.


When using MP4Box, the videos combine, but playback is not possible a lot of the time and vertical clips are streched to fit the first horizontal size.
My command is this - i've tried some variations and removal of bs-switching as well.

`$command = '"C:\Program Files (x86)\MP4Tools\bin\MP4Box" -bs-switching merge -force-cat' ; (Get-ChildItem *.mp4 | sort { [regex]::Replace($_.Name, '\d+', { $args[0].Value.PadLeft(20) }) } )  | foreach { $command += " -cat $_" } ; $command += " combined.mp4" ;$command ; cmd /c $command`
(i have also tried the newest GPAC mp4box.exe files)

With this i get a full list of mp4's and they are all -cat'ed into the command.

Here are some sample files and the mp4 that is created when i combine with the mp4box command.
https://www.dropbox.com/scl/fo/auvvmk03oeoq2k7w175qv/h?rlkey=387jb5ccu9b6vvdv3k55qd1c9&dl=0

In these test files the mp4joiner file is also quite broken after combining. But the mp4box combined file handles vertical even worse.

How could i re-encode these to make the files actually play? I cant find a way right now, but it would be awesome to be able to combine my live photo clips to a movie.
--- end body ---
