xat / castnow

commandline chromecast player
MIT License
3.81k stars 243 forks source link

Trouble playing mkv files #128

Open DanielVoogsgerd opened 8 years ago

DanielVoogsgerd commented 8 years ago

I've some trouble playing mkv files out of the box. I read in #47 that mkv playback should work out of the box and it would make sense since the codec used (in my case) is h264 in both mp4 and mkv, but when playing a mkv file the following happens:

$ DEBUG=castnow* castnow --myip 192.168.x.y filename.mkv
  castnow launching... +0ms
  castnow:localfile started webserver on address 192.168.x.y using port 4100 +5ms
  castnow player status: loading plugins +2ms
  castnow player status: scanning +1ms
  castnow player status: connecting +176ms
  castnow player status: launching +103ms
  castnow player status: loading +3s
  castnow:localfile incoming request serving filename.mkv +355ms
  castnow:localfile incoming request serving filename.mkv +191ms
  castnow:localfile incoming request serving filename.mkv +90ms
  castnow player status: ready +1s
  castnow player status: idle +76ms

After which the chromecast displays the chromecast logo.

Does somebody know what the problem is here, or is the chromecast just not able of to play nice with mkv without "transcoding" it?

DanielVoogsgerd commented 8 years ago

Update on the issue. I've tried manually converting the file from mkv to mp4 and it still isn't working. I forgot to point out that in both cases transcoding the file on fly using --tomp4 works perfectly. Below the output of ffprobe on the converted file:

[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=104271/5000000
codec_tag_string=avc1
codec_tag=0x31637661
width=1280
height=720
coded_width=1280
coded_height=720
has_b_frames=2
sample_aspect_ratio=0:1
display_aspect_ratio=0:1
pix_fmt=yuv420p
level=51
color_range=N/A
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
timecode=N/A
refs=5
is_avc=1
nal_length_size=4
id=N/A
r_frame_rate=24000/1001
avg_frame_rate=1083648000/45197207
time_base=1/16000
start_pts=0
start_time=0.000000
duration_ts=45197207
duration=2824.825438
bit_rate=5136322
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=67728
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=eng
TAG:handler_name=VideoHandler
[/STREAM]
[STREAM]
index=1
codec_name=dca
codec_long_name=DCA (DTS Coherent Acoustics)
profile=DTS
codec_type=audio
codec_time_base=1/48000
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=48000
channels=6
channel_layout=5.1(side)
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/48000
start_pts=0
start_time=0.000000
duration_ts=135592848
duration=2824.851000
bit_rate=1536000
max_bit_rate=1536000
bits_per_raw_sample=N/A
nb_frames=264830
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=und
TAG:handler_name=SoundHandler
[/STREAM]
marclundgren commented 8 years ago

I wish castnow would automatically --tomp4 for mkv. Never once have I ever had an mkv work perfectly without it

ghost commented 8 years ago

I've seen the playback issue described when my firewall was too restrictive. Playing mkv containers hasn't been an issue since opening the correct firewall ports from the chromecast to the node.js machine.

We are a single-chromecast home.