Solved AVI audio is out of sync since 18.0
#46
(2020-08-26, 16:22)macmpi Wrote:
(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.
Thanks for suggestions.
I looked at your file and apparently Kodi 19 (which I use) can't read the video codec correctly.

But with this adapted playercorefactory.xml it still works. Important, VLC can only use SMBv1, you have to enable that if your NAS/router does not have it enabled by default.

Code:
<playercorefactory>
    <players>
        <player name="VLCPlayer" type="ExternalPlayer" audio="true" video="true">
            <filename>org.videolan.vlc</filename>
            <args>--fullscreen "{1}"</args>
            <hidexbmc>true</hidexbmc>
            <hideconsole>true</hideconsole>
            <playcountminimumtime>120</playcountminimumtime>
        </player>
    </players>
    <rules action="prepend">
        <rule video="true" player="dvdplayer">
            <rule filetypes="avi" player="VLCPlayer"/>
        </rule>
    </rules>
</playercorefactory>
Reply
#47
(2020-08-26, 18:41)rainman74 Wrote: Important, VLC can only use SMBv1, you have to enable that if your NAS/router does not have it enabled by default.

Thanks.
Surprised about the SMB limitation, as I can play file fine manually through NFS with VLC on my TV: is the limitation just for Kodi passing reference to VLC with playercorefactory.xml ?

Meanwhile, I note your last playercorefactory.xml suggestion differs from original one, with the list of possible formats, but also player name (which I guess just need to be consistent with initial declaration?) & "dvdplayer" thing...
Was:
xml:
<rules name="system rules">
    <rule video="true" videocodec="xvid|divx|div3|div4|div5|dx50" player="VLC"/>
</rules>
Newer:
xml:
    <rules action="prepend">
        <rule video="true" player="dvdplayer">
            <rule filetypes="avi" player="VLCPlayer"/>
        </rule>
    </rules>
Why is filetype more robust than videocodec screening?
Reply
#48
(2020-08-26, 19:04)macmpi Wrote:
(2020-08-26, 18:41)rainman74 Wrote: Important, VLC can only use SMBv1, you have to enable that if your NAS/router does not have it enabled by default.

Thanks.
Surprised about the SMB limitation, as I can play file fine manually through NFS with VLC on my TV: is the limitation just for Kodi passing reference to VLC with playercorefactory.xml ?

Meanwhile, I note your last playercorefactory.xml suggestion differs from original one, with the list of possible formats, but also player name (which I guess just need to be consistent with initial declaration?) & "dvdplayer" thing...
Was:
xml:
<rules name="system rules">
    <rule video="true" videocodec="xvid|divx|div3|div4|div5|dx50" player="VLC"/>
</rules>
Newer:
xml:
    <rules action="prepend">
        <rule video="true" player="dvdplayer">
            <rule filetypes="avi" player="VLCPlayer"/>
        </rule>
    </rules>
Why is filetype more robust than videocodec screening?

The name of the player does not matter.

And as I said "videocodec" does not work for me anymore. Seems to be due to Kodi.

Just try the new XML, it worked for me with your test video.
Reply
#49
(2020-08-26, 19:34)rainman74 Wrote: Just try the new XML, it worked for me with your test video.

Ok, tried it: I get an alert on Kodi saying to press ok when finished with other player; so I guess it tries to invoque VLC, and your suggested playercorefactory.xml does what it needs.
Now, I may be hit by the NFS vs SMB thing...
If I need to migrate Kodi on SMB to get all files reference right for VLC, and therefore update the whole Movie database...this is going to be a thing...

Maybe I'll have to take the pill and do some ad-hoc re-encoding for the failing files: just need to figure-out which ones in advance.
Reply
#50
Hello all,
I'm new here and I encountered a problem with my new Sony KD-65A89 TV (Android TV 9) and Kodi 18.9. In many aspects, it resembles what is described here, but with some differences.
The TV is connected to a Samsung HW-Q90R soundbar via eARC.
Playing MKV h264 videos works great: video quality is excellent and no issue with audio sync, even at different frame rates (mostly 24 and 25 fps contents).
Playing some old AVIs with MP3 audio, though, seems to be problematic. In particular I'm making my tests with a 25 fps AVI encoded with XviD and a 2.0 MP3 soundtrack.
Problem #1: audio is out of sync when playing the video with audio set to "audio system". This resembles the problem you're talking about. However, I can get it fixed in two ways:
  1. by using the TV speaker: ok, this is not a solution, but rather an information
  2. by using the soundbar, but setting the audio output mode from "Auto 1" to "Auto 2": in other words, it seems like some device in the chain does not work well when I send the 2.0 MP3 compressed stream directly to the soundbar; setting the output mode to "Auto 2", if I understand it correctly, leads the TV to decode the audio (since it's a 2.0 track, not a multichannel one) and send it to the soundbar as PCM; this way the audio is in sync
But the most annoying problem is #2: the video is heavily stuttering. This happens even if I set Kodi to change the refresh rate based on context (although I'm not sure it's actually working, this Sony TV doesn't seem to print anywhere what is the currently used output frequency) and even if I set Motionflow to maximum. Stuttering occurs independently of whether the audio is in sync or not.
The only workaround I found is to disable both "MediaCodec" options for hardware acceleration, but if I do that I see video quality is severely impacted (on this AVI file, but also on h264 videos).

VLC with audio passthrough enabled works well from a video quality point of view (no stuttering), even when I set hardware acceleration mode to "full", but I still have to use "Auto 2" digital audio output mode to get the audio in sync when using the soundbar. This makes me think that the audio problem is more related to my setup rather than to Kodi itself.

So, my final problem seems like a video stuttering problem, rather than an audio sync problem, but it's interesting that the scenario in which it occurs is much similar to the one you describe (here and on Kodi issue tracker at https://github.com/xbmc/xbmc/issues/15784), that is an AVI encoded with XviD at 25 fps, while problems with h264 videos are observed. For this reason, I decided to write to ask you whether you think the problem is the same one or not, possibly slightly changed by the fact that I'm using Android 9 rather than Oreo.

Thanks in advance.
Reply
#51
(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 .


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

i checked this reply after 2 years, forgive me lol. i used avi demux to extract and to convert the sound, then i added it with mkvmerge into the movie, without touching the video at all. it takes only a few mins for the whole process
Reply
#52
(2020-12-14, 13:04)mauromol Wrote: Problem #1: audio is out of sync when playing the video with audio set to "audio system". This resembles the problem you're talking about. However, I can get it fixed in two ways:
[...]
But the most annoying problem is #2: the video is heavily stuttering. This happens even if I set Kodi to change the refresh rate based on context (although I'm not sure it's actually working, this Sony TV doesn't seem to print anywhere what is the currently used output frequency) and even if I set Motionflow to maximum. Stuttering occurs independently of whether the audio is in sync or not.
The only workaround I found is to disable both "MediaCodec" options for hardware acceleration, but if I do that I see video quality is severely impacted (on this AVI file, but also on h264 videos).

Just as an update. I believe problem #1was fixed with an update of the Sony TV firmware, while problem #2 was definitely fixed by upgrading Kodi to version 19.
The Sony TV still has some buffering problems when using the ethernet cable connection, but this is a whole other story. I'm now using a nVidia Shield to get the best Kodi experience on this TV.
Reply
#53
(2022-06-22, 10:34)mauromol Wrote: Just as an update. I believe problem #1was fixed with an update of the Sony TV firmware

Unfortunatly not :-(
Reply

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