How can I play the last segment (.ts) of m3u8 on Chromecast? - Google Chromecast

I develop an Android app that plays live TV streams (HLS). So I have a link to .m3u8 file, that contains three links to another m3u8 files (for different BANDWIDTH), that have a list of chunks (.ts). Each chunk is a part of last 10 minutes of recorded TV stream.
Here is my code in sender app:
Code:
MediaMetadata movieMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MOVIE);
movieMetadata.putString("mediaType", "video");
movieMetadata.putString(MediaMetadata.KEY_TITLE, "some title");
movieMetadata.putString(MediaMetadata.KEY_SUBTITLE, "some subtitle");
MediaInfo mediaInfo = new MediaInfo.Builder("myurl.m3u8")
.setMetadata(movieMetadata)
.setMediaTracks(tracks)
.setStreamType(MediaInfo.STREAM_TYPE_LIVE)
.setContentType("application/x-mpegURL")
.build();
remoteMediaClient.load(mediaInfo, true);
The problem is that Default Receiver plays FIRST chunk, but has to play the LAST one as it is LIVE stream. This results in a 10-minute delay. I tried to set a specific position in method load(...) and use STREAM_TYPE_BUFFERED, but there is no effect. Any suggestions?

Related

[Q] Videos - convert audio only?

The galaxy tab manages to play back most videos, so converting is hardly ever needed. However, it doesn't seem to work with videos containing FLAC, DTS or OGG audio.
So anyway, i'm trying to find a way to batch convert files while copying over the video stream. Instead of wasting 10-15 minutes converting each video, each file could be done in less than a minute as only the audio would be converted.
Has anyone figured out a way to do this?
So far I've checked out Handbrake & MeGUI + a few more, but with no luck
Demux audio with YAMB, convert to 2ch aac, remux new audio with YAMB. Done in ~30 mins or less
Give Avidemux a try. can copy video, while recoding audio to differing container formats such as mkv,mp4, avi etc. Linux/Mac/BSD/Win versions available. I've used it frequently for converting the audio portions of files for playback on my xbox360.
Thanks will give those a try!
Still would prefer a batch way of doing it though >.<
Handbrake has a batch mode - just add the items to the queue by clicking "Add to Queue.
Don't know if you can set it to ignore any video processing - but with the queue how long it takes doesn't matter much, just let it run overnight with however many jobs you have.
Nevermind, I found a free program called Xmedia recode that does it very well

AVIA and MP4 on Chromecast

Hi all,
So I'm perplexed...
I am using the latest version of Avia along with my Chromecast and can succesfully cast local media.
Some of my mp4 videos work fine. Others bring up a message on the TV stating that Chromecast doesn't currently support this file type.
I cannot determine what makes some MP4 files work and others not...
Anyone else run into this/have a fix?
h20wakebum said:
Hi all,
So I'm perplexed...
I am using the latest version of Avia along with my Chromecast and can succesfully cast local media.
Some of my mp4 videos work fine. Others bring up a message on the TV stating that Chromecast doesn't currently support this file type.
I cannot determine what makes some MP4 files work and others not...
Anyone else run into this/have a fix?
Click to expand...
Click to collapse
has to be H.264
download a program like Handbrake and convert them
That's correct, the video has to be h264 and audio must be AAC.
unr said:
That's correct, the video has to be h264 and audio must be AAC.
Click to expand...
Click to collapse
AAC or MP3
All three conditions must be met
MP4 container aka .MP4
H264 Video Codec
AAC or MP3 Audio Codec
The CCast will also play VP8 Video Codec but VP8 is really just a licence free version of H264 right now...They are practically identical.
Sweet, thanks guys!
Now I'll just make sure the torrents match those specs!
h20wakebum said:
Sweet, thanks guys!
Now I'll just make sure the torrents match those specs!
Click to expand...
Click to collapse
You will be better off getting yourself a good Video Converter you like because most Torrents are in MKV format and don't always note what codecs are being used.
Handbrake is a very good (FREE) program but can be a bit daunting for anyone who is inexperienced with encoder settings.
I use Xilisoft's Video Converter because it is pretty simple, Easy to Operate and makes doing Batches of Files a snap.
But it is a paid app.
I sure have never regretted paying for it I use it for just about all my Library conversions and only use Handbrake or VLC whenever Xilisoft chokes on a file which is usually because of a bad file not the programs inability to convert that format.
Handbrake settings
I have encoded my mp4 file 4 different ways and I still cant get it to cast. Other files work fine. I have researched what settings are supported by Chromecast by searching for "chromecast video formats" (I cant post a link). Attached are the settings that I think are the closest in Handbrake but still have no luck. Any ideas?
Set a specific bitrate, preferrably 4 Mbps (4000 Kbps) to start.
Check large file size and web optimized
Sent from my Nexus 7 using Tapatalk
---------- Post added at 03:47 AM ---------- Previous post was at 03:46 AM ----------
That's the only issue I see
Sent from my Nexus 7 using Tapatalk
Asphyx said:
All three conditions must be met
MP4 container aka .MP4
H264 Video Codec
AAC or MP3 Audio Codec
Click to expand...
Click to collapse
I'm using MediaInfo to check the codecs in my files, but it's a laborious process to go through each one manually. Is there a way to scan a whole directory of video files and then list the results?
codified said:
I'm using MediaInfo to check the codecs in my files, but it's a laborious process to go through each one manually. Is there a way to scan a whole directory of video files and then list the results?
Click to expand...
Click to collapse
I'm sure there is some program that does it but I can't name any....
I avoid the issue altogether by running a media server that transcodes it to whatever the device is capable and not just the CCast either.
I would check out Plex and Bubble....
codified said:
I'm using MediaInfo to check the codecs in my files, but it's a laborious process to go through each one manually. Is there a way to scan a whole directory of video files and then list the results?
Click to expand...
Click to collapse
Use the CLI (command line interface) version of MediaInfo.
Here's a quick batch file I put together. It may be glitchy, but should work, as it's based off another batch processor I've been working on for a while.
It assumes your structure contains a single level of subfolders, for example:
D:\My Videos\Foo the Epic\Foo1x01.mp4
D:\My Videos\Foo the Epic\Foo1x02.avi
...
D:\My Videos\Foo the Epic\Foo1x12.divx
D:\My Videos\Bar the Final\Bar1x01.mov
D:\My Videos\Bar the Final\Bar0x02.qt
...
D:\My Videos\Bar the Final\Bar0x10.avi
You would point MediaInfoBatch at "D:\My Videos" and set a logfile name like MyVideos.txt
MediaInfoBatch "D:\My Videos" MyVideos.txt
Note double-quoted path as it contains spaces. Double-quoting is also necessary if it contains ampersands. It doesn't hurt to just double-quote it anyway.
Save as MediaInfoBatch.bat (or whatever you want, but then you'll have to change the syntax text).
Easiest to throw it into the same folder as the CLI mediainfo.exe
Code:
@echo off
rem MediaInfoBatch
rem -------------
rem Runs command line interface (CLI) mediainfo on each file in each subfolder of the specified location
rem First parameter should be target directory, enclosed in double-quotes if there are spaces or ampersands within
rem Assumes files are in subfolders within the target, ie D:\Movies\Title1\file1 ... D:\Movies\Title20\file30
rem should be executed as MediaInfoBatch.bat D:\Movies
rem Second parameter should be filepath for logfile, enclosed in double-quotes if there are spaces or ampersands within
rem Check for proper command line
IF %1a==a GOTO syntax
IF %2a==a GOTO syntax
rem Remove double-quotes in parameter
set tmp_MediaInfoBatch_Target_raw=%1
set tmp_MediaInfoBatch_Target=%tmp_MediaInfoBatch_Target_raw:"=%
set tmp_MediaInfoBatch_Logfile_raw=%2
set tmp_MediaInfoBatch_Logfile=%tmp_MediaInfoBatch_Logfile_raw:"=%
GOTO check_prereqs
:syntax
echo MediaInfo Batch processor
echo -------------------------
echo Syntax: MediaInfoBatch [path] [logfile]
echo Where
echo [path] is root path to *folders* to be processed.
echo Do NOT include trailing backslash.
echo Ex: C:\MyVideos
echo [logfile] is filepath for logfile to contain output.
echo Ex: C:\MyVideos\MediaInfo.txt
echo Enclose any paths with spaces or ampersands in double-quotes.
echo Ex: "C:\My Videos"
echo Example:
echo MediaInfoBatch C:\MyVideos C:\MyVideos\MediaInfo.txt
echo will run MediaInfo on all files in the first level of directories
echo under C:\MyVideos and write the output to C:\MediaInfo.txt
pause
GOTO end
:check_prereqs
IF NOT EXIST MediaInfo.exe (
echo MediaInfo.exe is missing. We need the Command Line Interface version of MediaInfo. Please put it in the same directory as this batch file.
pause
GOTO end
)
GOTO main
:main
rem Look in target location
FOR /f "tokens=* usebackq" %%G IN (`dir /b /a:d "%tmp_MediaInfoBatch_Target%"`) DO (
rem Interate through subfolders
FOR /f "tokens=* usebackq" %%H IN (`dir /b /a:-d "%tmp_MediaInfoBatch_Target%\%%G"`) DO (
rem Run mediainfo on each file
mediainfo -f "%tmp_MediaInfoBatch_Target%\%%G\%%H" >>"%tmp_MediaInfoBatch_Logfile%"
)
)
:end
Hello,
I have uninstalled Avia and have started using LocalCast. It plays MKV files effortlessly! No conversion is needed at all!
All the best!
Also had this problem, avia not casting mp4. Downloaded Real Player and it fired up the mp4 perfectly.
Sent from my SM-N900V using Tapatalk
Chromecast has limitation in the input formats. Only video containers MP4 and WebM encoded with Video codecs H.264 High Profile Level 4.1, 4.2 and 5, VP8 and audio codecs HE-AAC, LC-AAC, CELT/Opus, MP3, Vorbis are compatible with Chromecast.
When send local media which are with extensions .mp4 or .webm through Chromecast to TV, it succeeded in most cases but sometimes failed. That is because MP4 and WebM, as video container, contain different video or audio codecs which Chromecast doesn't recognize.
I used to use a little piece of software called Faasoft Video Converter to convert MP4, AVI and other various video formats to Chromecast compatible formats, happy with it.
Actually, you can basically drag and drop the video files into Chrome browser and Chromecast from there. The point here is, you can do so on video types such as MP4; however, you probably will find difficulty doing the same on other video formats like MKV, VOB, AVI. All we need to get done is to make the MKV, VOB, AVI videos play inside the Chrome browser by some third party programs, like Brorsoft Video Converter.
Wondershare Ultimate Video convert - set video to H.264. Software has a beast mode and can convert H.265 but the compression rate sucks. Not a lot of bells and whistles but simple conversation and done quickly.
There's bubbleupnp, install the server and it will convert on the fly.
Plex is an oldy but a goodie. The plex media server coupled with the app does all conversation on the fly to play pretty much any media to any receiver.
Correct me if I'm wrong, but aren't most dl's mp4 and not mkv's? It's VERY common to see mp4, semi rare for mkv - though usually reserved for hi def minus yify, and super rare for avi's as technically avi files can be nuked as it no longer fits the scenes standard. That's my experience anyway.

Streaming to Chromecast with VLC+VidCast (dirty method)

Theory: VLC + Vidcast can replace Fling(+vlc)
Requirements: VLC 2.1.3 or newer + Chrome/Chromium
Proper solution is in the second post made by author of original idea.
My theory didn't work out so it's hidden.
I am not sure if we all are on the verge of a breakthrough or I just got trolled.
1. open VLC
2. Media>Stream... (or CTRL+S)
3. in Open Media/File window click ADD button, select file to play and click open
4. at the bottom of Open Media/File window press STREAM button
5. in Stream output/source click Next>
6. in Stream output/Destination setup pick HTTP and press ADD
7. Change Path /stream
8. Here is THE TRICKY PART - Stream output select profile edition create VP8 profile with or without audio or Video VP80 + Vorbis - (Webm) or H264 + MP3 (MP4)
9. Next>
10. Stream output/Options setup/Generated stream output string - here you may correct all previous mistakes or tweak output setting -
11. Click stream
use dabble me on address
Code:
https://dabble.me/cast/?video_link=http://YOUR IP HERE:8080/stream
example:
https://dabble.me/cast/?video_link=http://192.168.1.2:8080/stream
In theory it should work. In my case it does not. Read two quotes below and maybe help to figure it out
Step 10. is very similar to fling config.properties transcoding.parameters - for vlc command line
Code:
#Thu Feb 20 00:0000 GMT 2014
manual.servers=
transcoding.extensions=wmv,avi,mkv,mpg,mpeg,flv,3gp,ogm
transcoding.parameters=vcodec\=VP80,vb\=1000,vfilter\=canvas{width\=640,height\=360},acodec\=vorb,ab\=128,channels\=2,samplerate\=44100,threads\=2
Maybe we should use output format format like for dabble.me dst=:8080/test.mp4 or 8080/test.webm ?
How to stream in VLC - from VLC wiki.It's just worth reading.
https://wiki.videolan.org/Documentation:Streaming_HowTo_New
Old vlc streaming guide.
https://wiki.videolan.org/Documentation:Streaming_HowTo/
Transcoding.
https://wiki.videolan.org/Transcode/
VLC cli.
http://www.videolan.org/doc/vlc-user-guide/en/ch04.html
sources:
[–]asjmcguire 2 points 8 hours ago
You just do it yourself! Open VLC, load whatever the video is, click on the Save / Convert next to open, change it to stream, choose HTTP, click the "+" and make it port 8080 and a path of "/stream" click next, choose to transcode to VP8 (I haven't been able to get MP4 to work), start the stream. Now use the VidCast bookmarklet to load a vimeo video, change the url so ?video_link= reads "video_link=http://<the ip of the computer VLC is running on>:8080/stream" eg: "video_link=http://192.168.2.201:8080/stream" and then hit enter, it will load the stream VLC is outputting and then send it to your chromecast.
Click to expand...
Click to collapse
[–]asjmcguire 3 points 6 days ago
I did a test with this, I opened VLC, told it to open my webcam, selected to stream it, added HTTP as an output (port 8080, path /stream), told it to transcode to VP8 and then used the vidcast bookmarklet to load a vimeo stream, changed the URL in the address bar to point to http://<my local ip>:8080/stream and the vidcast player loaded the webcam stream from VLC and sent it to the Chromecast without issues (actually, there was an issue, I had to deselect the audio transcoding or the video wouldn't play). So proof of concept is there. I then tried it with various video files, which works but again only if I deselect the audio stream. H264 transcoding doesn't work - I suspect because the profile is wrong. So in short - it is doable. This would ALL be up to the creators of VLC it has nothing at all to do with Google.
Click to expand...
Click to collapse
http://www.reddit.com/r/Chromecast/comments/1ybzw3/chromecast_video_a_chrome_app_that_streams_local/
http://www.reddit.com/r/Chromecast/comments/1xn8gs/vlc_cant_easily_support_chromecast/
I managed to get Buffy S1E1 to play, but badly, I wasn't sure if it was a Chromecast issue, a laptop issue, a WiFi issue or a transcoding issue.
But this is how I first got VLC to work (using the built in webcam on my laptop):
Open VLC
Click - Media > Stream
Click - Capture Device
Choose Webcam in Video Source
Choose microphone in Audio Source
Click Stream and then Next
New Destination > HTTP and click the "Add" button
Type 8080 in the port box and use a path of "/stream" - I haven't been able to get it to work with a path of "/"
Hit Next
Check - Activate Transcoding
Change Profile to "Video - VP80 + Vorbis (Webm)"
If it doesn't work first time, at this stage click the "Edit" button for the profile, and deselect audio
Click to expand...
Click to collapse
Click Next and then click Stream
Now visit a VidCast compatible video like http://vimeo.com/29965463
Click the Bookmarklet to get a page like https://dabble.me/cast/?video_link=...a2a&aksessionid=34ce303449007f35&ns=4
Now change video_link in the URL to the LOCAL IP of the computer VLC is running on - eg:
https://dabble.me/cast/?video_link=http://192.168.2.201:8080/stream%3Ftoken2%3D1392993272_f784bc55b54fad7659173983621dba2a%26amp%3Baksessionid%3D34ce303449007f35%26amp%3Bns%3D4
Next fix some other parts of the URL (it WILL NOT work if the token is not valid)
https://dabble.me/cast/?video_link=http://192.168.2.201:8080/stream&token=D1392993272_f784bc55b54fad7659173983621dba2a%26amp%3Baksessionid%3D34ce303449007f35%26amp%3Bns%3D4
You should now be able to stream your webcam to the Chromecast.
work without audio
Hi.
It works for, only if I deselect the audio codec...but then i've no sound )-:
There is something to do about this?
Thank you.

[Help] Audio out of sync with recorded video when playing on computer

Hey all,
I am using a Droid Turbo XT1254 Android 5.1 with kernel 3.10.40;
I recorded an HD(720p) video of a buddies proposal and I would like to edit it for him as it looks really great!
The problem is when I export the video out and plug it into video editing software on my computer, the audio loses sync with the video and is near impossible to fix. Has anyone else had this issue and is there any known work around?
I'm very worried that this video was all for not.
Thank you!
-PDAtric
pdatric said:
Hey all,
I am using a Droid Turbo XT1254 Android 5.1 with kernel 3.10.40;
I recorded an HD(720p) video of a buddies proposal and I would like to edit it for him as it looks really great!
The problem is when I export the video out and plug it into video editing software on my computer, the audio loses sync with the video and is near impossible to fix. Has anyone else had this issue and is there any known work around?
I'm very worried that this video was all for not.
Thank you!
-PDAtric
Click to expand...
Click to collapse
Does the audio become more increasingly out of sync (2 seconds, 3 seconds, 4 seconds) or is it consistently a set amount (like 1 second) the entire clip?
Have you only tried to play it on one piece of software? Drag the video to your desktop, click on it and play it with WMP, VLC, Media Player Classic, etc. When you play it normally in Windows Media Player, VLC or any of the other free dozens of media players, does it play OK? If so, then your video editing software is to blame. It's not a "phone" issue, it's your video editing software.
If it's out of sync even when playing it with a computer program video player -- not your video editing software but WMP, VLC, Media Player Classic, etc -- there's still ways to fix it.
1) If it's any good, your video editing software will have audio sync options. That's a standard task in editing video, to fix audio lag called "lip sync" issue.
2) you can always re-edit the audio -- just like you would with a piece of music you might want to start at a certain point. (if it's consistent in the amount it's out of sync). You would just edit the audio track to be offset by the amount of time you wish.
3) try another video editing software.
ChazzMatt said:
Does the audio become more increasingly out of sync (2 seconds, 3 seconds, 4 seconds) or is it consistently a set amount (like 1 second) the entire clip?
Have you only tried to play it on one piece of software? Drag the video to your desktop, click on it and play it with WMP, VLC, Media Player Classic, etc. When you play it normally in Windows Media Player, VLC or any of the other free dozens of media players, does it play OK? If so, then your video editing software is to blame. It's not a "phone" issue, it's your video editing software.
If it's out of sync even when playing it with a computer program video player -- not your video editing software but WMP, VLC, Media Player Classic, etc -- there's still ways to fix it.
1) If it's any good, your video editing software will have audio sync options. That's a standard task in editing video, to fix audio lag called "lip sync" issue.
2) you can always re-edit the audio -- just like you would with a piece of music you might want to start at a certain point. (if it's consistent in the amount it's out of sync). You would just edit the audio track to be offset by the amount of time you wish.
3) try another video editing software.
Click to expand...
Click to collapse
Thanks for your response!
The audio becomes increasingly out of sync as the video goes on. I was using adobe premiere pro as well, I did try to re-edit the audio back in to sync up with the video, however because the rate of change is increasing throughout the video, it is near impossible to line things up correctly.
I will try another video editing software tonight, do you have any suggestions? I just need to have the video playing with a smaller video playing(Picture in picture style).
Is this a known problem or have you never experienced this?
Thanks!
I was hoping it was a simple, constant value for the delay.
I was also hoping it could be repeated using any video player ( which would mean the problem was actually with the file, not the editing software). In which case I was going to suggest something like this:
http://www.hecticgeek.com/2013/02/fix-audio-video-sync-save-permanently-avidemux/
You still haven't said whether it plays fine in other video players (not editing software, just players).
But the increasing variability of the time worries me.
To give you an analogy, when I add subtitles file to a TV show or movie, if one is PAL (25 frames per second) and the other is NTSC (29.97 frames per second), then the subtitles will be increasingly out of sync the further into the file as it plays.
I have software that will let me do a "visual sync", but that doesn't work if the rates are not the same.
That's just an analogy, because your audio/video shouldn't be on two different standards like that.
So, I'm curious, when you play it with VLC (free) or Classic Video Player (part of the K-LITE Mega Codec Package (free), is the video/audio out of sync?
If it plays fine in another video player, then there's just some messed up setting in your Adobe editor.

Adding audio stream to Chromecast backdrop

I have a Google Chromecast and leave it running backdrop on my TV when otherwise not in use. At other times I cast streaming radio to it from my linux system via the stream2chromecast python script. This works, but replaces the backdrop with an otherwise blank screen with "Default Media Receiver" in the upper left.
I would prefer to have the backdrop continue to display while streaming radio to it. The most logical way to do so would be for the backdrop function to be enhanced to include an audio backdrop that could be specified by the user from the home app or other program. Should there be no way to accomplish this, the next best would be to replicate the backdrop function in the stream2chromecast python script to be optionally enabled if no video is being streamed.
Anyone have any thoughts on how this can be accomplished?
Dave

Categories

Resources