2022-01-06, 22:04
I have a Kodi system running on Raspberry Pi3. It is used to show video files in mp4 format.
The files are stored in a directory tree on a 1TB hard drive and they change as time passes (downloaded news shows mainly).
So I am not using any library function, just the mp4 video files.
But I also want to be able to play video url's in real time on the Kodi system so I have added a streams dir where I have text files with extension .strm containing the stream url.
These url's are the same as I use for downloading with ffmpeg when the shows are saved for later viewing.
It turns out that for 2 of my video sources the m3u8 URL is all that is needed in the strm file for Kodi to play the stream in real time.
But the other sources, which work fine via ffmpeg, do not play at all on Kodi - an error message is shown only.
In my download scripts using ffmpeg I have used the following to get around this (-referer or -user_agent arguments):
VIDEOURL is the webpage on which the embedded video player resides
VIDEOSTR is the actual stream URL in m3u8 format
So my questions is are:
Can I somehow add an extra argument inside the strm file to make Kodi understand what to send to the source site as referer?
If so how is it done?
Or is there some other way to accomplish it?
The files are stored in a directory tree on a 1TB hard drive and they change as time passes (downloaded news shows mainly).
So I am not using any library function, just the mp4 video files.
But I also want to be able to play video url's in real time on the Kodi system so I have added a streams dir where I have text files with extension .strm containing the stream url.
These url's are the same as I use for downloading with ffmpeg when the shows are saved for later viewing.
It turns out that for 2 of my video sources the m3u8 URL is all that is needed in the strm file for Kodi to play the stream in real time.
But the other sources, which work fine via ffmpeg, do not play at all on Kodi - an error message is shown only.
In my download scripts using ffmpeg I have used the following to get around this (-referer or -user_agent arguments):
Code:
CMD="ffmpeg -hide_banner -referer \"${VIDEOURL}\" -i \"${VIDEOSTR}\" -vf scale=w=-4:h=480 -c:v libx264 -preset fast -crf 26 -c:a copy -t ${CAPTURETIME} ${TARGETFILE}"
or this:
CMD="ffmpeg -hide_banner -user_agent \"Mozilla\" -i $VIDEOSTR -vf scale=w=-4:h=360 -c:v libx264 -preset fast -crf 26 -c:a copy -t $CAPTURETIME $TARGETFILE"
VIDEOSTR is the actual stream URL in m3u8 format
So my questions is are:
Can I somehow add an extra argument inside the strm file to make Kodi understand what to send to the source site as referer?
If so how is it done?
Or is there some other way to accomplish it?