Jump to content

Chromecast aspect ratio wrong


sle118

Recommended Posts

I am facing an issue when trying to play some video content recorded with a Hauppauge HD-PVR box. When trying to playback the content, the resulting image has the wrong aspect ratio (sorry for the large size)

 

58543135f0f5a_IMG_20161216_131726.jpg

 

In order to try to resolve this, I configured folder sync and marked these shows to sync with the high profile. No joy.

 

So in order to provide an example here, I cut out 1 minute of the video and played it to ensure that the problem was still there. I used ffmpeg for the task, with an option like this

ffmpeg -ss 00:00:00 -t 00:00:00 -i [input.mp3|.mp4|...] [ouput.mp3|.mp4|...]
Well, there was no issue playing the file... so I wonder what sort of magic ffmpeg had done and looked at the content with MediaInfo

 

This is the original file

 

General Complete name : \\media\Users\Public\Videos\HDPVR\mymovie.MP4 Format : MPEG-4 Format profile : 3GPP Media Release 4 Codec ID : 3gp4 (3gp4/isom) File size : 6.51 GiB Duration : 2 h 49 min Overall bit rate mode : Variable Overall bit rate : 5 484 kb/s Encoded date : UTC 2015-10-02 06:19:58 Tagged date : UTC 2015-10-02 06:19:58 Xtra : WM/MediaClassPrimaryID Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : Main@L4 Format settings, CABAC : Yes Format settings, ReFrames : 4 frames Format settings, GOP : M=4, N=32 Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 2 h 49 min Bit rate mode : Variable Bit rate : 5 306 kb/s Maximum bit rate : 20.0 Mb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Variable Frame rate : 29.970 (29970/1000) FPS Minimum frame rate : 0.979 FPS Maximum frame rate : 29.973 FPS Original frame rate : 29.970 (30000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Interlaced Scan type, store method : Separated fields Scan order : Top Field First Bits/(Pixel*Frame) : 0.085 Stream size : 6.30 GiB (97%) Language : English Encoded date : UTC 2015-10-02 06:19:58 Tagged date : UTC 2015-10-02 06:19:58 Color range : Limited Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 2 h 49 min Source duration : 2 h 49 min Bit rate mode : Constant Bit rate : 170 kb/s Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 spf) Compression mode : Lossy Stream size : 206 MiB (3%) Source stream size : 206 MiB (3%) Language : English Encoded date : UTC 2015-10-02 06:20:04 Tagged date : UTC 2015-10-02 06:20:04
And this is the "cutout" file

General Complete name : \\media\Users\Public\Videos\HDPVR\short_example.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/mp41) File size : 65.0 MiB Duration : 2 min 0 s Overall bit rate mode : Variable Overall bit rate : 4 525 kb/s Encoded date : UTC 1970-01-01 00:00:00 Tagged date : UTC 1970-01-01 00:00:00 Writing application : Lavf52.104.0 Video ID : 1 Format : MPEG-4 Visual Format profile : Simple@L1 Format settings, BVOP : No Format settings, QPel : No Format settings, GMC : No warppoints Format settings, Matrix : Default (H.263) Codec ID : 20 Duration : 2 min 0 s Bit rate : 4 478 kb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 29.970 (30000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Compression mode : Lossy Bits/(Pixel*Frame) : 0.072 Stream size : 64.1 MiB (99%) Writing library : Lavc52.117.0 Language : English Encoded date : UTC 1970-01-01 00:00:00 Tagged date : UTC 1970-01-01 00:00:00 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 2 min 0 s Bit rate mode : Variable Bit rate : 61.0 kb/s Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 spf) Compression mode : Lossy Stream size : 897 KiB (1%) Language : English Encoded date : UTC 1970-01-01 00:00:00 Tagged date : UTC 1970-01-01 00:00:00
With the fast approaching holidays, it would be nice to get a resolution so I could do some binge watching.

 

I have pasted parts of the log here when starting the stream. It's for a different file, but the pattern is exactly the same

http://pastebin.com/zR5QKRZA

 

Can anyone help with this?

Edited by sle118
Link to comment
Share on other sites

Existing files are >8gb so they would not be practical. I will try to record a smaller sample over the weekend, as cutting out portions of these files resulted in a working cast...

 

note that the main difference between the 2 files seem to be that the "cut" file is "progressive" as opposed to interlaced. Furthermore, folder sync also shows "interlaced" as well.

 

this leads me to believe that the issue might be caused by Chromecast not properly recognizing the interlaced stream that is sent to it...

Link to comment
Share on other sites

I am sharing a short example which shows similar behavior, although a bit different. The picture is "compressed" at the top of the screen and the bottom section is filled with artifacts which remind of old TVs when they got "ghost" images from reflections of the signal.

 

As for the content, this is whatever was playing during the record, not a choice ;)

 

https://drive.google.com/file/d/0B5I4AMklqDsqNUMtV0NnYS1EMk0/view?usp=sharing

Link to comment
Share on other sites

Arrgh.... looks like this is getting worst and worst. 
 
I wanted to reorganize some media on my network file server because I was running out of space on one of the drives. This was a bad move. I ended up having to delete the sync folder which had been transcoding for 5 days now because sync jobs would all fail. I removed the plugin, reinstalled it and attempted to sync again.
 
There are exceptions now in the log, but overall, I think the sync jobs are running... will check in a few hours

	Application directory: C:\Users\myself\AppData\Roaming\MediaBrowser-Server\System
	System.InvalidOperationException: Unexpected ProfileConditionType
	   à MediaBrowser.Model.Dlna.ConditionProcessor.IsConditionSatisfied(ProfileCondition condition, Nullable`1 currentValue)
	   à MediaBrowser.Model.Dlna.StreamBuilder.GetVideoDirectPlayProfile(VideoOptions options, MediaSourceInfo mediaSource, MediaStream videoStream, MediaStream audioStream, Boolean isEligibleForDirectPlay, Boolean isEligibleForDirectStream, List`1 allMediaStreams)
	   à MediaBrowser.Model.Dlna.StreamBuilder.BuildVideoItem(MediaSourceInfo item, VideoOptions options)
	   à MediaBrowser.Model.Dlna.StreamBuilder.BuildVideoItem(VideoOptions options)

My guess is that the file that's being analysed by the sync job chokes on the content. This is also a file which was recorded by the HDPVR

General 
Complete name : \\server\Videos\myfile.MP4 
Format : MPEG-4 
Format profile : 3GPP Media Release 4 
Codec ID : 3gp4 (3gp4/isom) 
File size : 4.24 GiB 
Duration : 2 h 2 min 
Overall bit rate mode : Variable 
Overall bit rate : 4 943 kb/s 
Encoded date : UTC 2016-11-11 02:57:32 
Tagged date : UTC 2016-11-11 02:57:32 
IsTruncated : Yes 

Video 
ID : 1 
Format : AVC 
Format/Info : Advanced Video Codec 
Format profile : Main@L4 
Format settings, CABAC : Yes 
Format settings, ReFrames : 4 frames 
Format settings, GOP : M=4, N=32 
Codec ID : avc1 
Codec ID/Info : Advanced Video Coding 
Duration : 2 h 2 min 
Bit rate mode : Variable 
Bit rate : 4 751 kb/s 
Maximum bit rate : 20.0 Mb/s 
Width : 1 920 pixels 
Height : 1 080 pixels 
Display aspect ratio : 16:9 
Frame rate mode : Variable 
Frame rate : 29.970 (29970/1000) FPS 
Minimum frame rate : 0.892 FPS 
Maximum frame rate : 29.973 FPS 
Original frame rate : 29.970 (30000/1001) FPS 
Color space : YUV 
Chroma subsampling : 4:2:0 
Bit depth : 8 bits 
Scan type : Interlaced 
Scan type, store method : Separated fields 
Scan order : Top Field First 
Bits/(Pixel*Frame) : 0.076 
Stream size : 4.07 GiB (96%) 
Language : English 
Encoded date : UTC 2016-11-11 02:57:32 
Tagged date : UTC 2016-11-11 02:57:32 
Color range : Limited 
Color primaries : BT.709 
Transfer characteristics : BT.709 
Matrix coefficients : BT.709 

Audio 
ID : 2 
Format : AAC 
Format/Info : Advanced Audio Codec 
Format profile : LC 
Codec ID : 40 
Duration : 2 h 2 min 
Bit rate mode : Constant 
Bit rate : 185 kb/s 
Channel(s) : 2 channels 
Channel positions : Front: L R 
Sampling rate : 48.0 kHz 
Frame rate : 46.875 FPS (1024 spf) 
Compression mode : Lossy 
Stream size : 162 MiB (4%) 
Language : English 
Encoded date : UTC 2016-11-11 02:57:37 
Tagged date : UTC 2016-11-11 02:57:37 

Edited by sle118
Link to comment
Share on other sites

Hi @@sle118, can you please attach the complete emby server log? I have your sample file that you provided, i will be testing it shortly. thanks !

Link to comment
Share on other sites

Hi @@sle118, can you please attach the complete emby server log? I have your sample file that you provided, i will be testing it shortly. thanks !

Is there a way to send it to you privately? I don't like exposing my server structure to the general public.

 

FYI, folder sync should handle exceptions nicely when it's processing the video items in the queue. Not doing so results in the queue hanging out there and the temp transcodes to fill up the work drive.

 

I have cloned the repo to try and debug the process right before it derails; it would be nice if the condition evaluation could also dump which condition was unexpected, but short of this now I'll trace manually.

Edited by sle118
Link to comment
Share on other sites

Hi @@sle118, I tested your sample file and it worked fine for me, both with transcoding and with direct play. the aspect ratio looked fine and the video filled the screen. Did you make sure the problem was occurring with the sample you gave me?

Link to comment
Share on other sites

@@sle118, i tested this 4gb file on chromecast and did not see any aspect ratio issues, both with direct play and transcoding. What kind of TV do you have?

 

I will now test it on android. Thanks.

Link to comment
Share on other sites

The sync issue is resolved for the next release, thanks.

 

Can you share your findings?

 

Also, I ran ffprobe on the command line and found the following output, which seems to be the root cause of many of my issues. -- NEVERMIND THAT. The file had been truncated to 0 bytes.

ffprobe version N-82324-g872b358 Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fon
tconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --e
nable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libr
tmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvo
rbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --ena
ble-zlib
  libavutil      55. 36.100 / 55. 36.100
  libavcodec     57. 66.101 / 57. 66.101
  libavformat    57. 57.100 / 57. 57.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 66.100 /  6. 66.100
  libswscale      4.  3.100 /  4.  3.100
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
file:\\media\Videos2\myfile.TS: Invalid data found when processing input

not good!  I'll see if I an find a more recent ffmpeg

Edited by sle118
Link to comment
Share on other sites

If you're on windows then you should just stick to the build that came with the server. you can grab it here if you need to:

https://github.com/MediaBrowser/Emby.Resources/tree/master/ffmpeg/windows

 

There is probably nothing wrong with the version that you chose, but it's not realistic for us to test every possible version so customizing it is generally only something you should do if you actually have a reason to do that.

Link to comment
Share on other sites

I took the latest build and tried to sync again.  Saw the following exception in the logs

 

Constraint: NOT NULL constraint failed: SyncJobs.ItemIds
SQLitePCL.pretty.SQLiteException: Une exception de type 'SQLitePCL.pretty.SQLiteException' a été levée.
 
I added the logs to my shared folder. 
 
How I did this:
- I moved the video file to a folder where auto-sync was enabled
- ran sync
 
 
Note that the movie had been added to another sync job in the past, under a different "batch" of multiple movies. I had cancelled it when I found it to derail the entire sync job.
 
thanks!
Link to comment
Share on other sites

Got it!

 

I sent another video file to the shared folder. That is the original file, full length, for which I posted the picture in the first post.

 

As for the aspect ratio, I'm playing the file on a 65" Haier LCD bought last fall. Other full HD content, for example from Netflix, plays just fine on the cast. I'll check to see if the chrome cast's resolution or sync rate can be changed. This wouldn't explain why I'm getting green interlaced video on the tablet, though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...