Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • T Torchaudio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • hehl2
  • Torchaudio
  • Repository

Switch branch/tag
  • torchaudio
  • test
  • torchaudio_unittest
  • assets
  • nasa_13013.mp4
Find file HistoryPermalink
  • moto's avatar
    Add video test asset for streaming API (#2167) · db10bdfb
    moto authored Jan 21, 2022
    Summary:
    Split from https://github.com/pytorch/audio/issues/2164
    Add new test assets. Adding this commit separately so that
    this commit message about the origin of the file is easier to find.
    
    The original video is in public domain par
    - https://svs.gsfc.nasa.gov/13013
    - https://www.nasa.gov/multimedia/guidelines/index.html
    (The YouTube page directly says so)
    - https://www.youtube.com/watch?v=6zNsc0e3Zns
    
    So, the video is modified to fit the needs for testing.
    1. multiple audio/video streams
    2. Non-audio/video (subtitle) streams
    3. Different FPS and sampling rate
    4. Ones without audio and video.
    
    ```
    #!/usr/bin/env bash
    original=https://svs.gsfc.nasa.gov/vis/a010000/a013000/a013013/NASAs_Most_Scientifically_Complex_Space_Observatory_Requires_Precision-MP4.mp4
    subtitle=https://svs.gsfc.nasa.gov/vis/a010000/a013000/a013013/NASAs_Most_Scientifically_Complex_Space_Observatory_Requires_Precision-SRT-CC.en_US.srt
    
    # Fetch the original video, embed the subtitle
    ffmpeg -i "${original}" -i "${subtitle}" -c:v copy -c:a copy -c:s mov_text -metadata:s:2 language=eng original.mp4 -y
    
    # Extract, rescale video and resample audio
    ffmpeg -i original.mp4 -ss 29 -to 42 -c:s copy -vf scale=480:270 -af aresample=16000 tmp1.mp4 -y
    ffmpeg -i original.mp4 -ss 29 -to 42 -c:s copy -vf scale=320:180 -r 25 -af aresample=8000  tmp2.mp4 -y
    
    # Merge them, retaining all the streams (6 in total)
    ffmpeg -i tmp2.mp4 -i tmp1.mp4 -map 0 -map 1 -c:s copy nasa_13013.mp4 -y
    
    # Make versions without audio / video
    ffmpeg -i tmp2.mp4 -c copy -vn nasa_13013_no_video.mp4 -y
    ffmpeg -i tmp2.mp4 -c copy -an nasa_13013_no_video.mp4 -y
    ```
    
    Pull Request resolved: https://github.com/pytorch/audio/pull/2167
    
    Reviewed By: carolineechen
    
    Differential Revision: D33712954
    
    Pulled By: mthrok
    
    fbshipit-source-id: b7cfc1358043a4abd1c0b416e8a8fb0039867211
    db10bdfb
nasa_13013.mp4 657 KB

Download (657 KB)

Replace nasa_13013.mp4

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.