[FFmpeg-user] split video

John de la Garza john at jjdev.com
Wed Jan 23 21:04:47 CET 2013

On Wed, Jan 23, 2013 at 08:32:48AM +0000, Carl Eugen Hoyos wrote:
> johnd <john <at> jjdev.com> writes:
> > Maybe you can clarify something for me.  I did a lot of testing using
> > ts as an intermidiate container as I chopped things then concated back
> > all the ts files to a .mp4.
> Why?
> There are a concat demuxer and a concat filter, both 
> should work fine with mp4.

first, let me say thanks for your response

I am new to this.  My first post was something like "this is what I want
to do", and the response was, try something pasting in the command
and results... So after reading the docs, I started doing some
trial and error.  I am totally new to video (3 weeks or so).

I would prefer to explain my problem at a high level, and have
you advise what I should go learn about to do it.  I don't mind
reading docs and source code.

I need to take an existing video (I will have many with different
codecs and containers)

I need to go through and mute audio from certain parts (I'm given a
list of tuples of time and duration), then I need to go and insert
black silence for a break (another list of tuples [(time, duration)]
(this means the final output video will be longer than the original,
due to the added black/silent inserts).

I've got a working solution to the blank spots.  I am having trouble
getting the audio removed...

This is my current approach:

ffmpeg -y -ss 0 -i test_video.mp4 -t 5 -s 320x180 -vcodec \
libx264 -acodec libfdk_aac 0.ts
ffmpeg -y -ss 5 -i test_video.mp4 -t 5 -s 320x180 -vcodec \
libx264 -acodec libfdk_aac tmp.1.ts
ffmpeg  -y  -f lavfi -i \
aevalsrc=0,aconvert=fltp:stereo:packed -i tmp.1.ts -shortest  -vcodec \
copy  -map 0:0 -map 1:0 -acodec libfdk_aac 1.ts
ffmpeg -y -ss 10 -i test_video.mp4 -s 320x180 -vcodec libx264 \
-t 30 -acodec libfdk_aac 2.ts
ffmpeg -y -i concat:"0.ts|1.ts|2.ts" -vcodec libx264  -acodec \
libfdk_aac  output.mp4

when I do the concat I get this:
[aac @ 0x29c1e20] channel element 1.0 is not allocated
Error while decoding stream #0:1: Operation not permitted
[aac @ 0x29c1e20] More than one AAC RDB per ADTS frame is not
implemented. Update your FFmpeg version to the newest one from Git. If
the problem still occurs, it means that your file has a feature which
has not been implemented.
Multiple frames in a packet from stream 1
I am wide open to doing this a different way, I will go read more about
the concat demuxer and concat filter

More information about the ffmpeg-user mailing list