Skip to content

Instantly share code, notes, and snippets.

@sk22
Last active November 28, 2021 13:11
Show Gist options
  • Save sk22/32a92f4eb4be449271f7b10be49c1b83 to your computer and use it in GitHub Desktop.
Save sk22/32a92f4eb4be449271f7b10be49c1b83 to your computer and use it in GitHub Desktop.
# you can also use bash tricks like
# `wget https://blabla/manifest_blabla_296221{1..9}`
# and use cool editors like visual studio code to edit multiple lines
# at the same time to avoid wasting time
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_init.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962209.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962210.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962211.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962212.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962213.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962214.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962215.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962216.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_audio_1_6_init.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_audio_1_6_2962209.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_audio_1_6_2962210.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_audio_1_6_2962211.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_audio_1_6_2962212.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_audio_1_6_2962213.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_audio_1_6_2962214.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_audio_1_6_2962215.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_audio_1_6_2962216.mp4
# merge audio/video "init" file with each audio/video segment
cat manifest_audio_1_6_init.mp4 manifest_audio_1_6_2962209.mp4 > audio_1_6_2962209.mp4
cat manifest_audio_1_6_init.mp4 manifest_audio_1_6_2962210.mp4 > audio_1_6_2962210.mp4
cat manifest_audio_1_6_init.mp4 manifest_audio_1_6_2962211.mp4 > audio_1_6_2962211.mp4
cat manifest_audio_1_6_init.mp4 manifest_audio_1_6_2962212.mp4 > audio_1_6_2962212.mp4
cat manifest_audio_1_6_init.mp4 manifest_audio_1_6_2962213.mp4 > audio_1_6_2962213.mp4
cat manifest_audio_1_6_init.mp4 manifest_audio_1_6_2962214.mp4 > audio_1_6_2962214.mp4
cat manifest_audio_1_6_init.mp4 manifest_audio_1_6_2962215.mp4 > audio_1_6_2962215.mp4
cat manifest_audio_1_6_init.mp4 manifest_audio_1_6_2962216.mp4 > audio_1_6_2962216.mp4
cat manifest_video_1_5_init.mp4 manifest_video_1_5_2962209.mp4 > video_1_5_2962209.mp4
cat manifest_video_1_5_init.mp4 manifest_video_1_5_2962210.mp4 > video_1_5_2962210.mp4
cat manifest_video_1_5_init.mp4 manifest_video_1_5_2962211.mp4 > video_1_5_2962211.mp4
cat manifest_video_1_5_init.mp4 manifest_video_1_5_2962212.mp4 > video_1_5_2962212.mp4
cat manifest_video_1_5_init.mp4 manifest_video_1_5_2962213.mp4 > video_1_5_2962213.mp4
cat manifest_video_1_5_init.mp4 manifest_video_1_5_2962214.mp4 > video_1_5_2962214.mp4
cat manifest_video_1_5_init.mp4 manifest_video_1_5_2962215.mp4 > video_1_5_2962215.mp4
cat manifest_video_1_5_init.mp4 manifest_video_1_5_2962216.mp4 > video_1_5_2962216.mp4
# create ffmpeg concat files 'files_video.txt' and 'files_audio.txt' manually
ffmpeg -f concat -safe 0 -i files_video.txt -f concat -safe 0 -i files_audio.txt output.mp4
# take a look at my ffmpeg cheat sheet for more handy commands!
# https://gist.github.com/sk22/d97a15638256a785fa3ca4cde29024e2
file 'audio_1_6_2962209.mp4'
file 'audio_1_6_2962210.mp4'
file 'audio_1_6_2962211.mp4'
file 'audio_1_6_2962212.mp4'
file 'audio_1_6_2962213.mp4'
file 'audio_1_6_2962214.mp4'
file 'audio_1_6_2962215.mp4'
file 'audio_1_6_2962216.mp4'
file 'video_1_5_2962209.mp4'
file 'video_1_5_2962210.mp4'
file 'video_1_5_2962211.mp4'
file 'video_1_5_2962212.mp4'
file 'video_1_5_2962213.mp4'
file 'video_1_5_2962214.mp4'
file 'video_1_5_2962215.mp4'
file 'video_1_5_2962216.mp4'
<?xml version="1.0" encoding="utf-8"?>
<!-- https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest.mpd -->
<!--
you can find this url (also for other livestreams) in your browser's devtools
in the network tab - just look for requests for the "manifest.mpd" file
-->
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:scte35="urn:scte:scte35:2013:xml" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" id="3077" type="dynamic" publishTime="2021-11-28T12:27:29" minimumUpdatePeriod="PT4S" availabilityStartTime="2021-07-14T08:43:05Z" minBufferTime="PT60S" suggestedPresentationDelay="PT25.000S" timeShiftBufferDepth="PT96.000S" profiles="urn:hbbtv:dash:profile:isoff-live:2012,urn:mpeg:dash:profile:isoff-live:2011">
<Period start="PT0.000S" id="1">
<AdaptationSet mimeType="video/mp4" scanType="progressive" segmentAlignment="true" startWithSAP="1" bitstreamSwitching="true">
<Representation id="1" width="512" height="288" sar="1:1" frameRate="25/1" bandwidth="369984" codecs="avc1.4D4015">
<!-- ... -->
</Representation>
<!-- ... -->
<Representation id="6" width="1280" height="720" sar="1:1" frameRate="25/1" bandwidth="3000000" codecs="avc1.4D401F">
<!-- BEST QUALITY VIDEO - URL IS HERE: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - - - AND HERE: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->
<SegmentTemplate timescale="25" media="manifest_video_1_5_$Number$.mp4?m=1634552461" initialization="manifest_video_1_5_init.mp4?m=1634552461" startNumber="2962496">
<!-- ... -->
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet mimeType="audio/mp4" segmentAlignment="0" lang="deu">
<Representation id="7" bandwidth="191692" audioSamplingRate="48000" codecs="mp4a.40.2">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></AudioChannelConfiguration>
<!-- AUDIO TRACK - - - - - - URL IS HERE: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - - - AND HERE: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv-->
<SegmentTemplate timescale="48000" media="manifest_audio_1_6_$Number$.mp4?m=1634552461" initialization="manifest_audio_1_6_init.mp4?m=1634552461" startNumber="2962496">
<!-- ... -->
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet mimeType="application/mp4" codecs="stpp" lang="deu" segmentAlignment="true" startWithSAP="1" bitstreamSwitching="true">
<!-- ... -->
</AdaptationSet>
</Period>
</MPD>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment