Skip to content
New issue

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

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

Already on GitHub? # to your account

Debian packaging update #172

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
*.DS_Store
*.pyc
*.pc
dist
build
install
*.egg-info
9 changes: 7 additions & 2 deletions mkchromecast.py → bin/mkchromecast
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# This file is part of mkchromecast.
import os.path
import sys

HERE = os.path.dirname(__file__)
if os.path.exists(os.path.join(HERE, '..', 'mkchromecast')):
sys.path.insert(0, os.path.join(HERE, '..'))

import mkchromecast.__init__
from mkchromecast.version import __version__
Expand All @@ -10,7 +16,6 @@
from mkchromecast.pulseaudio import create_sink, remove_sink
from mkchromecast.utils import terminate
import subprocess
import os.path
import time
import atexit
import signal
Expand Down
52 changes: 52 additions & 0 deletions mkchromecast.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.\" Hey, EMACS: -*- nroff -*-
.\" (C) Copyright 2017 Muammar El Khatib <muammar@debian.org>,
.\"
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH Mkchromecast "1" "December 23 2017"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
mkchromecast \- cast audio and video to Google cast devices
.SH SYNOPSIS
.B mkchromecast
.RI [ options ]
.SH DESCRIPTION
This manual page documents briefly the
.B mkchromecast
commands.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBmkchromecast\fP is a program that allows you to cast your audio or video
files to your Google cast or Sonos devices.
.SH OPTIONS
This program follows the usual GNU command line syntax, with long
options starting with two dashes (`-').
A summary of options is included below.
For a complete description, see the Info files.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.SH SEE ALSO
.\".BR bar (1),
.\".BR baz (1).
.\".br
The program is documented fully executing
.IR "mkchromecast -h" ,
that should give you complete access to the usage.
52 changes: 26 additions & 26 deletions mkchromecast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
whereas, installation from source needs users to go inside the cloned git
repository and execute:

python mkchromecast.py
mkchromecast
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a ./, because not all (none?) modern Unix-like operating systems assume that the current working directory is part of the PATH.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mkchromecast script is suppose to be in /usr/bin and when installing the debian package is placed there.


The two examples above will make Mkchromecast streams with node.js (or
parec in Linux) together with mp3 audio coding format at a sample rate of
Expand All @@ -57,7 +57,7 @@
ALSA in your system.

Example:
python mkchromecast.py --encoder-backend ffmpeg --alsa-device hw:2,1
mkchromecast --encoder-backend ffmpeg --alsa-device hw:2,1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem


It only works for the ffmpeg and avconv backends, and it is not useful for
pulseaudio users. For more information read the README.Debian file shipped
Expand All @@ -77,10 +77,10 @@
Example:

ffmpeg:
python mkchromecast.py --encoder-backend ffmpeg -c ogg -b 128
mkchromecast --encoder-backend ffmpeg -c ogg -b 128
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same and for all the following changes...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed... This was just an existing patch in the current debian packaging which I upstreamed as part of this. Actually the change goes python mkchromecast.py -> bin/mkchromecast I could rework the old patch or just drop it - it's not the important part here.

In other words: the documentation needs an overhaul (hey, this is user info in init.py...), and in this context this is probably the least problem. The more I think of it, tyhe proper solution for now would be to drop this patch.

Thoughts?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never knew where was one supposed to add this type of documentation. If it is moved out of init.py, is another file needed to add all of this?

Copy link
Contributor Author

@leamas leamas Apr 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really a discussion which belongs to #174. The short story is that there already is too many files, so adding yet another one is probably not the solution. In the long run, the user info should IMHO be centralized e. g. in the manpage , the website or README.md , with links from other locations.

Being the person I am, I would actually go for the manpage. Your mileage may vary, though.

EDIT: The old-fashioned Unix documentation, recognized also on MacOS is (according to no less than myself):

  • The --help info. Short and concise, should fit in a page or so.
  • The manpage: Detailed API and user info, expanding the --help summary.
  • The README files are really second class citizens here, adding distro-specific and platform quirks info.
  • The website... which should explain why this is such a great project, how to install it and where to find the usage info after installation.


node:
python mkchromecast.py -b 128
mkchromecast -b 128

This option works with all backends. The example above sets the average
bitrate to 128k.
Expand All @@ -101,10 +101,10 @@
Example:

ffmpeg:
python mkchromecast.py --encoder-backend ffmpeg -c ogg -b 128 --chunk-size 2048
mkchromecast --encoder-backend ffmpeg -c ogg -b 128 --chunk-size 2048

avconv:
python mkchromecast.py --encoder-backend avconv -c ogg -b 128 --chunk-size 64
mkchromecast --encoder-backend avconv -c ogg -b 128 --chunk-size 64

'''
)
Expand All @@ -118,7 +118,7 @@
Set the audio codec.

Example:
python mkchromecast.py --encoder-backend ffmpeg -c ogg
mkchromecast --encoder-backend ffmpeg -c ogg

Possible codecs:
- mp3 [192k] MPEG Audio Layer III (default)
Expand All @@ -139,7 +139,7 @@
Set a ffmpeg or avconv command for streaming video.

Example:
python3 mkchromecast.py --video --command 'ffmpeg -re -i \
mkchromecast --video --command 'ffmpeg -re -i \
/path/to/myvideo.mp4 -map_chapters -1 -vcodec libx264 -preset ultrafast \
-tune zerolatency -maxrate 10000k -bufsize 20000k -pix_fmt yuv420p -g \
60 -f mp4 -max_muxing_queue_size 9999 -movflags \
Expand Down Expand Up @@ -204,7 +204,7 @@
- gstreamer

Example:
python mkchromecast.py --encoder-backend ffmpeg
mkchromecast --encoder-backend ffmpeg
'''
)

Expand All @@ -218,7 +218,7 @@
one network device available.

Example:
python mkchromecast.py --encoder-backend ffmpeg --host 192.168.1.1
mkchromecast --encoder-backend ffmpeg --host 192.168.1.1

You can pass it to all available backends.
'''
Expand All @@ -233,7 +233,7 @@
Stream a file.

Example:
python mkchromecast.py -i /path/to/file.mp4
mkchromecast -i /path/to/file.mp4
'''
)

Expand All @@ -247,7 +247,7 @@
connect.

Example:
python mkchromecast.py -n mychromecast
mkchromecast -n mychromecast
'''
)

Expand All @@ -270,7 +270,7 @@
Example:

ffmpeg:
python mkchromecast.py --encoder-backend ffmpeg -p 5100
mkchromecast --encoder-backend ffmpeg -p 5100

'''
)
Expand Down Expand Up @@ -343,10 +343,10 @@
Example:

ffmpeg:
python mkchromecast.py --encoder-backend ffmpeg -c ogg -b 128 --sample-rate 32000
mkchromecast --encoder-backend ffmpeg -c ogg -b 128 --sample-rate 32000

node:
python mkchromecast.py -b 128 --sample-rate 32000
mkchromecast -b 128 --sample-rate 32000

This option works for both backends. The example above sets the sample rate
to 32000Hz, and the bitrate to 128k.
Expand Down Expand Up @@ -380,7 +380,7 @@

Examples:

python mkchromecast.py --video --screencast
mkchromecast --video --screencast
'''
)

Expand All @@ -393,7 +393,7 @@
HH:MM:SS.

Example:
python mkchromecast.py --video -i "/path/to/file.mp4" --seek 00:23:00
mkchromecast --video -i "/path/to/file.mp4" --seek 00:23:00

'''
)
Expand All @@ -406,7 +406,7 @@
Segmentate audio for improved live streaming when using ffmpeg.

Example:
python mkchromecast.py --encoder-backend ffmpeg --segment-time 2
mkchromecast --encoder-backend ffmpeg --segment-time 2

'''
)
Expand All @@ -422,13 +422,13 @@
Example:

Source URL, port and extension:
python mkchromecast.py --source-url http://192.99.131.205:8000/pvfm1.ogg -c ogg --control
mkchromecast --source-url http://192.99.131.205:8000/pvfm1.ogg -c ogg --control

Source URL, no port, and extension:
python mkchromecast.py --source-url http://example.com/name.ogg -c ogg --control
mkchromecast --source-url http://example.com/name.ogg -c ogg --control

Source URL without extension:
python mkchromecast.py --source-url http://example.com/name -c aac --control
mkchromecast --source-url http://example.com/name -c aac --control

Supported source URLs are:

Expand Down Expand Up @@ -477,7 +477,7 @@
Update Mkchromecast git repository.

Example:
python mkchromecast.py --update
mkchromecast --update

This will execute for you:

Expand Down Expand Up @@ -505,13 +505,13 @@
Examples:

Cast a file:
python mkchromecast.py --video -i "/path/to/file.mp4"
mkchromecast --video -i "/path/to/file.mp4"

Cast from source-url:
python mkchromecast.py --source-url http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 -c mp4 --control --video
mkchromecast --source-url http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 -c mp4 --control --video

Cast a youtube-url:
python mkchromecast.py -y https://www.youtube.com/watch\?v\=VuMBaAZn3II --video
mkchromecast -y https://www.youtube.com/watch\?v\=VuMBaAZn3II --video

'''
)
Expand Down Expand Up @@ -539,7 +539,7 @@
http://rg3.github.io/youtube-dl/supportedsites.html.

Example:
python mkchromecast.py -y https://www.youtube.com/watch?v=NVvAJhZVBTc
mkchromecast -y https://www.youtube.com/watch?v=NVvAJhZVBTc

Note that this is only working for websites running over https.
'''
Expand Down
Loading