Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dumping DASH file with MP4Client #2

Closed
maximouton opened this issue Nov 22, 2014 · 17 comments
Closed

dumping DASH file with MP4Client #2

maximouton opened this issue Nov 22, 2014 · 17 comments

Comments

@maximouton
Copy link

Hi all,

I am trying to dump a live MPEG-DASH stream in order to do a PSRN comparison.
I found a previous discussion about keeping the cache

http://ehc.ac/p/gpac/discussion/287547/thread/be52202f/#1eef

When I use the same configurations I have the following error:

Opening URL http://<serverIP>/video1.mpd
[HTTP] Failure: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>    
<h1>Not Found</h1>
<p>The requested URL /tmp/gpac_cache_B049E484B4AA47A7924DBF39288A27821AF0F40C.mp4 was not found on this server.</p>
<hr>
<address>Apache/2.4.7 (Ubuntu) Server at <serverIP> Port 80</address>
</body></html>

[HTTP] Error parsing reply: Requested URL is not valid or cannot be found for URL             http://<serverIP>:80/tmp/gpac_cache_B049E484B4AA47A7924DBF39288A27821AF0F40C.mp4
[CACHE] gf_cache_delete_entry:835, failed to delete file /tmp/gpac_cache_7BF61017F5FFEC8CD6EF66772986D35AB768D758.mp4.txt
[DASH] FAILED to download http://<serverIP>:80/tmp/gpac_cache_B049E484B4AA47A7924DBF39288A27821AF0F40C.mp4 = Requested URL is not valid or cannot be found...
 Cannot open http://<serverIP>/video1.mpd: Requested URL is not valid or cannot be found
[CACHE] entry is null at utils/cache.c:556
[CACHE] entry is null at utils/cache.c:556

How can I tell MP4Client to take the cache in local directory?

Thanks

@cconcolato
Copy link
Member

If you use the settings indicated in your reference, replaying the same MPD (with the same URL) will fetch the data from the cache and not issue new HTTP requests. Now, if you want to reuse those cached files without the full URL, since the filenames in the cache directory do not match the file URLs from the MPD, copying the files out of the cache folder will require you to rename all the files. That is doable though. You can find the original file name in the accompanying .txt file in the cache.

@maximouton
Copy link
Author

I am sorry I did'nt make myself clear.
I just want to play live the stream being online and keep the cache stored in /tmp for post-processing.
What actually happens when I use the settings in my previous message is that MP4Client doesn't fetch the data from the cache (even if there is a file created in /tmp) but issues an http request.

@cconcolato
Copy link
Member

It is still not clear to me. If it's a live stream, MP4Client will want to get the live edge of the content, which is not in the cache, thus the request. But once fetched, it should stay in the cache for post-processing.

@maximouton
Copy link
Author

What you describes happens when .gpacrc is set with

   [Downloader]
   CleanCache=no
   DisableCache=no

   [DASH]
   KeepFiles=yes
   MemoryStorage=yes

but in this case these is nothing in the cache directory.
The issue I described occurs when I turn MemoryStorage to no.

@cconcolato
Copy link
Member

On my Ubuntu, with r5537, with:

[Downloader]
CleanCache=no
DisableCache=no

[DASH]
KeepFiles=yes
MemoryStorage=no

I do get files in the cache both when playing and after closing the player, with a live service.

@maximouton
Copy link
Author

I just upgraded to r5542 and I have the same issue:

Using config file in /home/netlab directory
System info: 7967 MB RAM - 4 cores
Modules Found : 34 
Loading GPAC Terminal
[Thread MediaManager] Couldn't set priority(2) for thread ID 0xb08ffb40
[Thread MediaManager] Couldn't set priority(2) for thread ID 0xb08ffb40
Terminal Loaded in 655 ms
Opening URL http://<serverIP>/dash2/video1.mpd
[GLSL] Failed to compile shader YUV Rect fragment (strict syntax): 0:1(10): error: GLSL 1.40 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

[Compositor] Using relaxed syntax version of YUV shader
[HTTP] Failure: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /tmp/gpac_cache_A11EB677A08144EE383D5859BAAB4123ACC72361.mp4 was not found on this server.</p>
<hr>
<address>Apache/2.4.7 (Ubuntu) Server at <serverIP> Port 80</address>
</body></html>

[HTTP] Error parsing reply: Requested URL is not valid or cannot be found for URL http://<serverIP>:80/tmp/gpac_cache_A11EB677A08144EE383D5859BAAB4123ACC72361.mp4
[CACHE] gf_cache_delete_entry:835, failed to delete file /tmp/gpac_cache_DB1D154CD29810C9050F8ED5F938CF4C97F53349.mp4.txt
[DASH] FAILED to download http://<serverIP>:80/tmp/gpac_cache_A11EB677A08144EE383D5859BAAB4123ACC72361.mp4 = Requested URL is not valid or cannot be found...
 Cannot open http://<serverIP>/dash2/video1.mpd: Requested URL is not valid or cannot be found
[CACHE] entry is null at utils/cache.c:556
[CACHE] entry is null at utils/cache.c:556

Now when I disable MemoryStorage MP4Client give me this

Using config file in /home/netlab directory
System info: 7967 MB RAM - 4 cores
Modules Found : 34 
Loading GPAC Terminal
[Thread MediaManager] Couldn't set priority(2) for thread ID 0xb08ffb40
[Thread MediaManager] Couldn't set priority(2) for thread ID 0xb08ffb40
Terminal Loaded in 107 ms
Opening URL http://<serverIP>/dash2/video1.mpd
[GLSL] Failed to compile shader YUV Rect fragment (strict syntax): 0:1(10): error: GLSL 1.40 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

[Compositor] Using relaxed syntax version of YUV shader
Service Connected
[Thread FAAD2 Decoder] Couldn't set priority(2) for thread ID 0xad6ffb40
[Codec] ODM2 ES1: Cannot find decoder for stream type MPEG-4 AVC|H264 Video
 Stream Setup Failure: Media Codec not found

I am not able to run my live stream anymore.

@cconcolato
Copy link
Member

Something's wrong in the way you use MP4Client. I don't understand how it can make requests to
http://<serverIP>/tmp/gpac_cache_A11EB677A08144EE383D5859BAAB4123ACC72361.mp4. What's your MPD like ? Can you share your MPD ? Can you provide also the command line you type in both cases ?

@maximouton
Copy link
Author

I used the following command

MP4Box -v -dash 500 -frag 500 -rap -frag-rap -profile onDemand -out  video_1000kbit.mp4#audio:id=audio video_1000kbit.mp4#video:id=1000kb video_2000kbit.mp4#video:id=2000kb

and the MPD file MP4Box give me is

<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.5.1-DEV-rev5542  on 2014-12-02T14:25:39Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H30M0.02S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
 <ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
  <Title>video1.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period duration="PT0H30M0.02S">
  <AdaptationSet segmentAlignment="true" lang="fre" subsegmentStartsWithSAP="1">
   <Representation id="audio" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="197343">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
    <BaseURL>video_1000kbit_track2_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="1060-45119">
      <Initialization range="0-1059"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="534" maxFrameRate="24000/1001" par="1280:534" lang="eng" subsegmentStartsWithSAP="1">
   <Representation id="1000kb" mimeType="video/mp4" codecs="avc1.640028" width="854" height="356" frameRate="24000/1001" sar="2136:2135" startWithSAP="1" bandwidth="1003109">
    <BaseURL>video_1000kbit_track1_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="1148-8175">
      <Initialization range="0-1147"/>
    </SegmentBase>
   </Representation>
   <Representation id="2000kb" mimeType="video/mp4" codecs="avc1.640029" width="1280" height="534" frameRate="24000/1001" sar="801:800" startWithSAP="1" bandwidth="2004355">
    <BaseURL>video_2000kbit_track1_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="1148-8295">
      <Initialization range="0-1147"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>

The file I use have been converted from an mkv file by avconv with commands such as:

avconv  -i video.mkv -ss 00:02:00 -t 00:30:00 -sn -codec:a:1 acc -codec:v:0 libx264 -strict experimental -b:a 64k -b:v 2000k -s 1280x534 -bufsize:a 1920k -bufsize:v 60000k -maxrate:2064k -r:25 -o video_2000kbit.mp4

The idea is to adapt the stream bandwidth according to the network conditions. I will use this for some tests.

@cconcolato
Copy link
Member

Thank you, but unfortunately, this does not help me much....
In your previous message MP4Client was displaying:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /tmp/gpac_cache_A11EB677A08144EE383D5859BAAB4123ACC72361.mp4 was not found on this server.</p>
<hr>
<address>Apache/2.4.7 (Ubuntu) Server at <serverIP> Port 80</address>
</body></html>

This is the HTML response of your Apache web server. That response indicates that MP4Client made a request for http://<serverIP>/tmp/gpac_cache_A11EB677A08144EE383D5859BAAB4123ACC72361.mp4. I don't understand how that request can be made. MP4Client maintains a mapping between the cache name and the URL to issue proper HTML requests. It may be a bug (although it's unlikely) but I cannot reproduce the problem here. Can you provide the steps to reproduce it? Did you modify the MPD after generating it with MP4Box? Can you send logs generated using the following command?

MP4Client -lf log.txt -logs network@debug http://<serverID>/dash2/video1.mpd

@cconcolato
Copy link
Member

Or report using

MP4Client -lf log.txt -logs dash:network@info http://<serverID>/dash2/video1.mpd

this should lead to a less verbose output...

@maximouton
Copy link
Author

Here it is

http://pastebin.com/gJptZ5rh

Thanks

@cconcolato cconcolato self-assigned this Dec 10, 2014
@cconcolato
Copy link
Member

Sorry for the delay and thanks for the logs. I can now reproduce your problem. It only happens with ondemand content, not with live. I don't have a solution yet, but will try to fix it.

@cconcolato cconcolato added the bug label Dec 10, 2014
@jeanlf
Copy link
Member

jeanlf commented Dec 17, 2014

This should now be fixed, could you check it?

@maximouton
Copy link
Author

First thanks for the support!
Yes I think the problem is solved.
But ...
When I run MP4Client from scratch (empty .gpracrc), neither video nor audio is running.

In the new created .gpracrc file there is

[Video]
DriverName=SDL Video Output

[Audio]
DriverName=No Audio Output Available

whereas in former version there was

[Video]
DriverName=X11 Video Output
SwitchResolution=no
HardwareMemory=Auto
GLNbBitsPerComponent=8
GLNbBitsDepth=16
UseGLDoubleBuffering=yes
X113DOffscreenMode=Pixmap

[Audio]
ForceConfig=yes
NumBuffers=2
TotalDuration=120
DisableNotification=no
DriverName=SDL Audio Output

When I run MP4Client with this configuration only the audio is working.
In previous version MP4Client used to play the file without any problem.
Maybe it is related to my new configuration. The result of ./configure is

/usr/bin/svnversion

** System Configuration
Install prefix: /usr/local
Source path: /media/netlab/0ed1a7e9-8fab-467d-9bdf-1702db58c11f/video_1080/gpac
C   compiler: gcc
C++ compiler: g++
make: make
CPU: x86
Big Endian: no

** GPAC 0.5.1-DEV rev5563 Core Configuration **
debug version: no
GProf enabled: no
Static build enabled: no
Memory tracking enabled: no
Use standard memory allocator: no
Fixed-Point Version: no
IPV6 Support: yes
Static Modules: no

** Detected libraries **
zlib: system
OSS Audio: yes
ALSA Audio: yes
Jack Audio: yes
PulseAudio Audio: yes
DirectFB support: no
X11 Shared Memory support: yes (path: /usr/X11R6)
X11 XVideo support: yes
SDL Support: yes
OpenGL support: yes
TinyGL support: no
OpenSSL support: yes
Mozilla XUL/GECKO support: no
DVB Support: yes
XMLRPC Support: no
wxWidgets support: no

** Extra Libraries used **
SpiderMonkey: system
FreeType: system
JPEG: system
OpenJPEG: system
PNG: system
MAD: system
FAAD: system
XVID: system
FFMPEG: system
Xiph OGG: system
Platinum UPnP: no
AVCap: no
Xiph Vorbis: system
Xiph Theora: system
A52 (AC3): local
OpenSVCDecoder: no
OpenHEVCDecoder: no
Freenect: no

Any idea?

@cconcolato
Copy link
Member

Try to delete your ~/.gpacrc and run MP4Client (with no content). It should recreate the configuration file properly.

@maximouton
Copy link
Author

Removing the ~/.gpacrc rather than empty it partially solve the issue.
Now audio works but video still doesn't.

I got this error when playing the stream

[Codec] ODM2 ES1: Cannot find decoder for stream type MPEG-4 AVC|H264 Video
 Stream Setup Failure: Media Codec not found

@jeanlf
Copy link
Member

jeanlf commented Apr 27, 2015

have you tried complete uninstall, cleanup rebuild and install ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants