Solved AVI audio is out of sync since 18.0
#31
Update:

I am new to Kodi, but since I have a big collection of xvids , i hope i can help as I managed to compare some of the files which play unsynced audio.

NOT ALL xvids have the same problem, but with media info I managed to pinpoint the problem for the videos with unsynced audio, and it seems all of then  are encoded with the Simple@L5 xvideo profile  as its called in the encoding configuration dialog of the Xvid codec.

For example Video1 Is healthy and the audio is synced .


Video1
ID                                       : 0
Format                                   : MPEG-4 Visual
Format profile                           : Simple@L3
Format settings, BVOP                    : No
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Default (H.263)
Codec ID                                 : XVID
Codec ID/Hint                            : XviD
Duration                                 : 1 h 37 min
Bit rate                                 : 1 793 kb/s
Width                                    : 576 pixels
Height                                   : 416 pixels
Display aspect ratio                     : 1.385
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.299
Stream size                              : 1.22 GiB (90%)
Writing library                          : XviD 1.0.2 (UTC 2004-08-29)




While Video2 is has audio synched problems.

Video2
ID                                       : 0
Format                                   : MPEG-4 Visual
Format profile                           : Advanced Simple@L5
Format settings                          : BVOP1 / Custom Matrix
Format settings, BVOP                    : 1
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Custom
Codec ID                                 : XVID
Codec ID/Hint                            : XviD
Duration                                 : 2 h 23 min
Bit rate                                 : 1 021 kb/s
Width                                    : 720 pixels
Height                                   : 544 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.109
Stream size                              : 1.02 GiB (80%)
Writing library                          : XviD 1.2.1 (UTC 2008-12-04)

Also another information that might help is that 90% of the files i checked have in Format Settings : CUSTOM/MATRIX.
I guess some bad boys encoders messed with the default settings of xvid writing libary.

Not all XVID -with profile Advanced Simple@L5 have the same problem. Some of them play fine.
But 100% of the files with Custom/Matrix format settings based on Simple@L5 reproduce the problem.

Also among the 100 files i checked i found also 4 DVIX encoded files With CUSTOM/Matrix format settings which are also unsynced.

I have the XF9005 Sony. For me going back to 17.6 solves the sync issue but its not ideal. Why? Has anyone noticed the reduced  quality of the videos?
SOnys x1 Processor is very good and it does great upscaling with Hardware ACCel.  enabled. So i suspect that 17.6 version uses the software encoder for those type of files and as a result plays the movie with not such great upscaling and a 15% maybe even 20% quality loss
The more powerful processor your tv has, and the bigger your tv  is, then the more noticable is the difference from one version to the other.

Then i tried  to re-encode only the sound of the file leaving the video untouched and voila what a surprise!

With avidemux it takes only 1-2 minutes for a 800mb file to -re-encode the sound to AC3(i picked it accidentally) and the audio with the picture is suddenly synced in the new file.

I intend to re-encode the sound all the videos which have that issue now since as the rumors say there are not gonna be much changes in 19xxx....

Encoding the audio only is much easier and obviously less time consuming.

I dont know why Kodi does this. If its the audio codec or the hardware acceleration, or just sony in combination with the latestr KOdi, but i hope all these information will help the developers.
Reply
#32
(2019-07-11, 14:47)DaVu Wrote: expect that a bug is instantly fixed simply becuse it's reported. Be patient. That helps most. Wink

Thanks, DaVu - your comments are almost (!) as helpful as an actual fix. As users, we can appreciate the massive effort that's gone into Kodi.

Nonetheless, I have to point out several things:

1. "Free" doesn't mean that we users have no investment in the software. On the contrary, I have invested probably a dozen or more hours attempting to work around the recent Xvid bug. And I've spent many, many hours configuring Kodi to be easy for other members of my family. We've come to rely on Kodi for many purposes.

2. Communication is essential. It would have been great if Kodi 18.3 (or whatever we're up to) had flashed a message stating that bug fixes were being delayed. At least we'd have known where we stood.

3. It's incomprehensible that such a basic thing as Xvid playback was working in Kodi 17 but broken in Kodi 18. It took real effort to do this. I'd still love to know why the breaking change couldn't easily be rolled back.

4. If you want to start charging for Kodi, sign me up. I use Kodi because it's the best application of its kind, not because it's the cheapest. I'd be very happy to pay a substantial price for what Kodi gives me. Especially if that would ensure bug fixes and feature improvements for the future.
Reply
#33
Hi, I'm newbie here (not usin xmbc, kodi, etc..)
Why is this marked as "solved"?
I couldn't read an answer that solves the issues, not al least for Android users on smar TVs
Thanks in advance for your excellent work all thes years!
Reply
#34
(2019-10-21, 11:29)jorge6880 Wrote: Hi, I'm newbie here (not usin xmbc, kodi, etc..)
Why is this marked as "solved"?
I couldn't read an answer that solves the issues, not al least for Android users on smar TVs
Thanks in advance for your excellent work all thes years!
The thread is solved because that condition will not be fixed.

The Kodi team understandably doesn't want to downgrade to an older FFMPEG version anymore. And then we would also get problems with the playback of h.265 videos, which were not smoothly playable with the older FFMPEG version of Kodi 17.6. At least not on my Sony Android TVs.

But it's a pity that they don't work on the decoderfilter.xml "problem" anymore, because with it you could force the software decoding of old MPEG4 videos, but in newer versions a bug has crept in, which doesn't allow a smooth playback anymore. In the first Kodi builds with decoderfilter.xml the playback was still absolutely smooth with older XVIDs & forced MPEG4 software decoding via decoderfilter.xml.

But long speech short sense -> thread is solved Smile
Reply
#35
HD files downloaded from the onlineTVrecorder platform are coded as AVI files and have the audio sync problem. So the issue is alive with current files. I use VLC now which is a much better player than the built-in kodi player and it has no problems with audio sync.
Reply
#36
I'm trying to understand the technical details of this issue. Is it the newer version of FFMPEG that exposes some bug in Mediacodec hardware decoding?
Why did the old FFMPEG version not expose this?

Also - why is VLC not affected by this issue?
Reply
#37
@rainman74 It did follow your kind suggestion about pushing via adb /sdcard/Android/data/org.xbmc.kodi/files/.kodi/userdata/playercorefactory.xml onto my Sony TV XF9005.
xml:
<playercorefactory>

<players>
    <player name="VLC" type="ExternalPlayer" audio="true" video="true">
        <filename>org.videolan.vlc</filename>
        <args>"{1}"</args>
        <hidexbmc>true</hidexbmc>
        <hideconsole>true</hideconsole>
        <playcountminimumtime>120</playcountminimumtime>
    </player>
</players>
<rules name="system rules">
    <rule video="true" videocodec="xvid|divx|div3|div4|div5|dx50" player="VLC"/>
</rules>

</playercorefactory>


I also installed VLC which does play my files fine (are on NFS share, XVID-mp3).
However, despite playercorefactory.xml file, Kodi 18.7 still seems to play my file with HW mediaplayer and not calling VLC.
Any further hint?
Thanks.

PS: BTW I did not check if a default playercorefactory.xml file existed in userdata before adb push: should I have saved anything before?
Reply
#38
Exclamation 
Any updates on this one ?
I truly believe that it cannot be do much work to get it fixed once it was working in the past.

And the only result of not fixing it will be slow movement of users to another software.

Cmon guys - I remember times where there was not even one person saying bad word about Kodi. Look now.
Reply
#39
(2019-06-19, 16:49)Powerhouse Wrote: I have lots of xvid avi files, that play flawless on my Nvidia Shield TV (have several different versions of the Shield TV around the house, both old and new). Could it be the type of Android device you are using that is causing this issue?

Could be...I have two Android TV's, one an expensive bravia, and a cheap Element TV.  Both have issues with audio sink, but with different files.  I will look closer as to which they are.
Reply
#40
(2019-06-21, 16:37)powersurge Wrote:
(2019-06-19, 12:15)powersurge Wrote: On my 2016 Sony tv (65X8505C, Android 7) I had no issues playing Mpeg2/mp3 videos in Kodi 18.2. On my new 2019 Sony (65XG8599, Android 8) I have the audio out of sync issue with those same videos. I will try 17.6
I converted the avi files to h264/AC3 mkv's and no more out of sync issues

What did you use? ffmpeg?
Reply
#41
(2019-08-20, 21:16)messalius Wrote: Update:

I am new to Kodi, but since I have a big collection of xvids , i hope i can help as I managed to compare some of the files which play unsynced audio.

NOT ALL xvids have the same problem, but with media info I managed to pinpoint the problem for the videos with unsynced audio, and it seems all of then  are encoded with the Simple@L5 xvideo profile  as its called in the encoding configuration dialog of the Xvid codec.

For example Video1 Is healthy and the audio is synced .


Video1
ID                                       : 0
Format                                   : MPEG-4 Visual
Format profile                           : Simple@L3
Format settings, BVOP                    : No
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Default (H.263)
Codec ID                                 : XVID
Codec ID/Hint                            : XviD
Duration                                 : 1 h 37 min
Bit rate                                 : 1 793 kb/s
Width                                    : 576 pixels
Height                                   : 416 pixels
Display aspect ratio                     : 1.385
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.299
Stream size                              : 1.22 GiB (90%)
Writing library                          : XviD 1.0.2 (UTC 2004-08-29)




While Video2 is has audio synched problems.

Video2
ID                                       : 0
Format                                   : MPEG-4 Visual
Format profile                           : Advanced Simple@L5
Format settings                          : BVOP1 / Custom Matrix
Format settings, BVOP                    : 1
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Custom
Codec ID                                 : XVID
Codec ID/Hint                            : XviD
Duration                                 : 2 h 23 min
Bit rate                                 : 1 021 kb/s
Width                                    : 720 pixels
Height                                   : 544 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.109
Stream size                              : 1.02 GiB (80%)
Writing library                          : XviD 1.2.1 (UTC 2008-12-04)

Also another information that might help is that 90% of the files i checked have in Format Settings : CUSTOM/MATRIX.
I guess some bad boys encoders messed with the default settings of xvid writing libary.

Not all XVID -with profile Advanced Simple@L5 have the same problem. Some of them play fine.
But 100% of the files with Custom/Matrix format settings based on Simple@L5 reproduce the problem.https://retromash.com/2016/05/27/building-a-home-arcade-machine-part-18-making-the-bezel/

Also among the 100 files i checked i found also 4 DVIX encoded files With CUSTOM/Matrix format settings which are also unsynced.

I have the XF9005 Sony. For me going back to 17.6 solves the sync issue but its not ideal. Why? Has anyone noticed the reduced  quality of the videos?
SOnys x1 Processor is very good and it does great upscaling with Hardware ACCel.  enabled. So i suspect that 17.6 version uses the software encoder for those type of files and as a result plays the movie with not such great upscaling and a 15% maybe even 20% quality loss
The more powerful processor your tv has, and the bigger your tv  is, then the more noticable is the difference from one version to the other.

Then i tried  to re-encode only the sound of the file leaving the video untouched and voila what a surprise!

With avidemux it takes only 1-2 minutes for a 800mb file to -re-encode the sound to AC3(i picked it accidentally) and the audio with the picture is suddenly synced in the new file.

I intend to re-encode the sound all the videos which have that issue now since as the rumors say there are not gonna be much changes in 19xxx....

Encoding the audio only is much easier and obviously less time consuming.

I dont know why Kodi does this. If its the audio codec or the hardware acceleration, or just sony in combination with the latestr KOdi, but i hope all these information will help the developers.

What did you use to change the format.  I am WAY willing to reencode whatever files i need
Reply
#42
(2020-07-15, 19:22)macmpi Wrote: @rainman74 It did follow your kind suggestion about pushing via adb

I also installed VLC which does play my files fine (are on NFS share, XVID-mp3).
However, despite playercorefactory.xml file, Kodi 18.7 still seems to play my file with HW mediaplayer and not calling VLC.
Any further hint?
Thanks.

PS: BTW I did not check if a default playercorefactory.xml file existed in userdata before adb push: should I have saved anything before?

No, you do not have to save anything.

Send me a small excerpt of your file and I will take a look at it. Per OneDrive, GDrive, etc.
Reply
#43
(2020-07-18, 01:02)builderjer Wrote:
(2019-08-20, 21:16)messalius Wrote: Update:

I am new to Kodi, but since I have a big collection of xvids , i hope i can help as I managed to compare some of the files which play unsynced audio.

NOT ALL xvids have the same problem, but with media info I managed to pinpoint the problem for the videos with unsynced audio, and it seems all of then  are encoded with the Simple@L5 xvideo profile  as its called in the encoding configuration dialog of the Xvid codec.

For example Video1 Is healthy and the audio is synced .


I have the XF9005 Sony. For me going back to 17.6 solves the sync issue but its not ideal. Why? Has anyone noticed the reduced  quality of the videos?
SOnys x1 Processor is very good and it does great upscaling with Hardware ACCel.  enabled. So i suspect that 17.6 version uses the software encoder for those type of files and as a result plays the movie with not such great upscaling and a 15% maybe even 20% quality loss
The more powerful processor your tv has, and the bigger your tv  is, then the more noticable is the difference from one version to the other.

Then i tried  to re-encode only the sound of the file leaving the video untouched and voila what a surprise!

With avidemux it takes only 1-2 minutes for a 800mb file to -re-encode the sound to AC3(i picked it accidentally) and the audio with the picture is suddenly synced in the new file.

I intend to re-encode the sound all the videos which have that issue now since as the rumors say there are not gonna be much changes in 19xxx....

Encoding the audio only is much easier and obviously less time consuming.

I dont know why Kodi does this. If its the audio codec or the hardware acceleration, or just sony in combination with the latestr KOdi, but i hope all these information will help the developers.

What did you use to change the format.  I am WAY willing to reencode whatever files i need
Re-encoding only audio is not enough for all files.

I recommend a complete conversion:
Code:
for /R %I in (*.avi) do ffmpeg -i "%I" -map 0:v? -vcodec h264_nvenc -preset slow -profile:v high -level:v 3.1 -crf 18 -map 0:a? -acodec aac -b:a 192k "%~nI.mkv"
Reply
#44
(2020-08-26, 10:30)rainman74 Wrote: Send me a small excerpt of your file and I will take a look at it. Per OneDrive, GDrive, etc.



Thanks a lot for your help & consideration.
I sent you a link in PM for the actual 45sec excerpt.
Here is how I obtained it with ffmpeg:
cpp:
$ ./ffmpeg -ss 113 -i my_movie.avi -t 45 -c copy test.avi
ffmpeg version 4.3.1-tessus  https://evermeet.cx/ffmpeg/  Copyright © 2000-2020 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, avi, from 'my_movie.avi':
  Metadata:
    encoder         : MEncoder Sherpya-SVN-r30886-4.2.5
  Duration: 01:35:32.24, start: 0.000000, bitrate: 1007 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x304 [SAR 1:1 DAR 45:19], 866 kb/s, SAR 38912:38745 DAR 2048:861, 25 fps, 25 tbr, 25 tbn, 25 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
Output #0, avi, to 'test0.avi':
  Metadata:
    ISFT            : Lavf58.45.100
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x304 [SAR 38912:38745 DAR 2048:861], q=2-31, 866 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[avi @ 0x7fd08a812400] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frame= 1164 fps=0.0 q=-1.0 Lsize=    6095kB time=00:00:45.00 bitrate=1109.5kbits/s speed= 539x
video:5284kB audio:728kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.383688%
(note timestamp issue reported by ffmpeg)

Thanks for suggestions.
Reply
#45
I guess +1 more for this issue. Just bought an Insignia Fire TV and having this problem, along with not being able to play some files at all (all exact same codecs). Probably specific to the Fire TV itself because all other Firesticks around the house play the files fine, with the occasional sync issue. Not looking for help or anything so won't post a log, but basically the entire log is just this.

2020-08-22 13:10:59.423 T:9259   ERROR: CDVDVideoCodecAndroidMediaCodec:GetOutputPicture dequeueOutputBuffer failed
2020-08-22 13:10:59.425 T:9259   ERROR: CDVDVideoCodecAndroidMediaCodec::GetPicture dequeueInputBuffer failed
Reply

Logout Mark Read Team Forum Stats Members Help
AVI audio is out of sync since 18.01