shimberger / gohls Goto Github PK
View Code? Open in Web Editor NEWA server that exposes a directory for video streaming via web interface
Home Page: https://shimberger.github.io/gohls/
License: Other
A server that exposes a directory for video streaming via web interface
Home Page: https://shimberger.github.io/gohls/
License: Other
I tried to run ./scripts/run_dev both script or line by line
go-bindata -debug -prefix ui/build ui/build/...
generates bindata.go file correctly
The serve boots up without any error. However when I tried to access http://localhost:8080/, server returns
404 page not found
Not found index.html
./debug.go:16: cannot use Debugger literal (type *Debugger) as type Debugger in assignment
Go packages usually don't use an underscore. So rename it to gohls.
There should be a flag to make ffmpeg use of HW acceleration.
Help wanted:) @shimberger
After running run_dev
, the terminal output success information as bellow:
# ./scripts/run_dev.sh serve /srv/go/gohls/videos
Path to ffmpeg executable: /srv/go/gohls/tools/ffmpeg
Path to ffprobe executable: /srv/go/gohls/tools/ffprobe
Home directory: /root/.gohls/
Serving videos in /srv/go/gohls/videos
Visit http://localhost:8080/
However when I visit the url, 302 was reutrn( hls runs inside docker image,and redirect 8080 to 127.0.0.1:6000)
aven-mac-pro-2:gohls aven$ curl -i 127.0.0.1:6000
HTTP/1.1 302 Found
Location: /ui/
Date: Fri, 24 Nov 2017 05:37:26 GMT
Content-Length: 27
Content-Type: text/html; charset=utf-8
<a href="/ui/">Found</a>.
I am seeing the below error when I access the application deployed in AWS Cloud:
ERRO[0153] Error handling request: Command failed exit status 1
2019/05/01 09:58:28 "GET http://xx.xx.xx.xx:8084/api/segments/720/0/5d8ddd858ba06700cf12fc90dca22043a837dc21/9f46ff0ffae869b3e009cc806209e2b6cd33e139 HTTP/1.1" from 106.51.20.48:24112 - 000 0B in 78.281254ms
Using the linux snapshot on ubuntu 16.04.
Downloading the video from the UI works completely fine but I can't play the video
Path to ffmpeg executable: /usr/local/bin/ffmpeg
Path to ffprobe executable: /usr/local/bin/ffprobe
HLS data directory: /home/stan/.gohls/
Visit http://localhost:8080/
ERRO[002] Error encoding Command failed exit status 1
ATM the project uses external JS and CSS files. This doesn't work offline. Fix it by bundling everything into a vendor.js at first.
The audio is sometimes choppy between segments.
For user running create a subfolder into ~/.cache
(e.g. ~/.cache/gohls
) and for global / run as service /var/cache/
.
But maybe somebody want to cange it into a folder of /tmp
... could you make it configurable ?
It would be nice to build a standalone binary using go-bindata and then publish binaries and releases. See:
https://golang.org/doc/install/source#environment
https://developer.github.com/v3/repos/releases/#create-a-release
https://github.com/jteeuwen/go-bindata
cd run build
maybe is:
npm run build
few issues
gohls does not detect new media in folder without restarting server for me.
ffmpeg supports , presets HLS encoding ,
ultrafast , superfast ,veryfast , faster, fast , medium – default preset, slow , slower, very slow
would be nice to have in the config these options. - for the speed encoding issue, it might be
better to try ultrafast encoding to HLS , this is a similar project in node
https://github.com/mifi/hls-vod , which i used in past, it does not have any buffering encoding
issue, might help you somehow.
encode multiple outputs in parallel 480,p 720p, 1080p, option to pick stream type.
detect srt subtitles in folder and convert to webvtt
detect subtitles inside MKV , encode together to HLS.
template options , view list, grid list ,
small admin panel to control deletion , server settings , encoding etc.
snapshots build by CI does not cotains the binary anymore.
Looks like the go-bindata
are missed on container.
log of CI under ./scripts/release_snapshot.sh:
./scripts/prep_release.sh: line 17: go-bindata: command not found
darwin
amd64
go: finding github.com/mitchellh/go-homedir v1.0.0
go: finding github.com/google/subcommands v0.0.0-20181012225330-46f0354f6315
go: finding github.com/sirupsen/logrus v1.2.0
go: finding github.com/davecgh/go-spew v1.1.1
go: finding github.com/stretchr/testify v1.2.2
go: finding github.com/stretchr/objx v0.1.1
go: finding github.com/konsorten/go-windows-terminal-sequences v1.0.1
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding golang.org/x/crypto v0.0.0-20180904163835-0709b304e793
go: finding golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33
go: downloading github.com/sirupsen/logrus v1.2.0
go: downloading github.com/mitchellh/go-homedir v1.0.0
go: downloading github.com/google/subcommands v0.0.0-20181012225330-46f0354f6315
go: downloading golang.org/x/crypto v0.0.0-20180904163835-0709b304e793
go: downloading golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33
# command-line-arguments
./http_singleasset.go:23:15: undefined: Asset
./http_singleasset.go:26:16: undefined: Asset
./
./LICENSE.txt
./README.md
Hi, i just followed the guide to setup an environment, all works fine but it doesn't work with chrome or firefox, only works in Safari. Besides the cpu consumption is high? is that a normal phenomenon?
macOS 10.12.1
Chrome: 54.0.2840.98 (64-bit)
firefox 45.5.1
safari: Version 10.0.1 (12602.2.14.0.7)
the page is all white, nothing there. i added ffmpeg in tools and ffprobe. go 1.3
go run *.go ~/mnt
Look into the following options:
Hallo,
I really like the overall design. But especially on mobile only one card layout can make list very long.
We could introduce a button which switches to a more compact view (with smaller fonts and double the columns).
What do you think about this idea?
I wanted try this service for a Docker service which can act as a VOD directory but.. the V4 linux amd64 tar.gz is missing in the latest release.
I downloaded the code as per instructions and did:
./scripts/run.sh
I get the below error:
internal/api/assets.go:2: running "go-bindata": exec: "go-bindata": executable file not found in $PATH
internal/fileindex/index_mem.go:191:2: undefined: logrus.Tracef
Hi,
great project first of all! 👍
While investigation current master I've realized in Save File Dialog after Download filename appears between ''
. I have a fix ready and would be happy to provide a PR if you like!
Cheers
midzer
gohls could not be used behind a HTTPS/TLS proxy, because it force the wrong schema here:
Line 46 in f6bf3dd
Hello,
I think it would be awesome if gohls can look into non-compressed archives (zip/rar) as well and do ffmpeg with its video on the fly.
What do you think about that?
Cya
midzer
The first frame plays but then it stops.
I tried to build this project on my own, ui package already run npm install
.
but whenever I run npm run build
, there's always something wrong.
> [email protected] build /usr/local/gocode/src/github.com/shimberger/gohls/ui
> react-scripts-ts build
Creating an optimized production build...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
ts-loader: Using [email protected] and /usr/local/gocode/src/github.com/shimberger/gohls/ui/tsconfig.prod.json
Failed to compile.
Module not found: Error: Can't resolve 'typeface-roboto' in '/usr/local/gocode/src/github.com/shimberger/gohls/ui/src/Components'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts-ts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mine/.npm/_logs/2018-08-05T08_31_13_682Z-debug.log
cannot find a way to solve it even after google it.
I'm not a nodejs or front coder, need help.
thanks
build github.com/shimberger/gohls: cannot load github.com/shimberger/gohls/internal/buildinfo: cannot find module providing package github.com/shimberger/gohls/internal/buildinfo
First of all, thank you for this amazing project. It is really elegant and informative especially about hls with ffmpeg. I was searching relentlessly on how to generate good (equal spaced) hls streams using ffmpeg. There is very little information on the web and the ffmpeg docs can be intimidating to a newbie. I have read through gohls source code and found answers to many questions.
Coming to the feature requests / improvements :
I see that 720p is hardcoded as default resolution. This can be probably be solved by following this guide along with a small change in parsing the api path.
Also I was wondering if dash could be implemented.
Please feel free to update the title as required.
This includes download instructions for the projects and also ffmpeg.
Hi,
while using current master code in development I reconed some files do no play properly:
Basically video.js
is throwing an error. After a long time of research (and moving to hls.js
meanwhile) I figured out it is because of our ffmpeg audio encoding.
I managed to fix it and want to show it to you in a PR. Is that okay?
Cheers
midzer
Is it possible to change the url in the frontend to serve from proper domain?
ffmpeg -i example.mp4 -c:v libx264 -crf 21 -preset veryfast -c:a aac -b:a 128k -ac 2 -f hls -hls_time 4 -hls_playlist_type event /mnt/stream.m3u8
There is quite a bit some old code in this project. Delete it.
$ md5sum gohls-windows-amd64-0.1.0.tar.gz
1f5d0a65cd4285beb22d856e292bb1c3 *gohls-windows-amd64-0.1.0.tar.gz
$ ./gohls.exe
bash: ./gohls.exe: cannot execute binary file: Exec format error
$ file gohls.exe
gohls.exe: Mach-O 64-bit x86_64 executable
Expected PE format.
Can you check the build script?
You could use media.ccc.de to get some multilingar media files for testing.
It currently doesn't work correctly.
MacBook Pro, MacOS 10.14
Run gohls serve <video_dir>, then open Firefox to http://localhost:8080
. When I click 'Download' button on video, Firefox open a new tab to http://localhost:8080/list
, not start a download process.
$ DEBUG=1 ./gohls serve v2
Path to ffmpeg executable: /usr/local/bin/ffmpeg
Path to ffprobe executable: /usr/local/bin/ffprobe
Home directory: v2/.gohls/
Serving videos in v2
Visit http://localhost:8080/
DEBU[0003] HTTP GET /api/list/20180929
DEBU[0003] Executing ffprobe for v2/20180929/bbzx_20180929150713_0.mp4
DEBU[0003] ffprobe for v2/20180929/bbzx_20180929150713_0.mp4 returned%!(EXTRA map[string]interface {}=map[format:map[filename:v2/20180929/bbzx_20180929150713_0.mp4 nb_programs:0 start_time:0.080000 size:4770310 bit_rate:831064 probe_score:100 tags:map[major_brand:isom minor_version:512 compatible_brands:isomiso2avc1mp41 title:MonitorSession encoder:Lavf58.12.100] nb_streams:1 format_name:mov,mp4,m4a,3gp,3g2,mj2 format_long_name:QuickTime / MOV duration:45.920000]])
DEBU[0003] Executing ffprobe for v2/20180929/bbzx_20180929232518_2.mp4
DEBU[0003] ffprobe for v2/20180929/bbzx_20180929232518_2.mp4 returned%!(EXTRA map[string]interface {}=map[format:map[start_time:0.000000 duration:40.720000 probe_score:100 tags:map[major_brand:isom minor_version:512 compatible_brands:isomiso2avc1mp41 title:MonitorSession encoder:Lavf58.12.100] filename:v2/20180929/bbzx_20180929232518_2.mp4 nb_streams:1 nb_programs:0 format_name:mov,mp4,m4a,3gp,3g2,mj2 format_long_name:QuickTime / MOV size:3917634 bit_rate:769672]])
DEBU[0003] HTTP GET /api/frame/20180929/bbzx_20180929150713_0.mp4
DEBU[0003] HTTP GET /api/frame/20180929/bbzx_20180929232518_2.mp4
DEBU[0006] HTTP GET /favicon.ico
DEBU[0006] HTTP GET /api/list/
DEBU[0006] HTTP GET /service-worker.js
DEBU[0007] HTTP GET /service-worker.js
When click 'Download' button, gohls print DEBU[0006] HTTP GET /api/list/
But when I use Chrome browser, it's OK, debug info like this:
DEBU[0053] HTTP GET /api/download/20180929/bbzx_20180929150713_0.mp4
If use wget, it is OK too:
$ wget http://localhost:8080/api/download/20180929/bbzx_20180929150713_0.mp4
--2018-10-16 14:54:19-- http://localhost:8080/api/download/20180929/bbzx_20180929150713_0.mp4
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4770310 (4.5M) [video/mp4]
Saving to: ‘bbzx_20180929150713_0.mp4’
bbzx_20180929150713 100%[===================>] 4.55M --.-KB/s in 0.02s
2018-10-16 14:54:19 (270 MB/s) - ‘bbzx_20180929150713_0.mp4’ saved [4770310/4770310]
And when I run gohls on linux, video file can be downloaded by Firefox or Chrome. This problem only appears on gohls for osx + Firefox browser.
Add a subcommand to clean all caches.
in project use videojs-contrib-hls to play hls ,
i think maybe videojs-contrib-hls version is too low, because i test the latest version of videojs-contrib-hls , it works well
If you want only a internal port (and maybe run a tls proxy in front of it):
Line 71 in 6005f1b
pls use a addr
parameter for it
I tried to build this project on my own.
But when I run npm run build, there's always something wrong.
YiqiangdeMacBook-Pro:gohls alai04$ ./scripts/prep_release.sh alai04
> [email protected] build /Users/alai04/go/src/github.com/shimberger/gohls/ui
> react-scripts-ts build
Creating an optimized production build...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
ts-loader: Using [email protected] and /Users/alai04/go/src/github.com/shimberger/gohls/ui/tsconfig.prod.json
No valid rules have been specified for JavaScript files
Failed to compile.
/Users/alai04/go/src/github.com/shimberger/gohls/node_modules/@types/react/index.d.ts
(2687,13): Subsequent property declarations must have the same type. Property 'a' must be of type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>', but here has type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>'.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts-ts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I guess it's issue of dependency, but I don't know how to solve it.
Thanks.
Good evening,
right now search bar overlaps title in top bar on mobile.
I am thinking of a way of how we can fix this. Maybe make it smaller in general and move its icon and placeholder text inside more to the left? In addition I would recommend right aligning the bar that it matches card container below.
Best regards
midzer
I am unable to play MKV files.
I serve the server like this and there is no unexpected output or error in the command line.
.\gohls serve -config config.json
Path to ffmpeg executable: C:\ffmpeg\bin\ffmpeg.exe
Path to ffprobe executable: C:\ffmpeg\bin\ffprobe.exe
HLS data directory: C:\Users\Techassi/.gohls/
Visit http://localhost:8080/
The only error I get is:
VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported.
and
Uncaught (in promise) DOMException: Failed to load because no supported source was found.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.