mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.25k stars 2.9k forks source link

showvolume's overlay isnt working always! #7749

Open phkarmur opened 4 years ago

phkarmur commented 4 years ago

command: https://pastebin.com/T8QSg1Rj working volumebars log: https://pastebin.com/ASDkixNw not working volumebars log: https://pastebin.com/8URpi3i5

I have couple of more issues with this feed too!

  1. volumebars not always not working in multi-program transport stream MPTS(sometime it plays, sometime not)
  2. getting pixelized output (source is clean, because i can play same video in ffplay as well as vlc)
  3. sometime getting "audio sync: sync_to_video=1, offset=-3600.000000" in logs and video freezes (ie 2 and 3rd program of sample ts file)
  4. if i use "--track-auto-selection=no" and try to set sid, its not working

Problem 3 can be source but other problems are not because of source. So can anyone please help to resolve these? Or please let me know if im doing anything wrong or missing any options.

Thank you.

phkarmur commented 4 years ago

Pixelation log: Pixelation log: https://pastebin.com/sFBAakLQ i have created c app for command line alternative because of player doesnt supports stream's pid selection in lavfi-complex and above code is from c app.

I need output like this: https://www.dropbox.com/s/x84m5eywj764nwa/showvolume.png?dl=0 but im getting pixelation like this: https://www.dropbox.com/s/h1m2vrwxb2rf6ib/Pixelation.png?dl=0 and getting without volumebars like this: https://www.dropbox.com/s/xrnktdhvlxhbtlc/showvolume_issue.png?dl=0

ghost commented 4 years ago

Maybe you're accidentally downscaling the video to overlay size? Your image links don't work, but even then I wouldn't go to dropbox, too slow and annoying.

phkarmur commented 4 years ago

ok, let me drop images here and im pretty sure im not over sizing

  1. need showvolume
  2. pixelation Pixelation
  3. without volumebar showvolume_issue
ghost commented 4 years ago

That looks like decoding corruption. Maybe there's more seeking going on, or packet loss?

phkarmur commented 4 years ago

Im not sure if mpv discards packet because of high bitrate (60 mbps) but there isnt any packet loss in source or network. And im not sure what you mean by 'more seeking'. And decoding corruption is possible but i can play same source in vlc and ffplay without any issue.

ghost commented 4 years ago

Does it play OK without the lavfi stuff in mpv?

phkarmur commented 4 years ago

Yes, but pixelation (decoding coruption) isnt happening often. Sometime i see this issue after few hours of playing video and sometime it takes couple of days.

ghost commented 4 years ago

So is the "pixelation" related to the overlay stuff or not?

phkarmur commented 4 years ago

No, pixelation happens with and without overall. And its pixelate only source video not overlay volumebars

richardpl commented 4 years ago

You do not get any overlay because you use asetrate, remove it. asetrate changes time stamps, and is not needed. Also you should set showvolume frame rate(rate option name) to same frame rate as your video input.

mpv ~/Downloads/HS_Recording.ts -lavfi-complex="[aid1]asplit[ao],showvolume=w=1030:h=40:o=1:f=0:r=10:dm=0:dmc=yellow:v=0:ds=log:b=5:p=0.5:s=1[vol1];[aid2]showvolume=w=1030:h=40:o=1:f=0:r=10:dm=0:
dmc=yellow:v=0:ds=log:b=5:p=0.5:s=1[vol2];[vid1][vol1]overlay=eval=0:x=35:y=15[v2];[v2][vol2]overlay=eval=0:x=1750:y=15[vo]"
phkarmur commented 4 years ago

I have tried without asetpts too, that not the problem. And to about frame rate, i will try and let you know but if increase framerate, volume meter (speed) will be changing to fast.

richardpl commented 4 years ago

You apparently have some issues in understanding what i wrote. Try my command, it works. Your can not work because you use ASETRATE. I nowhere mentioned asetpts.

phkarmur commented 4 years ago

Sorry i understood what you wrote but i mistakenly wrote asetpts.

richardpl commented 4 years ago

So you tried my proposed lavfi graph on file you uploaded?

phkarmur commented 4 years ago

@richardpl yes, if i try to use vid1, aid1 and aid2, it works always but if i change aid/vid indexes to other at that time sometime its not working. i have tried this command: mpv --msg-level=all=debug HS_Recording.ts -lavfi-complex="[aid5]showvolume=w=1030:h=40:o=1:f=0:r=10:dm=0:dmc=yellow:v=0:ds=log:b=5:p=0.5[vol1];[aid4]showvolume=w=1030:h=40:o=1:f=0:r=10:dm=0:dmc=yellow:v=0:ds=log:b=5:p=0.5[vol2];[vid4][vol1]overlay=eval=0:x=35:y=15[v2];[v2][vol2]overlay=eval=0:x=1750:y=15[vo]" --no-aid --log-file=volumebar.log

Is it because aids and vid arent from same program/channel?

log: https://pastebin.com/yJEy6em1 ouput: https://www.dropbox.com/s/53hbaj458j3osjg/output.ts?dl=0

richardpl commented 4 years ago

It is because timestamps differs between two audio streams and video stream. Use asetpts and setpts filter:

Try this demo:

mpv ~/Downloads/HS_Recording.ts -lavfi-complex="[aid5]asetpts=PTS-STARTPTS,showvolume=w=1030:h=40:o=1:f=0:r=10:dm=0:dmc=yellow:v=0:ds=log:b=5:p=0.5[vol1];[aid4]asetpts=PTS-STARTPTS,showvolume=w=1
030:h=40:o=1:f=0:r=10:dm=0:dmc=yellow:v=0:ds=log:b=5:p=0.5[vol2];[vid4][vol1]overlay=eval=0:x=35:y=15[v2];[v2][vol2]overlay=eval=0:x=W-w-10:y=15[vo]"
phkarmur commented 4 years ago

@richardpl thanks, its working since yesterday without any issues but its taking more cpu usage but i think i dont have any other options.

now only one problem remaining for me is pixelation/corruption getting pixelized output (source is clean, i can play same video in ffplay as well as vlc) . What can be issue here? source: https://www.dropbox.com/s/09vtc0a9wl0c1hd/HS_Recording_2.ts?dl=0 output: https://www.dropbox.com/s/qofxhqtx3k10waa/output.ts?dl=0