[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] QMediaResource::dataSize() returns zero byte size for online video
From:       "Zhao Lee" <redstone-cold () 163 ! com>
Date:       2016-10-18 13:30:12
Message-ID: 23d4a790.217.157d7fc354d.Coremail.redstone-cold () 163 ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

I am trying to use QMediaResource::dataSize() to get online video byte size, however ,it just \
returns zero , it is hard to believe in this case

This may be zero if the size is unknown.

especially for the first url.

just want to know (1) if it is a bug with PyQt5 or Qt5 and (2)Does the equivalent code in Qt5 \
returns nonzero result ?(3) Any way to get the video byte size an m3u8 url referenced to ?

> > > from PyQt5.QtMultimediaimport*>>> from \
> > > PyQt5.QtCoreimport*>>>QMediaResource(QUrl('http://downdb.51voa.com/201610/will-philippines \
> > > -cut-ties-with-us-and-grow-closer-to-china.mp3')).dataSize()0>>>QMediaResource(QUrl('https \
> > > ://www.the5fire.com/static/demos/diaosi.m3u8'),"application/vnd.apple.mpegurl").dataSize()0>>>
> > > 


[Attachment #5 (text/html)]

<div style="color:#000; font-size: 14px;font-family: arial;"><div><span style="color: rgb(36, \
39, 41); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; \
line-height: 19.5px; background-color: rgb(255, 255, 255);">I am trying to use</span><span \
style="color: rgb(36, 39, 41); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; \
font-size: 15px; line-height: 19.5px; background-color: rgb(255, 255, 255);">&nbsp;</span><a \
href="http://doc.qt.io/qt-5/qmediaresource.html#dataSize" rel="nofollow" style="font-family: \
Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; margin: \
0px; padding: 0px; border: 0px; color: rgb(0, 89, 153); text-decoration: none; cursor: \
pointer;">QMediaResource::dataSize()</a><span style="color: rgb(36, 39, 41); font-family: \
Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; \
background-color: rgb(255, 255, 255);">&nbsp;</span><span style="color: rgb(36, 39, 41); \
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: \
19.5px; background-color: rgb(255, 255, 255);">to get online video byte size, however ,it just \
returns zero , it is hard to believe in this case</span></div><blockquote style="margin: 0px \
0px 10px; padding: 10px; border-width: 0px 0px 0px 2px; border-left-style: solid; \
border-left-color: rgb(255, 235, 142); font-size: 15px; quotes: none; color: rgb(36, 39, 41); \
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; \
background-color: rgb(255, 248, 220);"><p style="margin: 0px; padding: 0px; border: 0px; clear: \
both;">This may be zero if the size is unknown.</p></blockquote><p style="margin: 0px 0px 1em; \
padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: \
Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, \
255, 255);">especially for the first url.</p><p style="margin: 0px 0px 1em; padding: 0px; \
border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, \
'Helvetica Neue', Helvetica, sans-serif; line-height: 19.5px; background-color: rgb(255, 255, \
255);">just want to know (1) if it is a bug with PyQt5 or Qt5 and (2)Does the equivalent code \
in Qt5 returns nonzero result ?(3) Any way to get the video byte size an m3u8 url referenced to \
?</p><pre class="lang-cpp prettyprint prettyprinted" style="margin-top: 0px; margin-bottom: \
1em; padding: 5px; border: 0px; font-size: 13px; width: auto; max-height: 600px; overflow: \
auto; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans \
Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; color: rgb(57, 51, \
24); word-wrap: normal; background-color: rgb(239, 240, 241);"><code style="margin: 0px; \
padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation \
Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; \
white-space: inherit;"><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: \
rgb(48, 51, 54);">&gt;&gt;&gt;</span><span class="pln" style="margin: 0px; padding: 0px; \
border: 0px; color: rgb(48, 51, 54);"> from </span><span class="typ" style="margin: 0px; \
padding: 0px; border: 0px; color: rgb(43, 145, 175);">PyQt5</span><span class="pun" \
style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">.</span><span \
class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, \
175);">QtMultimedia</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; \
color: rgb(48, 51, 54);"> </span><span class="kwd" style="margin: 0px; padding: 0px; border: \
0px; color: rgb(16, 16, 148);">import</span><span class="pln" style="margin: 0px; padding: 0px; \
border: 0px; color: rgb(48, 51, 54);"> </span><span class="pun" style="margin: 0px; padding: \
0px; border: 0px; color: rgb(48, 51, 54);">*</span><span class="pln" style="margin: 0px; \
padding: 0px; border: 0px; color: rgb(48, 51, 54);"></span><span class="pun" style="margin: \
0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">&gt;&gt;&gt;</span><span class="pln" \
style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);"> from </span><span \
class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, \
175);">PyQt5</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: \
rgb(48, 51, 54);">.</span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; \
color: rgb(43, 145, 175);">QtCore</span><span class="pln" style="margin: 0px; padding: 0px; \
border: 0px; color: rgb(48, 51, 54);"> </span><span class="kwd" style="margin: 0px; padding: \
0px; border: 0px; color: rgb(16, 16, 148);">import</span><span class="pln" style="margin: 0px; \
padding: 0px; border: 0px; color: rgb(48, 51, 54);"> </span><span class="pun" style="margin: \
0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">*</span><span class="pln" \
style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);"></span><span \
class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, \
54);">&gt;&gt;&gt;</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; \
color: rgb(48, 51, 54);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: \
0px; color: rgb(43, 145, 175);">QMediaResource</span><span class="pun" style="margin: 0px; \
padding: 0px; border: 0px; color: rgb(48, 51, 54);">(</span><span class="typ" style="margin: \
0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">QUrl</span><span class="pun" \
style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">(</span><span \
class="str" style="margin: 0px; padding: 0px; border: 0px; color: rgb(125, 39, \
39);">'http://downdb.51voa.com/201610/will-philippines-cut-ties-with-us-and-grow-closer-to-china.mp3'</span><span \
class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, \
54);">)).</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, \
51, 54);">dataSize</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; \
color: rgb(48, 51, 54);">()</span><span class="pln" style="margin: 0px; padding: 0px; border: \
0px; color: rgb(48, 51, 54);"></span><span class="lit" style="margin: 0px; padding: 0px; \
border: 0px; color: rgb(125, 39, 39);">0</span><span class="pln" style="margin: 0px; padding: \
0px; border: 0px; color: rgb(48, 51, 54);"></span><span class="pun" style="margin: 0px; \
padding: 0px; border: 0px; color: rgb(48, 51, 54);">&gt;&gt;&gt;</span><span class="pln" \
style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);"> </span><span \
class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, \
175);">QMediaResource</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; \
color: rgb(48, 51, 54);">(</span><span class="typ" style="margin: 0px; padding: 0px; border: \
0px; color: rgb(43, 145, 175);">QUrl</span><span class="pun" style="margin: 0px; padding: 0px; \
border: 0px; color: rgb(48, 51, 54);">(</span><span class="str" style="margin: 0px; padding: \
0px; border: 0px; color: rgb(125, 39, \
39);">'https://www.the5fire.com/static/demos/diaosi.m3u8'</span><span class="pun" \
style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">),</span><span \
class="str" style="margin: 0px; padding: 0px; border: 0px; color: rgb(125, 39, \
39);">"application/vnd.apple.mpegurl"</span><span class="pun" style="margin: 0px; padding: 0px; \
border: 0px; color: rgb(48, 51, 54);">).</span><span class="pln" style="margin: 0px; padding: \
0px; border: 0px; color: rgb(48, 51, 54);">dataSize</span><span class="pun" style="margin: 0px; \
padding: 0px; border: 0px; color: rgb(48, 51, 54);">()</span><span class="pln" style="margin: \
0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);"></span><span class="lit" \
style="margin: 0px; padding: 0px; border: 0px; color: rgb(125, 39, 39);">0</span><span \
class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, \
54);"></span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, \
51, 54);">&gt;&gt;&gt;</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; \
color: rgb(48, 51, 54);"> \
</span></code></pre><div><br></div><div><br></div><div><br></div></div><!-- jy5ContentSuffix \
--><br><br><span title="neteasefooter"><p>&nbsp;</p></span>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic