TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.6k stars 3.07k forks source link

Cut off m4a downloads #2640

Closed dmoa closed 3 years ago

dmoa commented 5 years ago

Around the time I switched to F-Droid "version" of NewPipe (Could be coincidence), my audio downloads seem to be cutoff at the beginning.

When playing in google play music some of my favourite songs are cutoff at the beginning. I also am using NewPipe on the OnePlus 7 Pro (if that helps)

I don't have much information other than this, but I'll be happy to reply to messages.

Any help would be appreciated.

kapodamy commented 5 years ago

¿with any video, also in m4a format?

CharAznableLoNZ commented 5 years ago

I've found this happens with some videos at random. It will download about 20-30% then just stop. Pause and resume doesn't fix it. Delete video and file then try again it stops at the same point. I tried downloading the 720 version of this. In the largest version on F-Droid. https://www.youtube.com/watch?v=u3c1362zoGg

kapodamy commented 5 years ago

confirmed logcat output:

A/libc: heap corruption detected by dlmalloc
    Fatal signal 6 (SIGABRT) at 0x000051ef (code=-6), thread 21912 ( Old Dudes!.mp4)
Process 20975 terminated.
kapodamy commented 5 years ago

@CharAznableLoNZ wait, your issue doent looks similar that OP but is fixed here #2646

CharAznableLoNZ commented 5 years ago

I wasn't sure as I didn't want to open a new issue for it if it was the same.

dmoa commented 5 years ago

Ok I got it working, super weird. It doesn't work in Google Play Music, but on other playback clients it does. i.e. no cutoff in other playback clients.

kapodamy commented 5 years ago

ok, i will take a look

opusforlife2 commented 4 years ago

@kapodamy This hasn't been fixed by #2679 from my testing.

Players which don't rely on Android, like VLC and mpv-android, can play these m4a audios just fine. But players which do rely on Android, such as Vanilla and Odyssey, have the first second or two of the audio cut off.

So the file may not be well formed.

kapodamy commented 4 years ago

@opusforlife2 ¿youtube url? for testing

opusforlife2 commented 4 years ago

@kapodamy https://www.youtube.com/watch?v=9IVhjh15ofo This is a good audio to test as the difference between cut off and full audio is very noticeable.

kapodamy commented 4 years ago

@opusforlife2 test this IDOL-9IVhjh15ofo.zip

opusforlife2 commented 4 years ago

@kapodamy Not fixed. It's the same 1 second cut off. Vanilla just jumps from 0 to 2 seconds on the seekbar and Odyssey rapidly goes from 0 to 1 to 2 within a second. The cut off is there with FX File Explorer as well.

opusforlife2 commented 4 years ago

@kapodamy I just checked another phone (Nokia 6.1 running Android 10, Newpipe 0.18.2) and the m4a isn't cut off! It's possible that the bug I'm experiencing exists in LineageOS 16, instead. I don't know if @dmoa is on LOS as well. I don't have access to any Samsung phone. It would be good to confirm if this issue occurs there or not.

kapodamy commented 4 years ago

tl;dr wont fix

looking the ffmpeg log the file contains a bad timestamp, so ffmpeg add a few empty samples at the start to avoid the "silence". ffmpeg.exe -i IDOL-9IVhjh15ofo-dash.m4a -c copy IDOL-9IVhjh15ofo-nodash.m4a ffmpeg output i dont know how to detect this behavior, is unfixable without processing the audio

opusforlife2 commented 4 years ago

@kapodamy Is there a way to counter this offset? I don't think it would matter if this results in some audios regaining the 'proper' time and some audios gaining an extra second of silence.

kapodamy commented 4 years ago

@opusforlife2 try these one IDOL-9IVhjh15ofo-nodash.zip

opusforlife2 commented 4 years ago

@kapodamy No luck, sadly. Same as before.

Do you think the Nokia I tested compensates for this error somehow? It has to be an OS level difference, because Vanilla uses Android's audio engine, not a custom one.

kapodamy commented 4 years ago

@opusforlife2 no sure but yes

ShareASmile commented 3 years ago

@opusforlife2 is this still a issue ?

opusforlife2 commented 3 years ago

Well, I just tried that same song, and the m4a isn't cut off. This might have been an issue in LOS 16 only. Closing unless someone reports otherwise.

mgolden356 commented 3 years ago

@opusforlife2 I have this issue on Android 9, Android 10. The m4a downloads seems to get cut off only when it comes from an auto-generated "Topic" music download. I wonder if that helps.

For instance, take any popular song, and there will usually be a non-topic version like so https://www.youtube.com/watch?v=_fh64GbFSw4 and another topic version like so https://www.youtube.com/watch?v=hHtv2XMZlKs

Downloading the non-topic version and the topic version, if not played in VLC, you can clearly hear and see the cutoff on the topic version. (You can't hear the full phrase "Enviyon on a mix", just "--mix" or so.)

opusforlife2 commented 3 years ago

@mgolden356 Which OS? LOS or some OEM?

mgolden356 commented 3 years ago

@opusforlife2 Android, as I said. Right now it's specifically Android version: 9 Current version: PPS29.118-15-11-16 Security patch level: April 1, 2020 On the moto g6, but I've had this on other Android phones, like moto g7 power Android 10.

opusforlife2 commented 3 years ago

@mgolden356 Ah, so it is an OEM ROM, then: Motorola's.

I've tested your links, and they both play from the beginning for me. So this reinforces the idea that this was an issue for certain ROMs/OEMs only. Sure, the m4a from Youtube might be malformed, but if all other OSs are handling this elegantly, then it's on Motorola to fix this.

Maybe try seeing if you can find any relevant issue in a Motorola forum for a solution? Either way, this is too esoteric and device/ROM-specific, and a developer has already spent enough energy trying and failing to fix it, so you're stuck with this until you upgrade your Android version or switch to another ROM/OEM, unfortunately. Of course, miracles could happen and Motorola could fix this bug.

mgolden356 commented 3 years ago

@opusforlife2 and just to be clear, on my end they both play from the beginning on newpipe, but the topic one doesn't only when downloaded as an m4a. But when you download both of them, they both play from the beginning?

opusforlife2 commented 3 years ago

Indeed. The malformed m4a and the correct one, both play from the beginning.

The entire issue is only with m4a. No issue with Newpipe playback, and no issue with opus either.