Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th June 2019, 13:35   #1  |  Link
wigor1
Registered User
 
Join Date: Mar 2019
Posts: 7
4K TV cannot play 4K H.264

Hi,

If I re-encode 4K video in ffmpeg with default settings to H.264 it plays fine on several 4K TVs.

When I encode 4K video H.264 in my app using ffmpeg on C/C++ this 4K video doesn't play on 4K TVs (LG, Sony, Samsung).

I can't see any significant difference between video files in parameters:

https://www.dropbox.com/s/situh0d6kh...video.zip?dl=0

Problem video on 4K TVs:
Code:
General
Complete name                  : D:\2\4K-TV-test\forum\testvideo\Problem-on-4K-TV.mp4
Format                         : MPEG-4
Format profile                 : Base Media
Codec ID                       : isom (isom/iso2/avc1/mp41)
File size                      : 20.8 MiB
Duration                       : 28 s 29 ms
Overall bit rate               : 6 214 kb/s
Writing application            : Lavf58.20.100

Video
ID                             : 1
Format                         : AVC
Format/Info                    : Advanced Video Codec
Format profile                 : High@L5.2
Format settings, CABAC         : Yes
Format settings, RefFrames     : 5 frames
Codec ID                       : avc1
Codec ID/Info                  : Advanced Video Coding
Duration                       : 28 s 29 ms
Duration_LastFrame             : 17 ms
Bit rate                       : 5 959 kb/s
Nominal bit rate               : 13.0 Mb/s
Width                          : 3 840 pixels
Height                         : 2 160 pixels
Display aspect ratio           : 16:9
Frame rate mode                : Constant
Frame rate                     : 59.940 (59940/1000) FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Scan type                      : Progressive
Bits/(Pixel*Frame)             : 0.012
Stream size                    : 19.9 MiB (96%)
Writing library                : x264 core 157 r2935 545de2f
Encoding settings              : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=abr / mbtree=1 / bitrate=13000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

Audio
ID                             : 2
Format                         : AAC
Format/Info                    : Advanced Audio Codec
Format profile                 : LC
Codec ID                       : 40
Duration                       : 27 s 29 ms
Bit rate mode                  : Constant
Bit rate                       : 256 kb/s
Channel(s)                     : 2 channels
Channel positions              : Front: L R
Sampling rate                  : 44.1 kHz
Frame rate                     : 43.066 FPS (1024 SPF)
Compression mode               : Lossy
Stream size                    : 846 KiB (4%)
Default                        : Yes
Alternate group                : 1
This video plays fine on 4K TV:
Code:
General
Complete name                  : D:\2\4K-TV-test\forum\testvideo\ffmpeg-OK-on-4K-TV.mp4
Format                         : MPEG-4
Format profile                 : Base Media
Codec ID                       : isom (isom/iso2/avc1/mp41)
File size                      : 40.0 MiB
Duration                       : 28 s 12 ms
Overall bit rate               : 12.0 Mb/s
Writing application            : Lavf58.20.100

Video
ID                             : 1
Format                         : AVC
Format/Info                    : Advanced Video Codec
Format profile                 : High@L5.2
Format settings, CABAC         : Yes
Format settings, RefFrames     : 5 frames
Codec ID                       : avc1
Codec ID/Info                  : Advanced Video Coding
Duration                       : 28 s 12 ms
Bit rate                       : 11.9 Mb/s
Nominal bit rate               : 13.0 Mb/s
Width                          : 3 840 pixels
Height                         : 2 160 pixels
Display aspect ratio           : 16:9
Frame rate mode                : Constant
Frame rate                     : 59.940 (59940/1000) FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Scan type                      : Progressive
Bits/(Pixel*Frame)             : 0.024
Stream size                    : 39.6 MiB (99%)
Writing library                : x264 core 157 r2935 545de2f
Encoding settings              : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=abr / mbtree=1 / bitrate=13000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

Audio
ID                             : 2
Format                         : AAC
Format/Info                    : Advanced Audio Codec
Format profile                 : LC
Codec ID                       : 40
Duration                       : 27 s 52 ms
Bit rate mode                  : Constant
Bit rate                       : 129 kb/s
Channel(s)                     : 2 channels
Channel positions              : Front: L R
Sampling rate                  : 44.1 kHz
Frame rate                     : 43.066 FPS (1024 SPF)
Compression mode               : Lossy
Stream size                    : 425 KiB (1%)
Default                        : Yes
Alternate group                : 1
The problem is only with 3840 x 2160 60p video. 30p video plays fine.
wigor1 is offline   Reply With Quote
Old 4th June 2019, 14:10   #2  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,005
Quote:
Originally Posted by wigor1 View Post
The problem is only with 3840 x 2160 60p video. 30p video plays fine.
This is your answer. I think that the HW decoder just doesn't support 60fps. What is the model name of the tv?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database || https://github.com/avisynth-repository
ChaosKing is offline   Reply With Quote
Old 4th June 2019, 14:27   #3  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,093
Quote:
This video plays fine on 4K TV:
Frame rate : 59.940 (59940/1000) FPS

Quote:
The problem is only with 3840 x 2160 60p video. 30p video plays fine.
So you say that 60fps works fine?
Atak_Snajpera is offline   Reply With Quote
Old 4th June 2019, 14:27   #4  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 5,833
both examples are 59p (both are incorrect/not part of any spec btw)there are 2 differences i can see audio bit rate and video bit rate.
huhn is offline   Reply With Quote
Old 4th June 2019, 15:07   #5  |  Link
wigor1
Registered User
 
Join Date: Mar 2019
Posts: 7
Both videos were encoded with libx264.

Speaking 60p I meant 59.94p.

I encode video using ffmpeg C/C++ LibAV library. 3840 x 2160 59.94p

If I use NVENC encoder it plays fine on 4K TV.

If I use libx264 with same settings, 4K video doesn't play on 4K TV. However all sw players (VLC, etc) play fine this video.

Why you think that 59.94p is incorrect? I saw many video files with these parameters.
I didn't check true 60p video yet.
wigor1 is offline   Reply With Quote
Old 4th June 2019, 15:09   #6  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,005
In PotPlayer "ok" is shown as 59.94fps and "problem" as 59.905fps. I would try to remux the file and see if it helps. And test also without audio, just to be sure.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database || https://github.com/avisynth-repository

Last edited by ChaosKing; 4th June 2019 at 15:12.
ChaosKing is offline   Reply With Quote
Old 4th June 2019, 15:59   #7  |  Link
SeeMoreDigital
Life looks better in UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,449
If you de-mux the video and audio streams to elementary streams and re-mux them to either, MP4, M2TS or MKV you'll find that MediaInfo reports the video stream runs 119.880 FPS!

EDIT: I forgot to mention that my LG 65UH770V is unable to play any of your provided files...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 4th June 2019 at 16:11.
SeeMoreDigital is offline   Reply With Quote
Old 4th June 2019, 21:44   #8  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,479
Maybe it's something about the timings/timescale.

Try:
Code:
ffmpeg -i Problem-on-4K-TV.mp4 -c copy -bsf:v "h264_metadata=tick_rate=120000/1001:fixed_frame_rate_flag=1" -video_track_timescale 60000 "output.mp4"
Also try:
Code:
ffmpeg -i Problem-on-4K-TV.mp4 -map 0 -c copy -to 00:27 "to27.mp4"

Last edited by sneaker_ger; 4th June 2019 at 22:04.
sneaker_ger is offline   Reply With Quote
Old 5th June 2019, 03:31   #9  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 5,833
Quote:
Originally Posted by wigor1 View Post
Both videos were encoded with libx264.

Speaking 60p I meant 59.94p.

I encode video using ffmpeg C/C++ LibAV library. 3840 x 2160 59.94p

If I use NVENC encoder it plays fine on 4K TV.

If I use libx264 with same settings, 4K video doesn't play on 4K TV. However all sw players (VLC, etc) play fine this video.

Why you think that 59.94p is incorrect? I saw many video files with these parameters.
I didn't check true 60p video yet.
PC video players don't care give them 53.8877 FPS and it will play it doesn't change it is not part of a major spec.

your files are not at the correct 59p fps which is 60000/1001 and not 59.940 (59940/1000) which is simply not the same. i think is unlikely but an internal media player in a Tv may reject bad to this they are at best unreliable anyway.
huhn is offline   Reply With Quote
Reply

Tags
h.264

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.