Open Disonantemus opened 1 year ago
Apologies, this transcode
command is not one I am 100% familiar with. Is the issue that the transcode command in the example is wrong, or that it doesn't work at all?
error: unable to transcode media: unable to change to appID "CC1AD845": context deadline exceeded
This is an annoying one. We need the Chromecast to be on the Default Receiver App to be able to cast to it, and it looks like it isn't working in this case. Does it work in general if you go go-chromecast load <file>
?
Yes, works with this:
go-chromecast --first load <file_x264_and_aac.mp4>
Maybe you can try a similar transcode 4 your device that works, then I can try that with mine, as an example.
I don't understand how transcode works. Please could anyone provide an example so I can play unplayable media on Chromecast?
By default, the go-chromecast load
command will transcode unplayable files by default. So if you want to let go-chromecast
handle that for you, then I suggest using the load
command.
The transcode
command is used when you want to do the transcoding manually, if the default behaviour in go-chromecast load
doesn't work, or you want something different then you can use go-chromecast transcode
, but you will need to know the command and arguments already. https://github.com/vishen/go-chromecast/blob/master/application/application.go#L1158-L1169 is the default command and arguments used. If you want to use something else then that could be a template to use.
/*
We can play media for the following:
- if we have a filename with a known content type
- if we have a filename, and a specified contentType
- if we have a filename with an unknown content type, and transcode is true
-
*/
I have a "Chromecast HD", the max resolution it can play is 1080p. This function treats 2160p files as not needing transcoding.
This is an issue worth fixing, I would be glad thankful if an example to the "transcode" command could be provided.
The transcode
command will take any arbitrary command and arguments you want. If you have an ffmpeg
command or similar that will transcode to stdout, then you can plug that directly into go-chromecast transcode
command. Using the example ffmpeg
command I provided above, that would look like:
$ go-chromecast transcode ffmpeg -re -i <filename> -vcodec h264 -acodec aac -ac 2 -f mp4 -movflags frag_keyframe+faststart -strict -experimental pipe:1
I should point out you forgot the "content-type" at the end
The command that worked for me is this one:
go-chromecast --first transcode --command "ffmpeg -i ${video_file} -c:v hevc_nvenc -c:a vorbis -ac 2 -vf scale=1920:-2,subtitles=${video_file}:stream_index=0:force_style=Fontname=LiberationSans -f matroska -movflags frag_keyframe+faststart -strict -2 pipe:1" --content-type "video/x-matroska"
Ah thanks, I forgot about that. Thanks for the working example. I think the --command
option is probably the better approach.
I've tried with no success to cast a file while transcoding. Target: Chromecast 3 | H.264 High Profile up to level 4.2
Shell script pull#71:
Output:
error: unable to transcode media: unable to change to appID "CC1AD845": context deadline exceeded
I've transcoded with success, using this ffmpeg shell script, that was the inspiration:
Resulting file cast no problem with:
OS: Arch Linux x86_64 Host: MS-7816 2.0 Kernel: 6.1.14-1-lts Resolution: 1920x1080 WM: dwm Terminal: tmux CPU: Intel i7-4790 (8) @ 3.600GHz GPU: AMD ATI Radeon RX 470/480/570/570X/580/580X/590 Memory: 2705MiB / 15939MiB