Solved [Linux] Can play 24 fps video but 50 instead of 25
#1
This is my first post here, so, hi to everybody. After years of using XBMC in my normal computers, finally I'm using it in my dedicated media player.


THE PROBLEM

I can play videos at 23.976*, 24, 50 or 60 fps and the TV synchronizes to that speed. But, when I try to watch any video at 25, 29.97 or 30 fps, the TV synchronizes to twice that speed. So, for example, when I try to watch a 25 fps video, the TV synchronizes to 50 Hz.

Image Image

I know this is not creating any artefact in the image or it's movement since every frame is displayed twice but I would like to display every video to its original framerate. I've tried many configuration combinations with no luck and my TV is compatible with those frequencies (output of xrandr command in linux console):

Code:
1920x1080      60.0*+   50.0     59.9     30.0     25.0     24.0     30.0     24.0

* When I play 23.976 fps videos, the TV show 24 but I cannot notice any artifact so I assume it's OK.


THE SOLUTION?

I've been playing with advancedsettings.xml, again with no luck. I have the impression that Kodi is not recognizing well the override section* since, for example, I cannot force my 24 fps movies to be played at 60 Hz. I know this doesn't make sense, it's just to be sure that Kodi is using my overridings from advancedsettings.xml.

Code:
<adjustrefreshrate>
    <override>
        <fpsmin>23.00</fpsmin>         <!-- Every video above 23.00 fps...                        -->
        <fpsmax>26.00</fpsmax>         <!-- ...and below 26.00 fps...                             -->
        <refresh>60.00</refresh>       <!-- ...should change the TV refresh rate to 60 Hz.        -->
    </override>
</adjustrefreshrate>

* Other options in advancedsettings.xml like <splash> or <sorttokens> work well.


MY SETUP
  • TV: Samsung H5500.
  • Computer: Intel NUC D54250WYKH (i5 processor, HD Intel® 5000 graphics "card").
  • O.S.: Linux Mint 17.1 + xcfe desktop.
  • Kodi 14.1.


CONFIGURATION OF KODI

Settings > Video > Playback:
  • Adjust display refresh rate to match video: Always
  • Sync playback to display: Yes
  • A/V sync method: Video clock (Resample audio)

Settings > Video > Acceleration: Default.

Settings > System > Video output:
  • Monitor: HDMI1.
  • Display mode: Full screen.
  • Vertical blank sync: Always enabled.


Any idea of what's going on or what should I try to finally watch 25 fps --> 25 Hz, 29.97 fps --> 29.97 Hz and so on?

Regards and thanks in advance.
Reply
#2
/usr/lib/kodi/kodi-xrandr can show fractional modes, too.

Playing 25 fps at 50 hz is perfectly fine. Your av.xml does not make any sense, it will introduce nice issues, especially for 23.976 content, that won't fit into 60 hz with 3:2.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#3
bit offtopic: either you don't have vaapi enabled for hardware decoding or you are missing vaapi drivers. The screenshot you posted is software(cpu) decoding.
Reply
#4
@fritsch, here is the output of kodi-xrandr for 1920x1080:

Code:
<mode id="0x48" name="1920x1080" w="1920" h="1080" hz="60.00000" current="true" preferred="true"/>
<mode id="0xae" name="1920x1080" w="1920" h="1080" hz="50.00000" current="false" preferred="false"/>
<mode id="0xaf" name="1920x1080" w="1920" h="1080" hz="59.94020" current="false" preferred="false"/>
<mode id="0xb2" name="1920x1080" w="1920" h="1080" hz="30.00000" current="false" preferred="false"/>
<mode id="0xb3" name="1920x1080" w="1920" h="1080" hz="25.00000" current="false" preferred="false"/>
<mode id="0xb4" name="1920x1080" w="1920" h="1080" hz="24.00000" current="false" preferred="false"/>
<mode id="0xb6" name="1920x1080" w="1920" h="1080" hz="29.97010" current="false" preferred="false"/>
<mode id="0xb7" name="1920x1080" w="1920" h="1080" hz="23.97608" current="false" preferred="false"/>

So my monitor is able to handle those modes. And I know my av.xml doesn't make real sense: it's a test to see if I'm able to actually force a refresh rate (even when it's wrong) so I'll be sure that Kodi is using that information Wink. From that point I'd start trying to correct the 25-30 fps issue.

I know that playing videos at twice their "standard" refresh rate won't introduce any artifact or error during playback; everything will be perfectly smooth. But I'd like to force the real refresh rate and also understand what's the reason for that behaviour in my sistem with those particular frequencies.

@wsnipex I'm playing with configurations so maybe that's the reason for the inconsistency between my base configuration and the screenshot.
Reply
#5
are you sure those 25hz files are not interlaced?
Reply
#6
I'm afraid that's not the problem. For example with this 30p video: http://vimeo.com/105045889

Image
Reply
#7
Quote:fritsch@t440s:~/Downloads$ mediainfo Fuji\ XT-1\ 1080\ 30P\ video\ test\ footage\ with\ XF\ 23mm\ f-1.4-HD.mp4.crdownload
General
Complete name : Fuji XT-1 1080 30P video test footage with XF 23mm f-1.4-HD.mp4.crdownload
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 6.23 MiB
Duration : 55s 360ms
Overall bit rate mode : Variable
Overall bit rate : 945 Kbps
Encoded date : UTC 2014-09-02 18:25:37
Tagged date : UTC 2014-09-02 18:25:37

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 55s 355ms
Bit rate : 2 500 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.091
Stream size : 16.3 MiB
Writing library : x264 core 142 r2431 a5831aa
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=24 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=90 / keyint_min=30 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=2500 / ratetol=1.0 / qcomp=0.60 / qpmin=5 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=2750 / vbv_bufsize=7500 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2014-09-02 18:25:37
Tagged date : UTC 2014-09-02 18:25:37

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 55s 360ms
Bit rate mode : Variable
Bit rate : 160 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 1.06 MiB (17%)
Encoded date : UTC 2014-09-02 18:25:37
Tagged date : UTC 2014-09-02 18:25:37

It's not 30p
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#8
Is the <adjustrefreshrate> section inside <video>?

This works fine here:
Code:
<video>
        <adjustrefreshrate>
            <override>
                <fps>25.000</fps>
                <refresh>25.00</refresh>
            </override>

            <override>
                <fps>23.976</fps>
                <refresh>23.976</refresh>
            </override>
        </adjustrefreshrate>
    </video>
Reply
#9
Yes.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#10
fritsch, yes, it's 29.97 but for the purpose of my test it was fine since I also had the problem with 29.97 fps videos.

menakite, THAT STUPID MISTAKE. That was it... and I don't have any excuse because searching I found a similar error with <refreshrate> and I didn't check if there were other parent tags.

Thank you all very much, I have no words to describe how I feel now. I was about to get mad this week because this problem.

Image Image Image

One extra question, why does this happens? I mean, why Kodi is not able not assign by itself the available refreshate and we have to force it?

In case somebody found this thread, the FULL content of advancedsettings.xml should be:

Code:
<advancedsettings>
    [...other options here...]

    <video>
        <adjustrefreshrate>

            <override>
                <fps>25.000</fps>
                <refresh>25.00</refresh>
            </override>

            <!-- write as many overrides as you want -->

        </adjustrefreshrate>
    </video>

</advancedsettings>

Again, thank you very much.
Reply
#11
Why do you want to play 25fps content at 25 hz?

Everything where refreshrate / fps = some even value everything is perfectly fine.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#12
Short answer? I don't know Big Grin

Long answer, maybe the power consumption/heating is lower since the computer doesn't need to show twice each image. I know that probably the advantage is going to be imperceptible but now it's something I can test. For me, the main issue was the incomprehensible different behaviour between 24 and 25 fps videos.

By the way, fritsch, before I noticed you are part of Kodi development team. I would like to thank you, and other people like you, for such a great program.
Reply
#13
On most TVs the 25hz mode is in reality the 1080i50 mode and it will start to do fancy things - if you are unlucky.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
[Linux] Can play 24 fps video but 50 instead of 251