Commit 711d6016 authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Update HW decoding tutorial and add notes about unseekable object (#2408)

Summary:
https://output.circle-artifacts.com/output/job/75187a52-b0d8-4cac-89f3-24e10889a36a/artifacts/0/docs/hw_acceleration_tutorial.html

1. Update HW decoding tutorial to include file-like object
1. Add note about unseekable object int streaming API tutorial

Pull Request resolved: https://github.com/pytorch/audio/pull/2408

Reviewed By: hwangjeff

Differential Revision: D36632702

Pulled By: mthrok

fbshipit-source-id: 17be2fb8528cb1d2d1ee11901b6a95c512466feb
parent 2d846263
This diff is collapsed.
...@@ -188,7 +188,7 @@ VIDEO_URL = f"{base_url}/stream-api/NASAs_Most_Scientifically_Complex_Space_Obse ...@@ -188,7 +188,7 @@ VIDEO_URL = f"{base_url}/stream-api/NASAs_Most_Scientifically_Complex_Space_Obse
# #
# .. code:: # .. code::
# #
# class Wrapper: # class UnseekableWrapper:
# def __init__(self, obj): # def __init__(self, obj):
# self.obj = obj # self.obj = obj
# #
...@@ -200,14 +200,24 @@ VIDEO_URL = f"{base_url}/stream-api/NASAs_Most_Scientifically_Complex_Space_Obse ...@@ -200,14 +200,24 @@ VIDEO_URL = f"{base_url}/stream-api/NASAs_Most_Scientifically_Complex_Space_Obse
# import requests # import requests
# #
# response = requests.get("https://example.com/video.mp4", stream=True) # response = requests.get("https://example.com/video.mp4", stream=True)
# s = StreamReader(Wrapper(response.raw)) # s = StreamReader(UnseekableWrapper(response.raw))
# #
# .. code:: # .. code::
# #
# import boto3 # import boto3
# #
# response = boto3.client("s3").get_object(Bucket="my_bucket", Key="key") # response = boto3.client("s3").get_object(Bucket="my_bucket", Key="key")
# s = StreamReader(Wrapper(response["Body"])) # s = StreamReader(UnseekableWrapper(response["Body"]))
#
# .. note::
#
# When using an unseekable file-like object, the source media has to be
# streamable.
# For example, a valid MP4-formatted object can have its metadata either
# at the beginning or at the end of the media data.
# Those with metadata at the beginning can be opened without method
# `seek`, but those with metadata at the end cannot be opened
# without `seek`.
# #
###################################################################### ######################################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment