signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.37k stars 6.09k forks source link

[sending video attachment] Audio/video plays at like 0.25x speed #12674

Open sseneca opened 1 year ago

sseneca commented 1 year ago

I'm just copying and pasting issue #11712 here because (a) it was never fixed (b) it is still happening (c) you guys use a stale bot.

I have searched open and closed issues for duplicates I am submitting a bug report for existing functionality that does not work as intended I have read https://github.com/signalapp/Signal-Android/wiki/Submitting-useful-bug-reports

This isn't a feature request or a discussion topic

Bug description

Audio becomes slowed down a lot when uploading video as an attachment. Steps to reproduce

Download YouTube video (mp4) via NewPipe
Use ffmpeg command (on Ubuntu if that's relevant) to cut a portion of it (ffmpeg -i sbw.mp4 -ss 00:00:05.00 -t 00:00:40.00 -c copy sbw2.mp4)
Send the video from computer to phone (it looks normal when played)
Upload video to signal as an attachment

Actual result: The audio sounds like a chopped and screwed remix (either in app or after downloading the video from app).

Expected result: The audio resembles the original Screenshots ((((NWFW warning kind of it's a music video and youtube-appropriate but on the obnoxious side)))

screen recording playing on Signal via Streamable Device info

Device: Galaxy S21

Android version: 11

Signal version: 5.25.4 App state

Signal messages and calls registered, SMS disabled, passphrase enabled Link to debug log

https://debuglogs.org/75368150252fd61eed64ff3cb4f9b1fc50da2c9d7141b1c8d77307189da57eda Other info

I have a (semi-NSFW as before) direct link to the source video if it helps. For some reason it starts at 0:04 seconds and doesn't have a 0:00? It plays perfectly fine on both my computer and phone in various apps, but when I click that link on a browser it lags for 4 seconds but then plays and sounds normal. On Signal it also has the 4 second lag, but if you download the video from signal it plays immediately (but audio still messed up)

I am not overly concerned about this just posting here in case it helps solve other video processing issues.

I've just got the same bug, so this is still relevant. Video (attached below) being sent from an Android device has audio slowed down to about 0.25x original speed. Issue doesn't exist on a desktop version of Signal

Someone left a comment:

Device: Samsung Galaxy A52s 5G Android version: 12 Signal version: 5.45.6 Link to debug log: https://debuglogs.org/android/5.45.6/d38dffa9768d3ff9d836bb73721f99ed487d68b31401e20e5f7c0f62507b6d6 Link to video being sent: https://user-images.githubusercontent.com/56295611/185209980-b56ae22d-ac52-450a-b076-e9b52934bf37.mp4


This also happens on my Google Pixel 4a, Android 13. It's not just the audio that's slowed down, it's the whole video

mathsen commented 1 year ago

Same problem on a S22 with Videos, that were downloaded from Intagram. Video is played very slow, sound sounds like in a "horror movie". Video is not usable in Signal.

skjnldsv commented 1 year ago

Same here, Samsung A33. But it was also doing it on my previous Xiaomi A2 and lots of friends also experience this bug.

UserX404 commented 1 year ago

Just had am similar issue after cropping a video within Signal and send it with an additional note (if that's important).

https://debuglogs.org/android/6.25.5/c1d4e23a139a9e84d246f8bc2bf265cb54c4e4150720361ac7b31b9780eee189

1689975378025

The original, uncropped video has no issues.

SamCyanide commented 9 months ago

I also have this issue with videos downloaded from Instagram, and occasionally other sources. More info in my reply here

It seems to maybe be an issue with HEVC? I posted an ffmpeg dump for the video file there.

Raychani1 commented 8 months ago

Same issue on Pixel 7 also, so far only for videos downloaded from Instagram using the built-in download functionality. Version 6.41.3.

amitiuttarwar commented 8 months ago

also experienced this on a pixel 5 with a video downloaded from instagram, running signal version 6.37.2.

QuietCoder1007 commented 7 months ago

Experienced this on S23 Ultra, Ubuntu, and Windows 11 from Instagram videos

srt54558 commented 7 months ago

Same problem on some videos on my Pixel 8 Pro

SamCyanide commented 7 months ago

Because this issue is getting more attention in the other one is marked as stale, I'll post what I had posted in #12945 here:

I am also having this issue. It only occurs with videos I downloaded from the Internet, primarily Instagram. However, it works fine with videos taken by my phone or downloaded from some other sources (I'm guessing it's limited to a single or small group of codecs)

Signal version is 6.40.4 for Android.

Here's some info on a video file that has this issue (playback is completely fine when viewed outside of signal, and also is fine before signal compression in the media preview before you send the message):

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/sdcard/Movies/Instagram/VID_52220421_183257_304.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf56.40.101
  Duration: 00:00:13.65, start: 0.000000, bitrate: 4868 kb/s
  Stream #0:0[0x1](und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 58 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Video: hevc (hvc1 / 0x31637668), yuv420p(tv, bt470bg/bt470bg/smpte170m), 1080x1920, 4808 kb/s, 30.15 fps, 30 tbr, 16k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:1 -> #0:0 (hevc (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (aac (native) -> aac (native))
cody-signal commented 7 months ago

Thanks folks, we are actively working on improving video send. Please feel free for new folks to post with details on the types of videos they have problems with. @SamCyanide thank you.

srt54558 commented 7 months ago

Thanks folks, we are actively working on improving video send. Please feel free for new folks to post with details on the types of videos they have problems with. @SamCyanide thank you.

I have the Google pixel 8 Pro and download Instagram videos quite often.

I think I found the issue... Every video with a bitrate higher than 3000kbps gets "compressed" (signal takes a lot of time to compress those videos, but videos with under 3000kbps don't compress). Basically the audio gets slowed down to like 0.25x but the video stays at the same speed. After the video ends, the audio still plays with a black screen

SamCyanide commented 7 months ago

All signs seem to point towards the compression step, I just tried sending a very small video that was 500kb, it performed just fine, because Signal doesn't need to do any compression. However if I trim 1 second off the end in signals built in pre-send editor, it has the slowed audio issue.

chronicography commented 7 months ago

Another user with the same issue. I have a work around, but requires another app. I use WhatsApp to send the video to myself and then share that video.. not a great work around, but until it's fixed I can at least share videos with people using Signal without the audio distortion this way.

greyson-signal commented 7 months ago

There's a potential fix in the 6.45 beta

CartWill commented 6 months ago

Still seems to be present in 6.46.6

clark-signal commented 6 months ago

Still seems to be present in 6.46.6

Did you send a new video attachment? If so could you send logs as well @nicholas-signal

CartWill commented 6 months ago

Yes. Log attached. Can send the video file as well. signal-log-1707406481131.zip

nicholas-signal commented 6 months ago

The fix for this issue is currently disabled due to issues found during the beta period. I am continuing to iterate on it and hope to have good news to share soon.

nicholas-signal commented 6 months ago

Hello all, please give this a try on 6.47.4, which is now widely available.

srt54558 commented 6 months ago

Hello all, please give this a try on 6.47.4, which is now widely available.

So far so good actually! I tried some videos and some were apparently "compressing" or "processing" the video, but the video is completely fine! No slowed down video!

CartWill commented 6 months ago

Last video that I tried to send also appears to not have audio issues now. Great work!

marianmelinte93 commented 6 months ago

Hello all, please give this a try on 6.47.4, which is now widely available.

I also confirm that processed videos are no longer having sound issues. I've tested this on a Pixel 7 with Android 14.

Thank you!

nonsenseninja commented 6 months ago

I'm still having issues on Signal version 6.47.5. I downloaded this youtube video with newpipe and then sent it to a group of friends on Signal. The audio is slowed and distorted and the video is padded so that it is longer than its actual length.

I'm using a Pixel 6a on Android 14 Feb security patch (UQ1A.240205.002).

nicholas-signal commented 5 months ago

I'm still having issues on Signal version 6.47.5. I downloaded this youtube video with newpipe and then sent it to a group of friends on Signal. The audio is slowed and distorted and the video is padded so that it is longer than its actual length.

I'm using a Pixel 6a on Android 14 Feb security patch (UQ1A.240205.002).

Are you able to provide a debuglog? I want to see if/why the transcoder decided not to remux the audio.

nonsenseninja commented 5 months ago

Are you able to provide a debuglog? I want to see if/why the transcoder decided not to remux the audio.

I just tried to send the video again to grab a debuglog for you and now it works! I noticed that I am now running Signal 7.0.2 though, so maybe https://github.com/clauz9/Signal-Android/commit/bd956e12637eb21e9c2d90cf63fc790951622a03 fixed it? As far as I can tell these changes were not in 6.47.5 where I encountered the transcoding problems the last time.