I have a specific problem while sending my videos from Whatsapp on an iPhone (everything else works: android, web app on windows and mac). Below you can see my code, every time I send my video from the Whatsapp app on iPhone it appears to be without sound on iPhone devices, I will note that if I send the same video through drive for an example it's working fine.
I will add as well that regular mp4 videos do transfer with sound. Thanks :)
with codecs.open(self.fileName + '.txt', 'r', encoding='utf8') as stampFile:
for line in stampFile:
if self.stop:
return
self.counter += 1
time = line.split(";")
currStart = timeClass.calculateTimeToSec(time[0])
currEnd = timeClass.calculateTimeToSec(time[1])
currStart = max(currStart, 0)
currEnd = max(currEnd, 0)
if currEnd <= currStart:
return
clip = VideoFileClip(self.mediaFilePath)
if currStart >= clip.duration:
return
currStart = min(currStart, clip.duration - 1)
currEnd = min(currEnd, clip.duration)
clip = clip.subclip(currStart, min(currEnd, clip.duration))
path = self.dirName + "\\BBrief-Clips" + "/BBrief-" + str(self.counter) + "-" + self.mediaFileName
#threading.Thread(target=lambda: clip.write_videofile(path, codec='libx264')).start()
clip.write_videofile(path, codec='libx264')
if prevClip is None:
prevClip = clip
clip = fadeout(clip, 1)
else:
clip = clip.set_start(prevClip.end)
clip = fadein(clip, 1)
clip = fadeout(clip, 1)
prevClip = clip
clips.append(clip)
duration += currStart - currEnd
path = self.dirName + "\\Singel-BBrief" + "/BBrief-" + self.mediaFileName
CompositeVideoClip(clips).write_videofile(path, codec='libx264')
T.sleep(1)
self.counter += 1
for clip in clips:
clip.close()