hongzimao / pensieve

Neural Adaptive Video Streaming with Pensieve (SIGCOMM '17)
http://web.mit.edu/pensieve/
MIT License
518 stars 281 forks source link

About last_index MPC.py #51

Closed quito418 closed 5 years ago

quito418 commented 6 years ago

Hi, Hongzi

Thank you for your great work.

I have a question about implementation in test/mpc.py

Shouldn't last_index in line 177 be the index of last chunk? last_index = int(CHUNK_TIL_VIDEO_END_CAP - video_chunk_remain)

If so, shouldn't last_index should start with 0?

last_index is used while calculating the max QoE using the bandwidth prediction. But it seems chunk sizes used in combo are one index moved back(last_index = current downloaded video index). So I think it should start with 0 until 47.But in the code it starts from 1.

This gives bitrate difference in the middle of video streaming a bit and usually matters with the last chunk, which the original code in github tries a higher bitrate at end, but if I modify the code it doesn't try a higher bitrate and results in lower rebuffer. Actually tring a higher bitrate doesn’t give benefit because of smoothness. Average reward varies by 2.6 (40.06 to 42.67 in simulation)

Line 177-180 to below

last_index = int(CHUNK_TIL_VIDEO_END_CAP - video_chunk_remain)-1
future_chunk_length = MPC_FUTURE_CHUNK_COUNT
if (CHUNK_TIL_VIDEO_END_CAP-1 - last_index < 5):
            future_chunk_length = CHUNK_TIL_VIDEO_END_CAP - last_index-1

In line 191-192

if ( TOTAL_VIDEO_CHUNKS - last_index < 5 ):
                    future_chunk_length = TOTAL_VIDEO_CHUNKS - last_index

shoudln't it be

if ( TOTAL_VIDEO_CHUNKS - last_index-1 < 5 ):
                    future_chunk_length = TOTAL_VIDEO_CHUNKS - last_index-1

Thank you!

hongzimao commented 5 years ago

Thank you for your discovery! You might be right, this can be a potential improvement. We did the reimplementation of MPC the best we could but might miss some corner cases. This is for simulation though, the real evaluation code is in javascript. In a very high level, I would say this also showcases human engineering heuristic can sometimes be tedious and prune to error (like we did) while a machine based approach is more automatic and alleviate much of this burden.

quito418 commented 5 years ago

Understood, Thank you!