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

Morgan Read mstuff at read.org.nz
Tue Jul 20 10:34:37 BST 2010


On 18/07/10 15:19, David Moore wrote:
> Jonathan Hoskin wrote:
>>     Anybody worked out a reliable way to cut recordings from Freeview
>>     terrestrial using ffmpeg?
>>
>>  
>> Nope. I wonder if the developers have properly addressed it / been made 
>> aware of it.
>>
>>
> 
> I've seen a lot of posts from (I think) ffmpeg devs on various lists 
> which seem to say "too bad, it's the recording that's bad, not a bug in 
> ffmpeg".
> 
>>     ffmpeg -async 1 -ss [start time] -t [duration] -i recording.mpg -vcodec
>>
>>     copy -acodec ac3 -ab 384k -f dvd cut_recording.mpg
>>
>>     The "-async 1" seems to be needed to keep audio in sync with video. The
>>     "-f dvd" might (not sure yet) be a fix for av mux errors. Audio is
>>     transcoded to AC3 since most channels only have LATM AAC audio.
>>
>>
>> "-f dvd" uses a MPEG2-PS container - H.264 isn't supported in the 
>> MPEG-PS file format:
>> http://www.gossamer-threads.com/lists/mythtv/mythtvnz/417130#417130
>>  
>>
> 
> Thanks for that. I have tried MPEG-TS format as well but also with no 
> joy. Latest semi-successful attempts have involved extracting the video 
> to raw H264 format and transcoding the audio to raw AC3 then remuxing to 
> mpg (without the -f dvd option). Unfortunately I get audio/video sync 
> problems now. I don't see how I can easily resolve this because (I 
> assume) the raw formats have no timestamps or have timestamps which are 
> slightly out of sync.
> 
> Seems that timestamps may be the root of the problem because I was 
> previously getting the ffmpeg "non-monotone timestamp" error and weird 
> start times reported by ffmpeg. I have no idea how to fix this without a 
> lot of manual audio/video syncing

Look for the "P"s and "B"s from peoples lips, they're percussive sounds
and you can sync the "P"s and "B"s from the audio to them - the attack
of the audio should match the 1st frame the lips part.  Unless the rate
of picture and audio vary against each other, you should only have to do
this once per recording:)
Have fun.
M.


-- 
Morgan Read
NEW ZEALAND
<mailto:mstuffATreadDOTorgDOTnz>

fedora + freedom; fact || fiction?
http://fedoraproject.org/wiki/Overview
get freed-ora!
http://www.fsfla.org/svnwiki/selibre/linux-libre/freed-ora



More information about the mythtvnz mailing list