kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
2k stars 439 forks source link

Remote mapped with single audio track #959

Open ariccadonna opened 5 years ago

ariccadonna commented 5 years ago

Hello, we have an issue during a VOD playlist generation.

We currently use mapped remote mode to concatenate the only the video track of some mp4 with discontinuity tag because of differente encoding. On the top that we have to add a single audio track from a different mp4 (like a background music) that plays without interruption.

What we currently do is to concatenate the video track and the audio track inside a mix filter with a gain filter like this: { "segmentDuration": 10000, "discontinuity": true, "durations": [5000, 6000], "sequences": [{ "clips": [{ "type": "mixFilter", "sources": [{ "type": "source", "path": "/mnt/path/to/video/track1.mp4", "tracks": "v1" }, { "type": "gainFilter", "gain": 1, "source": { "type": "source", "path": "/mnt/path/to/audio/track1.mp4", "tracks": "a1", "clipFrom": 0 } }] }, { "type": "mixFilter", "sources": [{ "type": "source", "path": "/mnt/path/to/video/track2.mp4", "tracks": "v1" }, { "type": "gainFilter", "gain": 1, "source": { "type": "source", "path": "/mnt/path/to/audio/track1.mp4", "tracks": "a1", "clipFrom": 5000 } }] }] }] }

The problem is that, because of the discontinuity tag i guess, this add a very distinguished audio gap between the two clips. Can we avoid this problem?

erankor commented 5 years ago

Don't think I have solution for this, but it's worth testing it with audio only, and with/without discontinuity. One possible cause can be that there is no audio frame at exactly 5 sec, so the module has to stretch/shrink the last frame of the first clip.