0

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()

1 Answer 1

0

I managed to solve this solution by changing the output file to be MOV.

path = self.dirName + "mediaFileName"[:-4]+".MOV"
    CompositeVideoClip(clips).write_videofile(path, codec='libx264')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.