Where to store the .mpd file on django to play on a dash player?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am trying to build a video player on django. I am using MPEG-DASH for adaptive streaming of the video file. I have chosen a sample video in the beginning. Then, using ffmpeg commands, I have encoded the video into 240p, 360p, 480p and 720p videos. Also have encoded audio separately.
Then, using mp4box, I have generated the .mpd file. I have read that mpd files cannot be run from the local file system and need to be hosted on a server. I have a dash player setup as follows:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>player</title>
<script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>
<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div>
<video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls></video>
</div>
</body>
</html>
The url in the src field is a random manifest file that i used to test the player out. It works fine.
Then, on my django project, I have created a media folder which stores the media files uploaded via a form(root included in settings.py
).
My question is where do i store the video, audio and .mpd file so that i can play them using the html code which resides in the templates folder. I have tried using the media url of .mpd file in the source but I am unable to play the video.
Here is the generated mpd file for reference:
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.7.0-rev0-gbd5c9af-master at 2018-12-21T18:45:32.091Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H1M9.869S" maxSegmentDuration="PT0H0M9.985S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264">
<ProgramInformation moreInformationURL="http://gpac.io">
<Title>BBB</Title>
</ProgramInformation>
<Period duration="PT0H1M9.869S">
<AdaptationSet segmentAlignment="true" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="130920">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<BaseURL>sample_audio_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="902-1017">
<Initialization range="0-901"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="426" maxHeight="240" maxFrameRate="30" par="426:240" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="2" mimeType="video/mp4" codecs="avc1.640015" width="426" height="240" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="590708">
<BaseURL>sample_video_240_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="640" maxHeight="480" maxFrameRate="30" par="4:3" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="3" mimeType="video/mp4" codecs="avc1.64001E" width="480" height="360" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="883873">
<BaseURL>sample_video_360_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
<Representation id="4" mimeType="video/mp4" codecs="avc1.64001E" width="640" height="480" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="1188712">
<BaseURL>sample_video_480_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="913-1052">
<Initialization range="0-912"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="1280" maxHeight="720" maxFrameRate="30" par="16:9" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="5" mimeType="video/mp4" codecs="avc1.64001F" width="1280" height="720" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="2365717">
<BaseURL>sample_video_720_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>
python django ffmpeg mpeg-dash mp4box
add a comment |
I am trying to build a video player on django. I am using MPEG-DASH for adaptive streaming of the video file. I have chosen a sample video in the beginning. Then, using ffmpeg commands, I have encoded the video into 240p, 360p, 480p and 720p videos. Also have encoded audio separately.
Then, using mp4box, I have generated the .mpd file. I have read that mpd files cannot be run from the local file system and need to be hosted on a server. I have a dash player setup as follows:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>player</title>
<script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>
<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div>
<video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls></video>
</div>
</body>
</html>
The url in the src field is a random manifest file that i used to test the player out. It works fine.
Then, on my django project, I have created a media folder which stores the media files uploaded via a form(root included in settings.py
).
My question is where do i store the video, audio and .mpd file so that i can play them using the html code which resides in the templates folder. I have tried using the media url of .mpd file in the source but I am unable to play the video.
Here is the generated mpd file for reference:
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.7.0-rev0-gbd5c9af-master at 2018-12-21T18:45:32.091Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H1M9.869S" maxSegmentDuration="PT0H0M9.985S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264">
<ProgramInformation moreInformationURL="http://gpac.io">
<Title>BBB</Title>
</ProgramInformation>
<Period duration="PT0H1M9.869S">
<AdaptationSet segmentAlignment="true" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="130920">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<BaseURL>sample_audio_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="902-1017">
<Initialization range="0-901"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="426" maxHeight="240" maxFrameRate="30" par="426:240" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="2" mimeType="video/mp4" codecs="avc1.640015" width="426" height="240" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="590708">
<BaseURL>sample_video_240_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="640" maxHeight="480" maxFrameRate="30" par="4:3" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="3" mimeType="video/mp4" codecs="avc1.64001E" width="480" height="360" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="883873">
<BaseURL>sample_video_360_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
<Representation id="4" mimeType="video/mp4" codecs="avc1.64001E" width="640" height="480" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="1188712">
<BaseURL>sample_video_480_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="913-1052">
<Initialization range="0-912"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="1280" maxHeight="720" maxFrameRate="30" par="16:9" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="5" mimeType="video/mp4" codecs="avc1.64001F" width="1280" height="720" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="2365717">
<BaseURL>sample_video_720_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>
python django ffmpeg mpeg-dash mp4box
add a comment |
I am trying to build a video player on django. I am using MPEG-DASH for adaptive streaming of the video file. I have chosen a sample video in the beginning. Then, using ffmpeg commands, I have encoded the video into 240p, 360p, 480p and 720p videos. Also have encoded audio separately.
Then, using mp4box, I have generated the .mpd file. I have read that mpd files cannot be run from the local file system and need to be hosted on a server. I have a dash player setup as follows:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>player</title>
<script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>
<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div>
<video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls></video>
</div>
</body>
</html>
The url in the src field is a random manifest file that i used to test the player out. It works fine.
Then, on my django project, I have created a media folder which stores the media files uploaded via a form(root included in settings.py
).
My question is where do i store the video, audio and .mpd file so that i can play them using the html code which resides in the templates folder. I have tried using the media url of .mpd file in the source but I am unable to play the video.
Here is the generated mpd file for reference:
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.7.0-rev0-gbd5c9af-master at 2018-12-21T18:45:32.091Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H1M9.869S" maxSegmentDuration="PT0H0M9.985S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264">
<ProgramInformation moreInformationURL="http://gpac.io">
<Title>BBB</Title>
</ProgramInformation>
<Period duration="PT0H1M9.869S">
<AdaptationSet segmentAlignment="true" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="130920">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<BaseURL>sample_audio_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="902-1017">
<Initialization range="0-901"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="426" maxHeight="240" maxFrameRate="30" par="426:240" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="2" mimeType="video/mp4" codecs="avc1.640015" width="426" height="240" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="590708">
<BaseURL>sample_video_240_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="640" maxHeight="480" maxFrameRate="30" par="4:3" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="3" mimeType="video/mp4" codecs="avc1.64001E" width="480" height="360" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="883873">
<BaseURL>sample_video_360_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
<Representation id="4" mimeType="video/mp4" codecs="avc1.64001E" width="640" height="480" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="1188712">
<BaseURL>sample_video_480_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="913-1052">
<Initialization range="0-912"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="1280" maxHeight="720" maxFrameRate="30" par="16:9" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="5" mimeType="video/mp4" codecs="avc1.64001F" width="1280" height="720" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="2365717">
<BaseURL>sample_video_720_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>
python django ffmpeg mpeg-dash mp4box
I am trying to build a video player on django. I am using MPEG-DASH for adaptive streaming of the video file. I have chosen a sample video in the beginning. Then, using ffmpeg commands, I have encoded the video into 240p, 360p, 480p and 720p videos. Also have encoded audio separately.
Then, using mp4box, I have generated the .mpd file. I have read that mpd files cannot be run from the local file system and need to be hosted on a server. I have a dash player setup as follows:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>player</title>
<script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>
<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div>
<video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls></video>
</div>
</body>
</html>
The url in the src field is a random manifest file that i used to test the player out. It works fine.
Then, on my django project, I have created a media folder which stores the media files uploaded via a form(root included in settings.py
).
My question is where do i store the video, audio and .mpd file so that i can play them using the html code which resides in the templates folder. I have tried using the media url of .mpd file in the source but I am unable to play the video.
Here is the generated mpd file for reference:
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.7.0-rev0-gbd5c9af-master at 2018-12-21T18:45:32.091Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H1M9.869S" maxSegmentDuration="PT0H0M9.985S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264">
<ProgramInformation moreInformationURL="http://gpac.io">
<Title>BBB</Title>
</ProgramInformation>
<Period duration="PT0H1M9.869S">
<AdaptationSet segmentAlignment="true" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="130920">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<BaseURL>sample_audio_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="902-1017">
<Initialization range="0-901"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="426" maxHeight="240" maxFrameRate="30" par="426:240" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="2" mimeType="video/mp4" codecs="avc1.640015" width="426" height="240" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="590708">
<BaseURL>sample_video_240_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="640" maxHeight="480" maxFrameRate="30" par="4:3" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="3" mimeType="video/mp4" codecs="avc1.64001E" width="480" height="360" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="883873">
<BaseURL>sample_video_360_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
<Representation id="4" mimeType="video/mp4" codecs="avc1.64001E" width="640" height="480" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="1188712">
<BaseURL>sample_video_480_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="913-1052">
<Initialization range="0-912"/>
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="1280" maxHeight="720" maxFrameRate="30" par="16:9" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="5" mimeType="video/mp4" codecs="avc1.64001F" width="1280" height="720" frameRate="30" sar="1:1" startWithSAP="1" bandwidth="2365717">
<BaseURL>sample_video_720_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="914-1053">
<Initialization range="0-913"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>
python django ffmpeg mpeg-dash mp4box
python django ffmpeg mpeg-dash mp4box
asked Jan 3 at 8:24
enigmaVadaenigmaVada
163
163
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54018649%2fwhere-to-store-the-mpd-file-on-django-to-play-on-a-dash-player%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54018649%2fwhere-to-store-the-mpd-file-on-django-to-play-on-a-dash-player%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown