[mythtvnz] Cutting H.264 DVB-T files with ffmpeg without transcoding

David Moore dmoo1790 at ihug.co.nz
Wed Jul 21 02:37:06 BST 2010


Thanks everyone for the feedback. I have discovered a few useful things:

- When using the itsoffset option in ffmpeg combined with cutting a 
section of a recording you need to add the offset to the total time you 
want to cut. For example, cutting 600s from 1000s into a recording and 
offsetting the timestamps 300s at the same time means you need something 
like this: "ffmpeg -ss 1000 -t 900 -itsoffset 300 -i file......." Note 
the "-t 900", not "-t 600".

- I solved one recording that ffmpeg could not cut by first running the 
whole recording through ffmpeg like this:

ffmpeg -async 1 -i infile.mpg -vcodec copy -acodec copy -map 0.0:0.2 
-map 0.2  outfile.mpg

and then cutting it like this:

ffmpeg -ss [start time] -t [duration] -i outfile.mpg -vcodec copy 
-acodec copy outfile2.mpg

This was a TV3 recording with an AC3 audio track so I did not need to do 
any transcoding.

- I have successfully joined two videos so far using the method 
described in an earlier post where I cat files together after adjusting 
the timestamps in the second file. The first step is to process the 
files with vlc like this:

cvlc infile.mpg --sout '#transcode{acodec=a52, ab=384, channels=2, 
samplerate=48000}:standard{mux=ps, dst=outfile.mpg, access=file}' vlc://quit

Funny thing is that the vlc web site says the ps mux handles mpeg 1/2 
but it seems to also handle h264 fine and seems to be faster than the ts 
mux.

Lots more to learn no doubt. :-) All feedback appreciated.



More information about the mythtvnz mailing list