Zend certified PHP/Magento developer

Renaming output file with the name of the first input file

I have a mylist.txt list of files containing videos whose filenames are consistently structured as:
2021_03_18_19_30_02.avi
2021_03_18_19_41_02.avi

I’m using ffmpeg to concatenate all files into a single file like so:

ffmpeg  -f concat -safe 0 -i mylist.txt -c copy output.avi

However, I’d like output.avi to be renamed with the earliest filename in the supplied list (in this case, 2021_03_18_19_30_02.avi). I don’t need to preserve the original files once they are stitched together.

How would I do that in a win command line or, alternatively, Linux bash?