I am trying to use the API to add a VTT file subtitles to an MP4 video. This works perfectly in the wizard editor, giving a subtitled mp4 file output. But when I run my python script, I can’t figure why it’s giving me an Internal 500 Error. The ssl_url in ‘uploads’ is also giving me the correct input mp4 file, so the path/file format should be fine.

from transloadit import client

tl = client.Transloadit('*****', '*****')
assembly = tl.new_assembly({'template_id': '******'})

assembly.add_file(open('/Users/User/Path/To/File/input.mp4', 'rb'))
assembly.add_file(open('/Users/User/Path/To/File/subtitles.vtt', 'rb'))
assembly_response = assembly.create(retries=5, wait=True)


I have also placed the stderr log below, as well as highlighted what I think might be the issue. Perhaps something to do with the video encoding??but I am not sure how to solve it. Would really appreciate the help, thanks!

Stderr Log

stderr Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘/srv/shared/tmp/scratch/c3d476174dea4d9cb18d826428a098e1_1dd25f17729b4d3ebbe8e7c057717694’: Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.45.100 Duration: 00:03:48.37, start: 0.000000, bitrate: 1772 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1682 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : ISO Media file produced by Google Inc. Created on: 04/26/2023. Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 84 kb/s (default) Metadata: handler_name : ISO Media file produced by Google Inc. Created on: 04/26/2023. Codec AVOption rc_eq (Set rate control equation. When computing the expression, besides the standard functions defined in the section ‘Expression Evaluation’, the following functions are available: bits2qp(bits), qp2bits(qp). Also the following constants are available: iTex pTex tex mv fCode iCount mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex avgTex.) specified for output file #0 (/srv/shared/tmp/scratch/c3d476174dea4d9cb18d826428a098e1_cc8c125c4a8d4218bbb7ba333d0f3961) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream. Stream mapping: Stream #0:0#0:0 (h264 (native) → h264 (libx264)) Stream #0:1#0:1 (aac (native) → aac (libfdk_aac)) Press [q] to stop, [?] for help -async is forwarded to lavfi similarly to -af aresample=async=2:min_hard_comp=0.100000:first_pts=0. [Parsed_subtitles_0 @ 0x23fd3c0] Shaper: FriBidi 1.0.7 (SIMPLE) HarfBuzz-ng 2.7.1 (COMPLEX) [Parsed_subtitles_0 @ 0x23fd3c0] Unable to locate subtitle stream in /srv/shared/tmp/scratch/352e15955c5f4e4d94821e35728cbda3.mp4 [AVFilterGraph @ 0x23fce80] Error initializing filter ‘subtitles’ with args ‘/srv/shared/tmp/scratch/352e15955c5f4e4d94821e35728cbda3.mp4:force_style=Fontname=Arial,PrimaryColour=&Hffffff,BorderStyle=1,OutlineColour=&H0’ Error reinitializing filters! Failed to inject frame into filter network: Stream not found Error while processing the decoded data for stream #0:0 [libfdk_aac @ 0x146a040] 2 frames left in the queue on closing Conversion failed!