[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | | Home]

Not sure if this is the right place to ask, but I try anyway.

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 1

File: photo.png (3KB, 60x60px) Image search: [iqdb] [SauceNao] [Google]
photo.png
3KB, 60x60px
Not sure if this is the right place to ask, but I try anyway.

I have a bunch of SFM renders which loop perfectly fine, but only without audio. When audio is added, a small delay occurs when the video restarts.

I use ffmpeg to convert them to mp4 (libx265/aac), and it looks like no matter what I try, the audio is always 20-100ms longer (even with -shortest flag).

Is there any way to force ffmpeg to make the audio and video stream to have the exactly same size, down to the ms?

The files need to be re-encoded so I want the results to be as good as possible. mp4 is not set in stone if another container is better.
>>
I'm no sfm expert but why don't you overlay the audio in another package? Bit of a shit work around but it would also actually work
>>
>>553429
The problem does not come directly from SFM, but from the conversion it seems.
From what I understand, it's somewhat related to framesizes.
With eg 30fps, each frame has a duration of 33.3ms. For aac it seems a frame is ~26ms.
The Opus specs say that frames of that codec can be as short as 2.5ms (frame_duration), but I cannot get ffmpeg to create output with a difference of ~2.5ms between video and audio.
>>
If you cut the audio track short of the end of the video track does it still encode blank audio to the end of the animation and cause this problem?
Can you just use a different codec or encoding software?
>>
>>553533
If I remove the audio, it loops fine.
I have to batch convert >200 files, so manually editing the audio isn't really an option.

Also, I tried h263, h264, libx265 with similar results.

It looks like there is no way to make it loop smoothly
>>
>>553542
Are you using MP3 audio? Try Vorbis or AAC, it might be an issue with MP3's initial delay.
>>
>>553372
>I use ffmpeg to convert them to mp4 (libx265/aac)
>>553528
tried opus
>>
>>553528
I know that after effects can interpret footage at a variable rate so you could try and match them together but unfortunately I cannot offer any more wisdom
>>
in the past, there were a few occasions in which i had to add audio after the video was created. to make sure the audio lasted for exactly as long as the video, i did the following:

use ffprobe on the video to find the video's duration (right down the the centisecond)
create a blank track in audacity with same duration as video
generate my audio
use the command: ffmpeg -i my-video-file -i my-audio-file -vcodec copy -map 0:0 -map 1:0 my-output-file

the only hiccup was that the resulting video changed from 24 fps to 20.98 fps
however the video retained it's original duration with no video/audio speedup/slowdown at any point. i think that may have something to do with the audio's sample rate, but i'm not too sure.
>>
download audacity and change the format to 16 bit bro ;)
Thread posts: 10
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]
Please support this website by donating Bitcoins to 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
If a post contains copyrighted or illegal content, please click on that post's [Report] button and fill out a post removal request
All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site. This means that 4Archive shows an archive of their content. If you need information for a Poster - contact them.