Am 29.06.2014 15:25, schrieb Markus Hitter:
> My guess is, movie2 reports as 25 fps, while it's actually 23.98fps:
> 6546s * 25 / 23.98 = 6827s (very close)
> 
> My question:
> 
> - How would I tell avconv to consider movie2 being of 23.97fps and
> stretching it accordingly, which shouldn't require re-coding ( = no
> quality loss)?
> 
> - If this isn't possible, how would I stretch it with recoding?

To answer this myself and for the records:

Neither async nor setpts nor asyncts works, asetpts doesn't even exist.
Slowing the video with setpts was no problem, but no way to do the same
for audio.

So I resorted to SoX. There you can set the frame rate independent of
what the file means it is (-r or rate) ... which doesn't help either,
because avconv's ac3 encoder doesn't accept odd framerates.

This is what I finally did:

avconv -i movie2 -vn -codec:a pcm_s24le -y movie2.wav

sox -S movie2.wav movie2-slow.wav speed $(echo 'scale=20; (24000 / 1001)
/ 25' | bc)

avconv -i movie1.mkv -i movie2-slow.wav -codec:v copy -codec:a:0 copy
-codec:a:1 ac3 -metadata title="MyTitle" -metadata:s:a:0 language=eng
-metadata:s:a:1 language=ger -map 0 -map 1:0 -y movie-out.mkv

For fine adjustment, you can add padding and such to the SoX command:

sox -S movie2.wav movie2-slow.wav speed $(echo 'scale=20; (24000 / 1001)
/ 25 - 0.7 / (5359 * 23.98)' | bc) pad $(echo 'scale=20; 15.5/23.98' | bc)

... where 0.7 is stretching of another 0.7 frames over a period of 5359
seconds and 15.5 is an initial delay of 15.5 frames. These numbers have
to be found by experimenting and viewing the result in a video editor
which also shows audio waveforms, like Cinelerra or Kdenlive. There one
can examine audible events like shots or scene changes; for best
accuracy one event early in the movie and a second one near the end.

Violá, this second audio is now more precise than the original.


Cheers and thanks for helping, :-)
Markus

-- 
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. (FH) Markus Hitter
http://www.jump-ing.de/
_______________________________________________
libav-tools mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-tools

Reply via email to