bentasker / HLS-Stream-Creator

Simple Bash Script to take a media file, segment it and create an M3U8 playlist for serving using HLS
BSD 3-Clause "New" or "Revised" License
273 stars 101 forks source link

Issue on Ubuntu #38

Closed jamoir closed 4 years ago

jamoir commented 4 years ago

Hi,

First of all, thank you so much for your script. Its really awesome. I've been using it on my mac for a couple of months.

I've just attempted to move the script to my Ubuntu 16.04 server and I'm getting lots of syntax error's such as:

"(" unexpected

for the function:

function print_usage(){

Should this work ok on Ubuntu or do I need to do some work on it?

Thanks, Jamie

bentasker commented 4 years ago

Hi,

It should definitely work on Ubuntu

Can you show the exact command you're running?

jamoir commented 4 years ago

Hi Ben,

Thanks for replying so quickly (or at all for that matter).

./hls.sh -i /var/32.mp4 -s 10 -o /var/output -b 800-640x360,2000-960x540 -p test -t test

I've remove the 'function ' from the function declarations and now I get an error:

Syntax error: "(" unexpected (expecting "done") on the line "PIDS=("${PIDS[@]}") # remove any nulls"

fi

unset BITRATE_PROCESSES[$i] unset PIDS[$i] fi done PIDS=("${PIDS[@]}") # remove any nulls BITRATE_PROCESSES=("${BITRATE_PROCESSES[@]}") # remove any nulls sleep 1 done

It works perfectly on my mac btw.

Thanks, Jamie

bentasker commented 4 years ago

No worries, you lucked out by having the notification come through while I was looking at my inbox :)

That's very odd.

I assume the shebang is there:

head -n1 hls.sh

What do you get if you do

ls -l /bin/bash

Is it a symlink to some other shell? Can you dump out the output of

/bin/bash --version
jamoir commented 4 years ago

Hi,

Yeah its very odd... the shebang is there, but should it be !/bin/bash?

$ head -n1 hls.sh

!/bin/sh

$ ls -l /bin/bash -rwxr-xr-x 1 root root 1037528 Jul 12 2019 /bin/bash

$ /bin/bash --version GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. jamoir@gadgeaa3:/var/intratv_engine$

jamoir commented 4 years ago

Changed it to /bin/bash... and it worked.

What a wally I am! Thanks so much for pointing me to that.... I would have been here for hours.

jamoir commented 4 years ago

If there is anyway to buy/send you a beer let me know. Thanks, Jamie

bentasker commented 4 years ago

What a wally I am! Thanks so much for pointing me to that.... I would have been here for hours.

Heh, on some distro's you'd not have noticed as /bin/sh is a symlink to /bin/bash. But, on Ubuntu (and other Debian derivs) it's a symlink to /bin/dash instead.

If you want to send me a beer, it'll be happily accepted :) Easiest way is probably https://www.paypal.me/BTasker