Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove ffmpeg absolute path #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

brownchow
Copy link

@brownchow brownchow commented Dec 22, 2020

Hi slaveofcode:

when we use exec.Command("ffmpeg", "-i", "inputfile", "-vcodec", "copy", "-acodec", "copy", "outputfile"), we don't need to specified the absolute path of ffmpeg, just use "ffmpeg", is works fine, in most OS, when we install ffmpeg, it's executable path will be added to PATH vaeiable automaticlly. so I remove ffmpegPathBin config. and recompile the code with go build ., run it, it works fine.

./voodio.exe  -tmdb-key mytmdbkey --port 8080    -path   D:\\videos
INFO[22-Dec-2020 18:42:27] Obsolete DB detected, removing...
INFO[22-Dec-2020 18:42:27] DB initialized at C:\Users\myname\AppData\Local\voodioapp\voodio.db
INFO[22-Dec-2020 18:42:27] Preparing database...
INFO[22-Dec-2020 18:42:27] Database prepared
INFO[22-Dec-2020 18:42:27] Scanning movies...
INFO[22-Dec-2020 18:42:27] Scanning movies finished
INFO[22-Dec-2020 18:42:27] Activate API Server
INFO[22-Dec-2020 18:42:27] Server is alive
INFO[22-Dec-2020 18:42:27] http://mybublicip:8080
INFO[22-Dec-2020 18:42:27] http://myinternalip:8080
INFO[22-Dec-2020 18:42:27] http://myinternalip:8080
INFO[22-Dec-2020 18:42:27] http://127.0.0.1:8080
DEBU[22-Dec-2020 18:42:45] reso [360p 480p 720p 1080p]
DEBU[22-Dec-2020 18:42:45] generated reso map[1080p:0x1134f60 360p:0x11348a0 480p:0x1134ae0 720p:0x1134d20]
DEBU[22-Dec-2020 18:42:45] #EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360
360p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1400000,RESOLUTION=842x480
480p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2800000,RESOLUTION=1280x720
720p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=5000000,RESOLUTION=1920x1080
1080p.m3u8
INFO[22-Dec-2020 18:42:45] Exec: ffmpeg -hide_banner -y -i D:\videos\x.mp4 -vf scale=trunc(oh*a/2)*2:1080 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 10 -hls_playlist_type vod -b:v 5000k -maxrate 5350k -bufsize 7500k -b:a 192k -preset ultrafast -hls_segment_filename C:\Users\myname\AppData\Local\voodioapp\generated_hls\2\1080p_%03d.ts C:\Users\myname\AppData\Local\voodioapp\generated_hls\2\1080p.m3u8
INFO[22-Dec-2020 18:42:45] Exec: ffmpeg -hide_banner -y -i D:\videos\x.mp4 -vf scale=trunc(oh*a/2)*2:480 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 10 -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -preset ultrafast -hls_segment_filename C:\Users\myname\AppData\Local\voodioapp\generated_hls\2\480p_%03d.ts C:\Users\myname\AppData\Local\voodioapp\generated_hls\2\480p.m3u8
INFO[22-Dec-2020 18:42:45] Exec: ffmpeg -hide_banner -y -i D:\videos\x.mp4 -vf scale=trunc(oh*a/2)*2:360 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 10 -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename C:\Users\g00455772\AppData\Local\voodioapp\generated_hls\2\360p_%03d.ts C:\Users\myname\AppData\Local\voodioapp\generated_hls\2\360p.m3u8
INFO[22-Dec-2020 18:42:45] Exec: ffmpeg -hide_banner -y -i D:\videos\x.mp4 -vf scale=trunc(oh*a/2)*2:720 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 10 -hls_playlist_type vod -b:v 2800k -maxrate 2996k -bufsize 4200k -b:a 128k -preset ultrafast -hls_segment_filename C:\Users\myname\AppData\Local\voodioapp\generated_hls\2\720p_%03d.ts C:\Users\myname\AppData\Local\voodioapp\generated_hls\2\720p.m3u8
INFO[22-Dec-2020 18:42:45] Extracting HLS finished: x
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\videos\x.mp4':
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\videos\x.mp4':Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\videos\x.mp4':
....................
[hls @ 00000151edef1700] Opening 'C:\Users\myname\AppData\Local\voodioapp\generated_hls\2\360p_001.ts' for writing
[hls @ 000001cda0971740] Opening 'C:\Users\myname\AppData\Local\voodioapp\generated_hls\2\720p_001.ts' for writing
[hls @ 000002742f211740] Opening 'C:\Users\myname\AppData\Local\voodioapp\generated_hls\2\480p_001.ts' for writing
...........

if you want to check if ffmpeg was installed on the host OS, I write a snippet code, if you don't like it, just ignore

@slaveofcode
Copy link
Owner

Have you found a problem without giving -ffmpeg-bin option? Because by default, that value is always ffmpeg when not provided

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants