Opened 8 years ago

Closed 6 years ago

Last modified 5 years ago

#10706 closed Bug Report - General (fixed)

mythtv doesnt play high bitrate(9/10bit) content smoothly

Reported by: slackerlinux85@… Owned by: JYA
Priority: minor Milestone: 0.27
Component: MythTV - Video Playback Version: Unspecified
Severity: medium Keywords:
Cc: Ticket locked: no

Description

when playing 10bit content mythtv pauses every few seconds due to no useable video buffers left and then dumps all the frames till the video is done playing back(mythffplay plays the content fine).

9/10bit content also cannot be played with vdpau so a check is needed so it will fall back to software decoder.

Attachments (3)

10bitwhite.mkv (277.7 KB) - added by slackerlinux85@… 8 years ago.
small test video
mythavtest.log (32.2 KB) - added by slackerlinux85@… 8 years ago.
log from mythavtest with -v general, playback
10bitfix.patch (1.7 KB) - added by slackerlinux85@… 6 years ago.
should fix 9/10bit content and MJPEG content in mythtv

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by slackerlinux85@…

Attachment: 10bitwhite.mkv added

small test video

Changed 8 years ago by slackerlinux85@…

Attachment: mythavtest.log added

log from mythavtest with -v general, playback

comment:1 Changed 8 years ago by beirdo

comment:2 Changed 7 years ago by slackerlinux85@…

done some more debugging it seems the buffers for 9/10bit content is using FF_BUFFER_TYPE_INTERNAL and removing the if (!decode.contains(*it)) check in VideoBuffers::DoneDisplayingFrame? makes the video play smoothly so i think the problem might be with how mythtv handles FF_BUFFER_TYPE_INTERNAL buffers

i still have no idea on how to properly fix it but i hope this information will help

comment:3 Changed 7 years ago by moores.martin@…

Just to add my sample here, which appears to have the same issue. Was pointed to this and ticket #10942 by Shawn King on the users list:

http://www.gossamer-threads.com/lists/mythtv/users/531135

It is commented in #10942 that these two tickets are most likely duplicates, so just to mention that here also

My sample is here, hopefully it might help with testing:

http://dl.dropbox.com/u/419095/2012-10-20-mythvideo/2012-09-09_16-32-30.AVI

comment:4 Changed 6 years ago by JYA

Owner: set to JYA
Status: newaccepted

comment:5 Changed 6 years ago by slackerlinux85@…

finally got around to finding a fix for this

kinda disappointed that this has been opened for 1.5 years and kinda disappointed it took me this long to find a fix that im happy with releasing

the main issue is that for non-directrendering codecs ffmpeg handles the buffers but the buffers are still added to the decode queue so they are never released(till the buffers full and all frames get dropped) what this does is add a direct rendering setting to videoframe and if set it skips adding the frames to the decode list

i dont know much about the buffering code but this code fixes 9/10bit aswell as the camera samples i have. this is the best way i have found to do it but it feels more like a workaround then a fix and i really dont know enough about mythtv to know if its correct(and theres probably a much better way to fix this)

there still needs to be a software fallback check for 9/10bit content with vdpau. i had a go at that months ago(only about 5 mins) but i ended up with black screen + audio(better then failed to init avsync) unfortunally i the dev macine im using atm is an intel chip so i wont be doing a patch for that(atleast for now)

Changed 6 years ago by slackerlinux85@…

Attachment: 10bitfix.patch added

should fix 9/10bit content and MJPEG content in mythtv

comment:6 Changed 6 years ago by Jean-Yves Avenard <jyavenard@…>

Resolution: fixed
Status: acceptedclosed

In 8f0437c7a66626f29fff18b04c60035cd8fb3b91/mythtv:

Fix playback of 9/10bit h264 videos

The fashion this fix is implemented is a hack more than anything else.
It disable the following H264 profile to be decoded via the GPU:
FF_PROFILE_H264_HIGH_10
FF_PROFILE_H264_HIGH_10_INTRA
FF_PROFILE_H264_HIGH_422
FF_PROFILE_H264_HIGH_422_INTRA
FF_PROFILE_H264_HIGH_444_PREDICTIVE
FF_PROFILE_H264_HIGH_444_INTRA
FF_PROFILE_H264_CAVLC_444

regardless of the GPU acceleration method (VDPAU, VAAPI, VDA, DXVA or CrystalHD). Which at this present time is acceptable enough as no hardware handle those profiles.

A proper implementation, per decoder, would require significant changes and code cleanup to the mess that is currently avformatdecoder.cpp

Fixes #10706

comment:7 Changed 6 years ago by Jean-Yves Avenard <jyavenard@…>

In 329b25db98845b2c1ef9e0f393e889864bb1ecc9/mythtv:

Fix playback of 9/10bit h264 videos

The fashion this fix is implemented is a hack more than anything else.
It disable the following H264 profile to be decoded via the GPU:
FF_PROFILE_H264_HIGH_10
FF_PROFILE_H264_HIGH_10_INTRA
FF_PROFILE_H264_HIGH_422
FF_PROFILE_H264_HIGH_422_INTRA
FF_PROFILE_H264_HIGH_444_PREDICTIVE
FF_PROFILE_H264_HIGH_444_INTRA
FF_PROFILE_H264_CAVLC_444

regardless of the GPU acceleration method (VDPAU, VAAPI, VDA, DXVA or CrystalHD). Which at this present time is acceptable enough as no hardware handle those profiles.

A proper implementation, per decoder, would require significant changes and code cleanup to the mess that is currently avformatdecoder.cpp

Fixes #10706
(cherry picked from commit 8f0437c7a66626f29fff18b04c60035cd8fb3b91)

comment:8 Changed 5 years ago by paulh

Milestone: unknown0.27
Note: See TracTickets for help on using tickets.