Lets say I have this string:
,"mimeType":"video/mp4;+codecs=\"avc1.42001E,+mp4a.40.2\"","bitrate":353051,"width":640,"height":320,"lastModified":"1543659519195688","contentLength":"24469560","quality":"medium","fps":24,"qualityLabel":"360p","projectionType":"RECTANGULAR","averageBitrate":35300;codecs=\"avc1.64001F,+mp4a.40.2\"","bitrate":987359,"width":1280,"height":640,"lastModified":"1543660211977003","quality":"hd720","fps":24,"qualityLabel":"720p","projectionType":"RECTANGULAR
I need to extract all the pair values for width and height which are right after a "bitrate"
string.
Notice that the string has width, height twice. I need to get both pairs:
"bitrate":353051,"width":640,"height":320
"bitrate":987359,"width":1280,"height":640
Notice that I only need to get the ones which are immediately followed by "bitrate"
value. If there's no "bitrate"
value right before, then I don't want it.
So the answer should be:
640,320
1280,640
I have pasted the string here: