mpc-hc icon indicating copy to clipboard operation
mpc-hc copied to clipboard

Improve Save Image Filename for online streams

Open SomewhatDamaged opened this issue 1 year ago • 3 comments

Issue

When taking a snapshot (Default F5) it prepends the username and password of the current RTSP stream to the filename. Example: rtsp://admin:n%7D%29%3D%23W%40V%3BKWVL%3Dd%5E%297%2ayN9%2B~sqh9Mji%[email protected]:554 admin_n})=#W@V;KWVL=d^)7_yN9+~sqh9Mji)@192.168.1_snapshot_00.02.771.jpg

Expected

Image screenshots shouldn't leak such data. Perhaps chop such stream names at the @? Example: 192.168.1_snapshot_00.02.771.jpg

System/Version Info

MPC-HC (64-bit)


Build information: Version: 2.1.4 (c82061aef) Compiler: MSVC v19.29.30152 Build date: Jan 15 2024

LAV Filters: LAV Splitter: 0.78.0.1 LAV Video: 0.78.0.1 LAV Audio: 0.78.0.1 FFmpeg compiler: MinGW-w64 GCC 13.2.0

Operating system: Name: Windows 10 (Build 22H2) Version: 10.0.19045 (64-bit)

Hardware: CPU: AMD Ryzen 7 3700X 8-Core Processor GPU1: NVIDIA GeForce GTX 1070 (driver version: 31.0.15.3623) GPU2: NVIDIA GeForce GTX 1070 (driver version: 31.0.15.3623) GPU3: NVIDIA GeForce GTX 1070 (driver version: 31.0.15.3623)

SomewhatDamaged avatar Feb 05 '24 00:02 SomewhatDamaged

https://github.com/clsid2/mpc-hc/issues/995 is a similar problem that can be solved with abbreviation.

xLn2 avatar Feb 05 '24 07:02 xLn2

Maybe all online streams should just use a generic filename for screenshots. E.g. webvideo_[timestamp]_snapshot_[videotimestamp].jpg

clsid2 avatar Feb 05 '24 11:02 clsid2

I think there should be distinction between online streams (have duration) and live streams (no have duration). Since live streamings have no duration, [videotimestamp]s are somehow pointless to me. The current system time [timestamp] as a constant value makes more sense.

Online stream: Big Buck Bunny, Sunflower version Live stream: Free iptv

Online stream: Big Buck Bunny, Sunflower version Advanced settings, {SavelmagePosition, SavelmageCurrentTime opposite of default} bbb_sunflower_1080p_60fps_normal.mp4_[2024.02.05_15.23.41]

Advanced settings, {SavelmagePosition, SavelmageCurrentTime default settings} bbb_sunflower_1080p_60fps_normal.mp4_snapshot_00.15.372

Free iptv first live stream: Kanali 7 Ⓢ Advanced settings, {SavelmagePosition, SavelmageCurrentTime opposite of default} 1200_1.m3u8_[2024.02.05_15.58.42]

Advanced settings, {SavelmagePosition, SavelmageCurrentTime default settings} 1200_1.m3u8_snapshot_10.26.495

Findings/suggestions: "snapshot" shouldn't depend on SaveImagePosition state[on]. If media has no duration just use {SavelmagePosition=False, SavelmageCurrentTime=True}. On playlists streams mostly have significant list names. For playlist files it can be used as filename. If clip name is available, it can be used as filename (Big Buck Bunny, Sunflower version has)

xLn2 avatar Feb 05 '24 13:02 xLn2

"snapshot" shouldn't depend on SaveImagePosition state[on].

Fixed.

If media has no duration just use {SavelmagePosition=False, SavelmageCurrentTime=True}.

Done.

On playlists streams mostly have significant list names. For playlist files it can be used as filename.

Done, but note that if it detects a youtube url, including the twitch url used in your playlist (twitch.tv/abcnewsal), it uses a different method to get the name.

If clip name is available, it can be used as filename (Big Buck Bunny, Sunflower version has)

Done, but only if save extension is disabled.

adipose avatar May 29 '24 19:05 adipose

https://github.com/clsid2/mpc-hc/pull/2813

adipose avatar May 29 '24 19:05 adipose

For local files I think it should always use the filename, not the title.

clsid2 avatar May 29 '24 21:05 clsid2

OK, added that now.

adipose avatar May 29 '24 21:05 adipose