E
E
esc2012-05-25 18:22:32
Video processing
esc, 2012-05-25 18:22:32

Split video file into tracks

I have a video file, I need to cut it into tracks so that each track is saved as a separate file. You need to do this with console programs under linux and so that the file is read once, and not once for each track (the file was mounted via httpfs).

ffmpeg -i file.avi -vn -acodec copy -map 0:1 -f mp4 a1.mp4 will save only one track. I need an analogue of this command that would work for all (or several) at once. Not necessarily, via ffmpeg.

I can not find a suitable option or software for this. Perhaps someone on Habré knows

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rPman, 2012-05-25
@rPman

Use pipes and tees to duplicate the flow:

mkfifo pipe1
mkfifo pipe2
tee pipe1 < file.avi > pipe2 | ( (ffmpeg -i pipe1...&);(ffmpeg -i pipe2...&) )

I
impass, 2012-05-26
@impass

With a probability of 99%, you will not find ready-made solutions so that all available tracks are saved to different files right in one pass.
It is probably most reasonable to take the source code of transcode (in particular , the tcextract utility ) or mplayer ( the -dumpaudio and -dumpvideo options have already been implemented) and modify it to fit your needs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question