Skip to content

Commit 7bc1c2c

Browse files
bug fixes #11
1 parent b66ec81 commit 7bc1c2c

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ video = 'https://www.aminyazdanpanah.com/PATH/TO/VIDEO.MP4'
6262
#### 2. From Clouds
6363
You can open a file from a cloud by passing a tuple of cloud configuration to the method.
6464

65-
In **[this page](https://video.aminyazdanpanah.com/python/start/clouds?r=open)**, you will find some examples of opening a file from **[Amazon S3](https://aws.amazon.com/s3)**, **[Google Cloud Storage](https://console.cloud.google.com/storage)**, **[Microsoft Azure Storage](https://azure.microsoft.com/en-us/features/storage-explorer/)**, and a custom cloud.
6665
```python
6766
video = (google_cloud, download_options, None)
6867
```
6968

69+
Please visit **[this page](https://video.aminyazdanpanah.com/python/start/clouds?r=open)** to see some examples of opening a file from **[Amazon S3](https://aws.amazon.com/s3)**, **[Google Cloud Storage](https://console.cloud.google.com/storage)**, **[Microsoft Azure Storage](https://azure.microsoft.com/en-us/features/storage-explorer/)**, and a custom cloud.
70+
7071
### DASH
7172
**[Dynamic Adaptive Streaming over HTTP (DASH)](http://dashif.org/)**, also known as MPEG-DASH, is an adaptive bitrate streaming technique that enables high quality streaming of media content over the Internet delivered from conventional HTTP web servers. [Learn more](https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP)
7273

@@ -294,7 +295,6 @@ It can also be null. The default path to save files is the input path.
294295
#### 2. To Clouds
295296
You can save your files to a cloud by passing a tuple of cloud configuration to the `package` method.
296297

297-
In **[this page](https://video.aminyazdanpanah.com/python/start/clouds?r=save)**, you will find some examples of saving files to **[Amazon S3](https://aws.amazon.com/s3)**, **[Google Cloud Storage](https://console.cloud.google.com/storage)**, **[Microsoft Azure Storage](https://azure.microsoft.com/en-us/features/storage-explorer/)**, and a custom cloud.
298298

299299
```python
300300
(
@@ -317,6 +317,8 @@ A path can also be passed to save a copy of files to your local machine.
317317
progress=progress)
318318
)
319319
```
320+
Please visit **[this page](https://video.aminyazdanpanah.com/python/start/clouds?r=save)** to see some examples of saving files to **[Amazon S3](https://aws.amazon.com/s3)**, **[Google Cloud Storage](https://console.cloud.google.com/storage)**, **[Microsoft Azure Storage](https://azure.microsoft.com/en-us/features/storage-explorer/)**, and a custom cloud.
321+
320322
**NOTE:** This option(Save To Clouds) is only valid for **[VOD](https://en.wikipedia.org/wiki/Video_on_demand)** (it does not support live streaming).
321323

322324
**Schema:** The relation is `one-to-many`.

ffmpeg_streaming/media.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,16 @@
2727

2828
def _get_paths(output, _input, clouds):
2929
is_tmp = False
30-
31-
if output is not None:
30+
if clouds is not None:
31+
is_tmp = True
32+
basename = os.path.basename(output if output is not None else _input)
33+
output = os.path.join(tempfile.mkdtemp(prefix='ffmpeg_streaming_'), basename)
34+
dirname, name = get_path_info(output)
35+
elif output is not None:
3236
dirname, name = get_path_info(output)
3337
else:
3438
dirname, name = get_path_info(_input)
3539
output = _input
36-
if clouds is not None:
37-
is_tmp = True
38-
basename = os.path.basename(output)
39-
output = os.path.join(tempfile.mkdtemp(suffix='ffmpeg_streaming'), basename)
40-
dirname, name = get_path_info(output)
4140

4241
return output, dirname, name, is_tmp
4342

0 commit comments

Comments
 (0)