You are not logged in.

#1 2023-09-03 22:20:07

Scooby Doo
Member
Registered: 2022-05-04
Posts: 12

How do I.. Create an output filelist.txt ready for ffmpeg concating??

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

#2 2023-09-03 22:37:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: How do I.. Create an output filelist.txt ready for ffmpeg concating??

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

#3 2023-09-03 23:18:44

Scooby Doo
Member
Registered: 2022-05-04
Posts: 12

Re: How do I.. Create an output filelist.txt ready for ffmpeg concating??

@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

#4 2023-09-04 00:35:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: How do I.. Create an output filelist.txt ready for ffmpeg concating??

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

#5 2023-09-04 01:53:05

Scooby Doo
Member
Registered: 2022-05-04
Posts: 12

Re: How do I.. Create an output filelist.txt ready for ffmpeg concating??

@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

#6 2023-09-04 02:18:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: How do I.. Create an output filelist.txt ready for ffmpeg concating??

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

#7 2023-09-04 04:25:36

seth
Member
Registered: 2012-09-03
Posts: 60,683

Re: How do I.. Create an output filelist.txt ready for ffmpeg concating??

Edi: posted wrong link
https://bbs.archlinux.org/viewtopic.php … 1#p2118221

This isn't going to work anyway roll

Last edited by seth (2023-09-04 11:54:43)

Offline

#8 2023-09-04 11:33:45

xerxes_
Member
Registered: 2018-04-29
Posts: 824

Re: How do I.. Create an output filelist.txt ready for ffmpeg concating??

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

#9 2023-09-04 12:01:24

seth
Member
Registered: 2012-09-03
Posts: 60,683

Re: How do I.. Create an output filelist.txt ready for ffmpeg concating??

While that's technically correct…

Scooby Doo wrote:

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

Board footer

Powered by FluxBB