get_iplayer Download Olympics In Chunks Tutorial

MS jmstanfield at gmail.com
Thu Aug 9 13:35:54 EDT 2012


On 09/08/12 15:10, Jimmy Aitken wrote:
>>
>> The answer is yes, but the problem may be (will be?) getting it
>> perfectly in sync.
>
> I've managed to work out that 2 seconds is pretty much on the nose by
> fringing around with
> the data on a PC.  Here is the command I was using to get part 2 of the
> file:
>
> ~/src/get_iplayer.git/get_iplayer/get_iplayer --pid p00w2r5c --start
> 9700 -o /tmp/mp4 --force
>
> I then used:
> ffmpeg -i
> /tmp/mp4/Olympic_Ceremonies-London_2012_Online_Opening_Ceremony_-_no_comm.partial.mp4.flv
> -ss 1680 -t 400 -acodec copy -vcodec copy speech.mp4
>
> If you look at this, and skip to the Seb Coe speech is out by 2 seconds.
>
> I've tried various itsoffset on audio/video combos with no success at
> all.  If anyone has any ideas…..

Ok Jimmy - I can confirm that I can reproduce your problem as reported.

This command downloaded the chunk from your starting position of 9700 to 
the end (13856.68) and the .mp4.flv file plays with no audio sync problems.

./get_iplayer --pid p00w2r5c --start 9700 -o /output/ --force
Download renamed as: partial.mp4.flv

However when the ffmpeg command below is run, to output the speech, 
ffmpeg produces a .mp4 file with the audio out of sync.

ffmpeg -i partial.mp4.flv -ss 1680 -t 400 -acodec copy -vcodec copy 
speech.mp4

I then tried fixing it by using ffmpeg to create a copy of the whole 
chunk but skipping the first second, with this command.

ffmpeg -i partial.mp4.flv -ss "00:00:01" -acodec copy -vcodec copy 
OpCerPartial.mp4

OpCerPartial.mp4 then plays -as before- with no audio sync problems.

However using OpCerPartial.mp4 as the input for the ffmpeg speech cut, 
with the command below, also results in the audio out of sync.

ffmpeg -i OpCerPartial.mp4 -ss 1680 -t 400 -acodec copy -vcodec copy 
speech1.mp4

Adding the ffmpeg option '-async 1' to the command, as suggested by a 
web search, fails to fix this.

Does anyone know why this is happening or how to fix it?

I found a fix for short clips by loading OpCerPartial.mp4 into Avidemux 
and selecting a clip of 10 mins using the start and end positions ('A' 
and 'B' buttons) and being sure to select a keyframe as the start and 
end points by using the next and previous keyframe buttons. Then saving 
the clip in the same way as in the tutorial (with A and B set just the 
clip will be saved). For a clip of say 10 mins this works fine, audio is 
in sync. But when I tried saving a clip of a whole hour the audio is 
out-of-sync again.

Sorry but that's the end of my expertise. I suggest doing some web 
research or a ffmpeg support forum/mail list.




More information about the get_iplayer mailing list