I have these example files in an Ubuntu 18.04 system:
VID_20190407_160033.3gp
VID_20190407_161444.3gp
VID_20190407_161609.3gp
VID_20190415_183315.3gp
VID_20190415_183411.3gp
VID_20190415_192712.3gp
VID_20190420_124435.3gp
VID_20190420_125755.3gp
VID_20190420_130214.3gp
VID_20190420_141700.3gp
And I want to concatenate 3GP files by a script (perhaps with ffmpeg ?) into one file, selecting files by the YYYYMMDD date in the file name, with a result of:
VID_20190407.3gp
VID_20190415.3gp
VID_20190420.3gp
What is the best way to script that?
System
Linux local 5.0.0-29-lowlatency #31-Ubuntu SMP PREEMPT Thu Sep 12 14:13:01 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Thank you.
3GP files can be concatenated with the use of ffmpeg by a command similar to:
once you create a for-next loop to filter on the YYYYMMDD using the first instance of the first value for that as a variable, collect the _XXXXXX file name components, and step through them sequentially; then, move on to the next YYYYMMDD value and step through all its files.
--
An alternate and more elegant method using a virtual concat demuxer which has brought to my attention by llogan would be to
A) count the number of files with the first YYYYMMDD prefix, then
B) create a control file mylist.txt with a line for each of the files matching that date prefix, which would look like:
or
then C) execute
Now, you've concatenated the first file set. Step on to the next YYYYMMDD group and repeat.