muammar / mkchromecast

Cast macOS and Linux Audio/Video to your Google Cast and Sonos Devices
http://mkchromecast.com
Other
2.22k stars 140 forks source link

When i set subtitles on a video - doesn't play! #175

Open Tas-sos opened 6 years ago

Tas-sos commented 6 years ago

I have a video who plays well on chromecast (tv) with the below command : mkchromecast --video -i "aVideo.part1.mkv"

mkchromecast v0.3.7
video
PID of main process: 3518
PID of streaming process: 3523
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

List of Google Cast devices available in your network:
------------------------------------------------------
 Index   Friendly name
=====   ============= 
0       my-room

We will cast to first device in the list above!
my-room

Information about  my-room

DeviceStatus(friendly_name=u'my-room', model_name=u'Chromecast', manufacturer=u'Google Inc.', api_version=(1, 0), uuid=UUID('8e1dc377-c7ac-b494-e257-e4c1bc935746'), cast_type='cast')

Status of device  my-room

CastStatus(is_active_input=False, is_stand_by=True, volume_level=1.0, volume_muted=False, app_id=u'E8C28D3C', display_name=u'Backdrop', namespaces=[u'urn:x-cast:com.google.cast.debugoverlay', u'urn:x-cast:com.google.cast.cac', u'urn:x-cast:com.google.cast.sse'], session_id=u'bfd44684-402b-4caa-a336-a645468f197d', transport_id=u'bfd44684-402b-4caa-a336-a645468f197d', status_text=u'')

The IP of my-room is: 192.168.2.98
Your local IP is: 192.168.2.10

The media type string used is: video/mp4

Cast media controller status

CastStatus(is_active_input=False, is_stand_by=True, volume_level=1.0, volume_muted=False, app_id=u'CC1AD845', display_name=u'Default Media Receiver', namespaces=[u'urn:x-cast:com.google.cast.debugoverlay', u'urn:x-cast:com.google.cast.broadcast', u'urn:x-cast:com.google.cast.media'], session_id=u'646faad2-3845-4571-a8c0-553924ffdfa4', transport_id=u'646faad2-3845-4571-a8c0-553924ffdfa4', status_text=u'Ready To Cast')

Remember to open pavucontrol and select the mkchromecast sink.

Ctrl-C to kill the application at any time

192.168.2.98 - - [03/Apr/2018 10:03:32] "GET /stream HTTP/1.1" 200 -
Killed

When i set subtitles on a video - doesn't play! mkchromecast --video -i "aVideo.mkv" --subtitles subs/aVideo.part1.srt

mkchromecast v0.3.7
video
PID of main process: 3625
PID of streaming process: 3629
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

List of Google Cast devices available in your network:
------------------------------------------------------
Index   Friendly name
=====   ============= 
0       my-room

We will cast to first device in the list above!
my-room

Information about  my-room

DeviceStatus(friendly_name=u'my-room', model_name=u'Chromecast', manufacturer=u'Google Inc.', api_version=(1, 0), uuid=UUID('8e1dc377-c7ac-b494-e257-e4c1bc935746'), cast_type='cast')

Status of device  my-room

CastStatus(is_active_input=False, is_stand_by=True, volume_level=1.0, volume_muted=False, app_id=u'E8C28D3C', display_name=u'Backdrop', namespaces=[u'urn:x-cast:com.google.cast.debugoverlay', u'urn:x-cast:com.google.cast.cac', u'urn:x-cast:com.google.cast.sse'], session_id=u'f823485f-88cd-4807-8013-3345c6ec0f73', transport_id=u'f823485f-88cd-4807-8013-3345c6ec0f73', status_text=u'')

The IP of my-room is: 192.168.2.98
Your local IP is: 192.168.2.10

The media type string used is: video/mp4

Cast media controller status

CastStatus(is_active_input=False, is_stand_by=True, volume_level=1.0, volume_muted=False, app_id=u'CC1AD845', display_name=u'Default Media Receiver', namespaces=[u'urn:x-cast:com.google.cast.debugoverlay', u'urn:x-cast:com.google.cast.broadcast', u'urn:x-cast:com.google.cast.media'], session_id=u'f3856f5b-b4c9-444e-84f6-3f9421cdd954', transport_id=u'f3856f5b-b4c9-444e-84f6-3f9421cdd954', status_text=u'Ready To Cast')

Remember to open pavucontrol and select the mkchromecast sink.

Ctrl-C to kill the application at any time

192.168.2.98 - - [03/Apr/2018 10:05:44] "GET /stream HTTP/1.1" 200 -
^CKilled

Why is this happening ? Details from the video file:

exiftool aVideo.mkv

ExifTool Version Number         : 10.40
File Name                       : aVideo.mkv
Directory                       : .
File Size                       : 6699 MB
File Modification Date/Time     : 2018:04:02 11:27:18+03:00
File Access Date/Time           : 2018:04:02 11:27:22+03:00
File Inode Change Date/Time     : 2018:04:02 11:27:18+03:00
File Permissions                : rwxrwxrwx
File Type                       : MKV
File Type Extension             : mkv
MIME Type                       : video/x-matroska
EBML Version                    : 1
EBML Read Version               : 1
Doc Type                        : matroska
Doc Type Version                : 4
Doc Type Read Version           : 2
Timecode Scale                  : 1 ms
Muxing App                      : libebml v1.3.1 + libmatroska v1.4.2
Writing App                     : mkvmerge v8.5.0 ('Vanishing Act') 64bit
Duration                        : 1:36:45
Date/Time Original              : 2016:03:29 12:55:24Z
Video Codec ID                  : V_MPEG4/ISO/AVC
Video Frame Rate                : 24
Image Width                     : 1440
Image Height                    : 1080
Display Width                   : 1440
Display Height                  : 1080
Track Number                    : 2
Track Type                      : Audio
Audio Codec ID                  : A_DTS
Default Duration                : 10.666667 ms
Track Language                  : und
Audio Sample Rate               : 48000
Audio Channels                  : 2
Image Size                      : 1440x1080
Megapixels                      : 1.6

or

mediainfo --fullscan aVideo.mkv

General
Count                                    : 322
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Unique ID                                : 186452427869445452680834204163260582253
Unique ID                                : 186452427869445452680834204163260582253 (0x8C456E7079D7192AB52C7BA71E6C896D)
Count of video streams                   : 1
Count of audio streams                   : 1
Video_Format_List                        : AVC
Video_Format_WithHint_List               : AVC
Codecs Video                             : AVC
Video_Language_List                      : English
Audio_Format_List                        : DTS
Audio_Format_WithHint_List               : DTS
Audio codecs                             : DTS
Audio_Language_List                      : English
Complete name                            : aVideo.mkv
File name                                : aVideo
File extension                           : mkv
Format                                   : Matroska
Format                                   : Matroska
Format/Url                               : http://packs.matroska.org/
Format/Extensions usually used           : mkv mk3d mka mks
Commercial name                          : Matroska
Format version                           : Version 4 / Version 2
Codec                                    : Matroska
Codec                                    : Matroska
Codec/Url                                : http://packs.matroska.org/
Codec/Extensions usually used            : mkv mk3d mka mks
File size                                : 7024321324
File size                                : 6.54 GiB
File size                                : 7 GiB
File size                                : 6.5 GiB
File size                                : 6.54 GiB
File size                                : 6.542 GiB
Duration                                 : 5805675
Duration                                 : 1 h 36 min
Duration                                 : 1 h 36 min 45 s 675 ms
Duration                                 : 1 h 36 min
Duration                                 : 01:36:45.675
Duration                                 : 01:36:45:16
Duration                                 : 01:36:45.675 (01:36:45:16)
Overall bit rate                         : 9679248
Overall bit rate                         : 9 679 kb/s
Frame rate                               : 24.000
Frame rate                               : 24.000 FPS
Frame count                              : 139336
Stream size                              : 1752789
Stream size                              : 1.67 MiB (0%)
Stream size                              : 2 MiB
Stream size                              : 1.7 MiB
Stream size                              : 1.67 MiB
Stream size                              : 1.672 MiB
Stream size                              : 1.67 MiB (0%)
Proportion of this stream                : 0.00025
Encoded date                             : UTC 2016-03-29 12:55:24
File last modification date              : UTC 2018-04-02 08:27:18
File last modification date (local)      : 2018-04-02 11:27:18
Writing application                      : mkvmerge v8.5.0 ('Vanishing Act') 64bit
Writing application                      : mkvmerge v8.5.0 ('Vanishing Act') 64bit
Writing library                          : libebml v1.3.1 + libmatroska v1.4.2
Writing library                          : libebml v1.3.1 + libmatroska v1.4.2

Video
Count                                    : 341
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 1
ID                                       : 1
Unique ID                                : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format/Url                               : http://developers.videolan.org/x264.html
Commercial name                          : AVC
Format profile                           : High@L4.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4
Format settings, ReFrames                : 4 frames
Internet media type                      : video/H264
Codec ID                                 : V_MPEG4/ISO/AVC
Codec ID/Url                             : http://ffdshow-tryout.sourceforge.net/
Codec                                    : V_MPEG4/ISO/AVC
Codec                                    : AVC
Codec/Family                             : AVC
Codec/Info                               : Advanced Video Codec
Codec/Url                                : http://ffdshow-tryout.sourceforge.net/
Codec profile                            : High@L4.1
Codec settings                           : CABAC / 4 Ref Frames
Codec settings, CABAC                    : Yes
Codec_Settings_RefFrames                 : 4
Duration                                 : 5805672.000000
Duration                                 : 1 h 36 min
Duration                                 : 1 h 36 min 45 s 672 ms
Duration                                 : 1 h 36 min
Duration                                 : 01:36:45.672
Duration                                 : 01:36:45:16
Duration                                 : 01:36:45.672 (01:36:45:16)
Bit rate                                 : 8909000
Bit rate                                 : 8 909 kb/s
Width                                    : 1440
Width                                    : 1 440 pixels
Height                                   : 1080
Height                                   : 1 080 pixels
Stored_Height                            : 1088
Sampled_Width                            : 1440
Sampled_Height                           : 1080
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.333
Display aspect ratio                     : 4:3
Frame rate mode                          : CFR
Frame rate mode                          : Constant
Frame rate                               : 24.000
Frame rate                               : 24.000 FPS
Frame count                              : 139336
Resolution                               : 8
Resolution                               : 8 bits
Colorimetry                              : 4:2:0
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 8
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan type                                : Progressive
Interlacement                            : PPF
Interlacement                            : Progressive
Bits/(Pixel*Frame)                       : 0.239
Delay                                    : 0
Delay                                    : 00:00:00.000
Delay, origin                            : Container
Delay, origin                            : Container
Stream size                              : 6465223703
Stream size                              : 6.02 GiB (92%)
Stream size                              : 6 GiB
Stream size                              : 6.0 GiB
Stream size                              : 6.02 GiB
Stream size                              : 6.021 GiB
Stream size                              : 6.02 GiB (92%)
Proportion of this stream                : 0.92041
Writing library                          : x264 - core 148 r2638 7599210
Writing library                          : x264 core 148 r2638 7599210
Encoded_Library_Name                     : x264
Encoded_Library_Version                  : core 148 r2638 7599210
Encoding settings                        : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=8 / 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=0 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / 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=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=8909 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Language                                 : en
Language                                 : English
Language                                 : English
Language                                 : en
Language                                 : eng
Language                                 : en
Default                                  : Yes
Default                                  : Yes
Forced                                   : No
Forced                                   : No

Audio
Count                                    : 279
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
StreamOrder                              : 1
ID                                       : 2
ID                                       : 2
Unique ID                                : 16574419564974736542
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Codec                                    : DTS
Codec                                    : DTS
Codec/Family                             : DTS
Duration                                 : 5805675.000000
Duration                                 : 1 h 36 min
Duration                                 : 1 h 36 min 45 s 675 ms
Duration                                 : 1 h 36 min
Duration                                 : 01:36:45.675
Duration                                 : 01:36:30:22
Duration                                 : 01:36:45.675 (01:36:30:22)
Bit rate mode                            : CBR
Bit rate mode                            : Constant
Bit rate                                 : 768000
Bit rate                                 : 768 kb/s
Channel(s)                               : 2
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Channel positions                        : 2/0/0.0
ChannelLayout                            : L R
Samples per frame                        : 512
Sampling rate                            : 48000
Sampling rate                            : 48.0 kHz
Samples count                            : 278672384
Frame rate                               : 93.750
Frame rate                               : 93.750 FPS (512 spf)
Frame count                              : 544282
Resolution                               : 16
Resolution                               : 16 bits
Bit depth                                : 16
Bit depth                                : 16 bits
Compression mode                         : Lossy
Compression mode                         : Lossy
Delay                                    : 0
Delay                                    : 00:00:00.000
Delay, origin                            : Container
Delay, origin                            : Container
Delay relative to video                  : 0
Delay relative to video                  : 00:00:00.000
Video0 delay                             : 0
Video0 delay                             : 00:00:00.000
Stream size                              : 557344832
Stream size                              : 532 MiB (8%)
Stream size                              : 532 MiB
Stream size                              : 532 MiB
Stream size                              : 532 MiB
Stream size                              : 531.5 MiB
Stream size                              : 532 MiB (8%)
Proportion of this stream                : 0.07935
Default                                  : Yes
Default                                  : Yes
Forced                                   : No
Forced                                   : No

Mkchromecast version : v0.3.7 Running on : Debian GNU/Linux 9.4 (stretch)

If I cast the video without subtitles, it all works perfectly!

muammar commented 6 years ago

Can you try the newest version to see if the problem is still there?

Tas-sos commented 6 years ago

Yes, I tried it. In my own use cases it did not work. I tried English subtitles in utf-8 encoding. I tested both Debian GNU/Linux 9.4 (stretch) and Ubuntu 16.04.4 LTS.

diogosimao commented 6 years ago

The same happens with me. Please, let me know if I may help sending some info from my environment.

Bonteruel commented 3 years ago

Hi. I experience the same problem. Unable to add subtitle with utf-8 caracter encoding. I'm able to play the tested videos without subtitles and work fine, and if the subtitle is in iso-8859-15 I only have to set the option with charenc and the subtitle works. The only thing that comes to my mind is try to change it from utf-8 to iso-8859-15, but this turn the procedure a little more complex.