This is a bit inpractical because apps today tend to all use a single type of connection: https (tcp port 443).
So you cannot easily determine on the router what kind of traffic you are seeing.
In the past, every application used its own portnumber and you could select on that.
However, you can hope that a designer of an application that requires realtime network performance sets the DSCP value of the packets accordingly.
So you can try to use that to determine your priority. It will not be under custom control but it might solve your issues.
E.g. use something like this:
/ip firewall mangle
add action=set-priority chain=postrouting comment="From dscp high 3 bits" \
new-priority=from-dscp-high-3-bits passthrough=yes
add action=mark-packet chain=postrouting comment="Priority 0" \
new-packet-mark=prio0 passthrough=no priority=0
add action=mark-packet chain=postrouting comment="Priority 1" \
new-packet-mark=prio1 passthrough=no priority=1
add action=mark-packet chain=postrouting comment="Priority 2" \
new-packet-mark=prio2 passthrough=no priority=2
add action=mark-packet chain=postrouting comment="Priority 3" \
new-packet-mark=prio3 passthrough=no priority=3
add action=mark-packet chain=postrouting comment="Priority 4" \
new-packet-mark=prio4 passthrough=no priority=4
add action=mark-packet chain=postrouting comment="Priority 5" \
new-packet-mark=prio5 passthrough=no priority=5
add action=mark-packet chain=postrouting comment="Priority 6" \
new-packet-mark=prio6 passthrough=no priority=6
add action=mark-packet chain=postrouting comment="Priority 7" \
new-packet-mark=prio7 passthrough=no priority=7
Then use the packet marks prio0...prio7 to select 8 different sub-queues in a queue tree:
/queue tree
add comment="50 Mbps" limit-at=50M max-limit=50M name=queue-ether1 \
parent=ether1 queue=default
add limit-at=15M max-limit=45M name=queue-ether1-p1 packet-mark=prio7 parent=\
queue-ether1 priority=1 queue=default
add limit-at=15M max-limit=45M name=queue-ether1-p2 packet-mark=prio6 parent=\
queue-ether1 priority=2 queue=default
add limit-at=15M max-limit=45M name=queue-ether1-p3 packet-mark=prio5 parent=\
queue-ether1 priority=3 queue=default
add limit-at=15M max-limit=45M name=queue-ether1-p4 packet-mark=prio4 parent=\
queue-ether1 priority=4 queue=default
add limit-at=15M max-limit=45M name=queue-ether1-p5 packet-mark=prio3 parent=\
queue-ether1 priority=5 queue=pcq-upload-default
add limit-at=15M max-limit=45M name=queue-ether1-p6 packet-mark=prio0 parent=\
queue-ether1 priority=6 queue=pcq-upload-default
add limit-at=15M max-limit=45M name=queue-ether1-p7 packet-mark=prio2 parent=\
queue-ether1 priority=7 queue=pcq-upload-default
add limit-at=15M max-limit=45M name=queue-ether1-p8 packet-mark=prio1 parent=\
queue-ether1 queue=pcq-upload-default
Notice the slightly weird ordering of the lowest 3 priorities due to how TOS/DSCP is defined.
I have reasonably good results with this but I cannot guarantee anything, when all your app
developers are dumb and do not set DSCP it will not do anything.