Is it possible to have a custom chapters file for each link/file in a playlist file in MPV? - playlist

I would like to load a playlist file that contains YouTube URLs in MPV. Like this:
playlists.txt
https://www.youtube.com/watch?v=86cQJ0MMses
https://www.youtube.com/watch?v=s22eJ1eVLTU
And one or multiple chapters file:
chapters.txt
;FFMETADATA1
[CHAPTER]
TIMEBASE=1/60
START=0
END=300
title=Introduction
[CHAPTER]
TIMEBASE=1/60
START=300
END=6000
title=Rest of the video
Playing the playlist like this
mpv --playlist=playlist.txt --chapters-file=chapters.txt
The same chapters are shown for both videos. Is it possible to have different chapters for each video in the playlist?

Related

How can I get video source from movie website

I want extract video source for example for this movie.
https://www.cda.pl/video/53956781/vfilm
There are hidden video sources. And there is something like security steps to unable do it.
I opened it in firefox with Video Download Helper and I got:
headers
[...
]
id
network-probe:5f8a4b2c
isPrivate
false
length
831760944
pageUrl
https://www.cda.pl/video/53956781/vfilm
referrer
https://www.cda.pl/video/53956781/vfilm
running
0
status
active
tabId
36
thumbnailUrl
https://icdn.2cda.pl/vid/premium/539567/frames/620x365/e86f6548543225cf0f1b61f1e9d730be.jpg
title
Istnienie (2013) Lektor PL 720p - CDA
topUrl
https://www.cda.pl/video/53956781/vfilm
type
video
url
https://vwaw607.cda.pl/539567/v_lq_lq5250559bd547af6bad2eb78dacaf5df4.mp4
urlFilename
v_lq_lq5250559bd547af6bad2eb78dacaf5df4
So there is an video source but If I go to https://vwaw607.cda.pl/539567/v_lq_lq5250559bd547af6bad2eb78dacaf5df4.mp4
it says video cannot be loaded. File is damaged
Could you give me an idea how to extract video url. Thanks

VLC Playlist / plugin .lua - to load .srt from url

I want to play subtitles from url.
I tried creating an .m3u playlist, but the subtitle doesn't load:
http://localhost:1111/1.srt
http://localhost:1111/1.mkv
Can VLC load a subtitle (url) from inside the playlist?
If not, I'm thinking of creating a .lua plugin for VLC to search the playlist for "http" access & ".srt" string.
If found I want to Download & use it.
I never created a VLC Plugin... Any help would be awesome...
I did a work around index.php(list files in dir) + javascript(to download files):
download subtitle CoolVideo.srt (if subtitle exists)
generate & download stream.m3u (+ subtitle if exists)
stream.m3u + Subtitle content:
#EXTM3U
#EXTINF:-1,STREAM: Cool Video Name
#EXTVLCOPT:sub-file=CoolVideo.srt
#EXTVLCOPT:subsdec-encoding=System Default
#EXTVLCOPT:subsdec-align=0
#EXTVLCOPT:freetype-rel-fontsize=16
#EXTVLCOPT:sub-fps=0
#EXTVLCOPT:sub-delay=0
http://localhost:1111/CoolVideo.mkv
stream.m3u (No Subtitle) content:
#EXTM3U
#EXTINF:-1,STREAM: Cool Video Name
http://localhost:1111/CoolVideo.mkv
INFO stream.m3u:
It's best to use encodeURI("http://localhost:1111/CoolVideo.mkv"); for the video path just in case it contains empty spaces or other characters, otherwise VLC will not open the stream.
Because stream.m3u is in the same folder as CoolVideo.srt, VLC will load the subtitle
Open the stream.m3u on PC, & enjoy almost any video format :)
BUGS: The subtitle does not auto load on Android

"Playlist vs segment duration mismatch" with HLS Streaming ts file

I made a service which record a movie on iOS and publish it to the server. The server divides the stream to the multiple ts files. And by using these files, I make a m3u8 file and publish this file to the client.
However, mediastreamvalidator says that some ts files are invalid though I can play these ts files on Quick Time after I download these files.
Following is the output of the mediastreamvalidator
Error: Playlist vs segment duration mismatch
--> Detail: Segment duration 0.0000, Playlist duration: 12.0900
--> Source: https://***.com/media/*** - https://storage.googleapis.com/***27.ts
--> Detail: Segment duration 0.0000, Playlist duration: 12.0900
--> Source: https://***.com/media/*** - https://storage.googleapis.com/***29.ts
I googled the error that "Error: Playlist vs segment duration mismatch" but there seems to be no answers.
Could you tell me the way to solve this error?
Thanks.
Your segments may have discontinuities between them. If so you will need to enter the tag #EXT-X-DISCONTINUITY between them. The HLS spec specifies that you need to mark discontinuities in the following scenarios:
file format
number, type, and identifiers of tracks
timestamp sequence
See Section 4.3.2.3: https://www.rfc-editor.org/rfc/rfc8216

VLC only plays some last segments of m3u8 file?

Here I have a manifest: index.m3u8 and 12 segments. My problem is that VLC player only play the last 5 segments in the manifest. This is my manifest:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TARGETDURATION:18
#EXTINF:12.960,
sample-0.ts
#EXTINF:10.640,
sample-1.ts
#EXTINF:18.440,
sample-2.ts
#EXTINF:10.000,
sample-3.ts
#EXTINF:12.920,
sample-4.ts
#EXTINF:10.800,
sample-5.ts
#EXTINF:13.400,
sample-6.ts
#EXTINF:12.240,
sample-7.ts
#EXTINF:11.720,
sample-8.ts
#EXTINF:15.320,
sample-9.ts
#EXTINF:13.200,
sample-10.ts
#EXTINF:10.480,
sample-11.ts
#EXTINF:11.800,
sample-12.ts
With this manifest, VLC plays from sample-8.ts. I tried to pull out some segment, leave sample-0.ts -> sample-7.ts, then VLC plays from sample-3.ts. What wrong with my manifest? Your help is very much appreciated.
You need to add the #EXT-X-ENDLIST tag to the end of the playlist, assuming you want it to start from the beginning. Without the end tag the player assumes it's a live playlist, which explains the behaviour you are seeing. You should also set the playlist type, e.g. #EXT-X-PLAYLIST-TYPE:VOD.

AVPlayer HLS .m3u8 - could not select audio, subtitle track

I have an issue:
I have m3u8 file format such as:
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=490000,RESOLUTION=640x360
http://XXX.XXX.XX.XXX:31213/MEDIA/76336503.....583609776254/161/4161/
#EXT-X-STREAM-INF:BANDWIDTH=1500000,RESOLUTION=720x576
http://XXX.XXX.XX.XXX:31213/MEDIA/76336503.....583609776254/161/3161/
#EXT-X-STREAM-INF:BANDWIDTH=2500000,RESOLUTION=1280x720
http://XXX.XXX.XX.XXX:31213/MEDIA/76336503.....583609776254/161/2161/
Each EXT-X-STREAM-INF tag link to file like:
#EXTM3U
#EXT-X-TARGETDURATION:5
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:35156
#EXT-X-START:TIME-OFFSET=-25,PRECISE=YES
#EXT-X-KEY:METHOD=AES-128,URI="http://XXX.XXX.XX.XXX:02444/xxXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/191/2191/aeskey_191_
#EXTINF:5,
http://XXX.XXX.XX.XXX:XXXXX/SSEGMENT/3020314583628416652818934133893/191/2191/seg_XXXXX.ts
#EXTINF:5,
http://XXX.XXX.XX.XXX:XXXXX/SSEGMENT/6545456465456456465454564/191/2191/seg_191_XXXXX.ts
#EXTINF:5,
http://XXX.XXX.XX.XXX:XXXXX/SSEGMENT/6545456465456456465454564/191/2191/seg_191_XXXXX.ts
#EXTINF:5,
http://XXX.XXX.XX.XXX:XXXXX/SSEGMENT/6545456465456456465454564/191/2191/seg_191_XXXXX.ts
#EXTINF:5,
http://XXX.XXX.XX.XXX:XXXXX/SSEGMENT/6545456465456456465454564/191/2191/seg_191_XXXXX.ts
Audio and subtitles are embeded in TS file. Since audio/subtitle tracks are not explicitly described in #EXT tag in the above *.m3u8 file, 'mediaSelectionGroupForMediaCharacteristic' returns empty options collection.
In opposite, m3u8 file:
https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8
provided by Apple as an HLS playlist example, has audio/subtitle tracks described in #EXT tags:
#EXTM3U
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="eng",NAME="BipBop Audio 1",AUTOSELECT=YES,DEFAULT=YES
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="eng",NAME="BipBop Audio 2",AUTOSELECT=NO,DEFAULT=NO,URI="alternate_audio_aac_sinewave/prog_index.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="en",CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog, public.accessibility.describes-music-and-sound",URI="subtitles/eng/prog_index.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English (Forced)",DEFAULT=NO,AUTOSELECT=NO,FORCED=YES,LANGUAGE="en",URI="subtitles/eng_forced/prog_index.m3u8"
This time 'mediaSelectionGroupForMediaCharacteristic' returns a collection which includes two audio options, which I can select successfully.
THE QUESTION: Is there a way for AVPlayer to select audio/subtitle track, if they are not described in #EXT tag inside *.m3u8 file, but embedded within *.ts files? Thanks ahead, any suggestions are appreciated!

Resources