Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Need help, TypeError with reading m3u8/transcoding on OS X #47

Open
notacouch opened this issue Feb 21, 2014 · 3 comments
Open

Need help, TypeError with reading m3u8/transcoding on OS X #47

notacouch opened this issue Feb 21, 2014 · 3 comments

Comments

@notacouch
Copy link

Apologies in advance if this is an inappropriate support request, I'm not familiar with python and have been racking my brains trying to get this to work. Just want to strip audio from a stream.

I'm on OS X 10.9.1, installed mostly via pip if I recall correctly, had some problems with PyCrypto I believe I used easy_install to get that working.

Here's my config.ini:

[hlsclient]
destination = /tmp/hls
clean_maxage = 1200000
clean_ignore = ops*, .*
encrypt = true
not_modified_tolerance = 16
num_thread_workers = 4
download_timeout = 1
consume_timeout = 4

[log]
level = DEBUG
#filename = test.log
#suffix = %Y%d%m

[lock]
path = /tmp/hls/lock
timeout = 1
expiration = 20

[discover]
#api_url = https://raw.github.com/gist/3796754/eec34cbc4ae332c731e6fd4176f7f40992ba0a23/hlsclient_input_v2.json
api_url = http://notfkad-dev.foundationforknowledge.com/hlsclient-json/jumuah3/2013_khutbah2_live

The returned JSON:

{
  "streams": {
    "live": {
      "input-path": "/hls-live/_definst_/jumuah3/jumuah3_256.m3u8",
      "servers": [
        "http://media.zoojaja.com"
      ],
      "bandwidth": 256000
    }
  },
  "actions": [
    {
      "type": "transcode",
      "input": "live",
      "output": {
        "audio": {
          "path": "2013_khutbah2_live_64.m3u8",
          "audio-bitrate": 64000,
          "bitrate": 65000
        }
      }
    }
  ]
}

After running python -m hlsclient the .ts files are downloaded 2 or 4 at a time, however, I eventually keep getting this error:

2014-02-20 23:13:08,116 - ERROR [worker for live] - An unknown error happened
Traceback (most recent call last):
  File "hlsclient/workers/playlist.py", line 45, in run_forever
    self.run_if_locking()
  File "hlsclient/workers/playlist.py", line 117, in run_if_locking
    self.run()
  File "hlsclient/workers/playlist.py", line 68, in run
    self.encrypt)
  File "hlsclient/consumer.py", line 48, in consume_from_balancer
    list(executor.map(consume_resource, balancer.actives, timeout=CONSUME_TIMEOUT))
  File "/Library/Python/2.7/site-packages/concurrent/futures/_base.py", line 551, in map
    yield future.result(end_time - time.time())
  File "/Library/Python/2.7/site-packages/concurrent/futures/_base.py", line 404, in result
    return self.__get_result()
  File "/Library/Python/2.7/site-packages/concurrent/futures/_base.py", line 356, in __get_result
    raise self._exception
TypeError: coercing to Unicode: need string or buffer, bool found

Any ideas what's going wrong here? Any suggestions, recommendations?

Thanks.

@flavioribeiro
Copy link
Contributor

Hi,

First of all, can you tell me why you want to extract the audio?

In case you want to serve an audio-only track, we've built a nginx module that extracts it and serves on the fly: https://github.com/globocom/nginx-audio-track-for-hls-module

@notacouch
Copy link
Author

Have a bunch of old live/dvr streams that didn't have an audio only track. We also want to move dvr from off of the media server and onto the cloud elsewhere. Ultimately nginx would not be serving the ts and aac files.

@notacouch
Copy link
Author

That module looks amazing, though. Only works with ts files on the same machine i presume? Even if they're encrypted?

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

No branches or pull requests

2 participants