You are not logged in.
As my thread title says, I would like to create an output file that can then be passed to ffmpeg ready for concating multiple video files into a single mp4 file.
Below is what I have so far:
for f in *; do mv "$f" "$f.mp4"; done
for f in *.mp4; do mv -n "$f" "$(date -r "$f" +"%H%M%S%N").mp4"; done
rm -f *_0.mp4
rm -f *_s.mp4
ls >> /home/dave/Desktop/filelist.txt
ffmpeg -f concat -safe 0 -i /home/dave/Desktop/filelist.txt -c copy output.mp4
rm -f /home/dave/Desktop/filelist.txt
The filelist.txt contains the following:
160638814511727.mp4
160639084511370.mp4
160639697843886.mp4
...
Unfortuatly I get ffmpeg error message:
[concat @ 0x55ba3dc1ce40] Line 1: unknown keyword '160638814511727.mp4'
/home/dave/Desktop/filelist.txt: Invalid data found when processing input
I do not know how to fix this, please help.
Thanks.
Offline
The filelist needs to be a list with the literal word "file " at the start of each line, e.g.:
file 160638814511727.mp4
file 160639084511370.mp4
file 160639697843886.mp4
But why are you doing all that moving / renaming over and over again? All of that becomes effectively useless.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
@Trilby
Okay, so I followed your instructions using the sed command that added "file " at the beginning of each line in the filelist.txt file.
Regrettably, I got the following error message:
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x556ce368b2c0] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x556ce368b2c0] moov atom not found
[concat @ 0x556ce3670e40] Impossible to open '160638814511727.mp4'
filelist.txt: Invalid data found when processing input
Offline
And what *is* that file - or perhaps more importantly, what was it before you arbitrarily renamed it to an mp4 extension?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
@Trilby
Those files were fragments from a sports stream, located in my .cache web browser folder. They were (seemingly) randomised filenames with each ending in "_0" and without any extension.
Offline
How do you know which were videos? A browser cache can hold anything? What does `file` report for the problematic file? Can you play the problematic file on it's own with ffplay?
Last edited by Trilby (2023-09-04 02:19:19)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Edi: posted wrong link
https://bbs.archlinux.org/viewtopic.php … 1#p2118221
This isn't going to work anyway
Last edited by seth (2023-09-04 11:54:43)
Offline
You can do:
printf "file '%s'\n" *.mp4 > mylist.txt
ffmpeg -f concat -i mylist.txt -c copy output.mp4
More here: https://trac.ffmpeg.org/wiki/Concatenate
Offline
While that's technically correct…
Okay, so I followed your instructions using the sed command that added "file " at the beginning of each line in the filelist.txt file.
Regrettably, I got the following error message:
… we're past that point. The OPs problem is that he's trying to treat random data as video chunks and even if he'd isolate the actual video chunks, they'd still be drm-encrypted.
Offline