mpv-player / mpv

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

Request about deprecation of --record-file and its removal in the future: PLEASE DON'T DO IT #6999

Closed stifani closed 5 years ago

stifani commented 5 years ago

Hello,

this is not a bug issue as you may have understood. This is a request to keep option --record-file in future versions of mpv (when you execute this command, a message shows that "Warning: option --record-file is deprecated and might be removed in the future ( use --stream-record or the dump-cache command).." ). So let me explain why i'm asking this, why it's important to have that option and why --stream-record or --dump-cache are not good substitutes for --record-file.

Using mpv-repl you can easily bring up the console and interact with mpv by writing simple commands to dump the stream you are watching without any problem.

If you use a command like "set stream-record " it will only dump data received from the demuxer by that moment and all you have stored in cache buffer it's ignored.

If you use a command like "dump-cache timestart timeend " you can dump some segments of the cache buffer but you have to calculate hours, minutes, seconds and I can never get it to work since it will always give this message and an empty 0bytes . [recorder] Stream 0 has too many queued packets; dropping. [recorder] Stream 4 has too many queued packets; dropping. [recorder] Stream 0 has too many queued packets; dropping. [recorder] Stream 0 has too many queued packets; dropping. [recorder] Stream 4 has too many queued packets; dropping. ... [recorder] Stream x has too many queued packets; dropping. ...

The only WORKING and good solution is to seek where you want to dump your video and while you're playing, just bring up the repl-console, write "set record-file " and it will start dumping. Obviously you don't have to seek, or change stream or do nothing like that, otherwise it will corrupt the recorded file. But that's not a problem, since I know that I can have an exact copy of that stream, in that seeked position (which is inside the cache buffer) saved to a file. That's AWESOME. Imagine if there are 30 seconds of some live stream that you just saw in a live stream and you want to go back and capture, to share with other people: using this method you can easily seeking backward and write the commad to the repl-console to save those 30 seconds and when you are done, just type 'set record-file ""' to stop recording and you can always continue to watch the live stream without interruption, having the 30 seconds portion of video dumped to your disk.

So, in conclusion --record-file is a powerful and VERY EASY option to use as you may have understood and that's why I'm asking you to keep it in mpv.

tnx

ghost commented 5 years ago

With the new stuff, you can set the A-B loop A point, leave B unset, and issue ab-loop-dump-cache <filename>, and it will record anything in the cache starting from the A point, including anything new added to the cache. You still have to be careful with track switching and seeking, but unlike with --record-file, you can seek around within the cache region (if it's a live stream, you can seek around as much as mpv let's you, without "losing" anything).

What is the advantage of --record-file over this? One point of --record-file was that it actually "followed" the user's seek, but in practice the result was that files got corrupted (or looked like they were). Also, the user can't actually know where the recording starts and ends. The start is typically moved up to the next keyframe (after the amount the decoder buffers, which can be easily a second), the end is cut short to the last keyframe that was found. It sucked.

stifani commented 5 years ago

Hi wm4, As i wrote in my previous post, the problem with these commands: dump-cache, ab-loop-dump-cache is that they will give me the same message on a live stream (hls or mpd):

[recorder] Stream 4 has too many queued packets; dropping. [recorder] Stream 3 has too many queued packets; dropping. [recorder] Stream 4 has too many queued packets; dropping. [recorder] Stream 4 has too many queued packets; dropping. [recorder] Stream 3 has too many queued packets; dropping. [recorder] Stream 4 has too many queued packets; dropping. [recorder] Stream 3 has too many queued packets; dropping.

and the resulting file.ts has 0 byte data: is empty. So these options are not so affordable. Instead with --record-file I can actually get a portion of usable video (i know it's from key frame to key frame so I have to be careful when I start recording: i mean I can seek 5 secs back and wait 5 secs after before stop recording and then i can easily and precisely cut the stream after using ffmpeg or other video editor tools). To me --record-file never give me any problem of any kind and always worked as expected. I'm use to this option. It's like bread and butter :smile: or cornetto e cappuccino (as we say here in Italy :rofl:) I cannot think mpv without it :+1:

tnx

ghost commented 5 years ago

Well these never happened to me.

stifani commented 5 years ago

I made a small gif to show you the problem using ab-loop-dump-cache (the same happens with dump-cache). If you want I can open a new issue describing the problem in detail.

The hls stream used is: https://live3-mediaset-it.akamaized.net/Content/hls_h0_clr_vos/live/channel(fu)/index.m3u8 But it happens, as I said with mpd and also with some others hls stream.

I hope this helps.

tnx

mpv_upload restricted

ghost commented 5 years ago

That gif really doesn't help with anything. I can barely recognize that it seems to be about those log lines you posted. And watching it takes time, holy shit. I wish people would stop making screen captures with gif, holy shit.

This is just annoying, so I'm closing this.

stifani commented 5 years ago

I'm sorry but I had to convert to gif and reduce the size to upload here on github. Here is the original 1 min video. Don't worry, I hate gifs too :rofl:

https://streamable.com/6je0y

ghost commented 5 years ago

Well the problem is more that I'm supposed to fish some useful information out of this mess. (But gif adds insult to the injury.) It's not needed as proof either, it's not like I don't believe you that you get these log messages.

stifani commented 5 years ago

You know, sometime a visual proof it's better than anything else: it clarifies what is really going on and a person can better visualize the problem. It adds more "detail" to help to resolve the problem. Anyway, let me know if you need more information to help you to fix the problem :+1:

ghost commented 5 years ago

Anyway, let me know if you need more information to help you to fix the problem

Any actual information that would reproduce your problem. That HLS URL of yours gives me a 403 error, I should probably have mentioned this.

stifani commented 5 years ago

Yep, you should have had. Because I can now tell you, i just discovery right now, that this stream is geo-restricted. I don't know if it's only to italian's ips, but i've tried some countries and it does not work... Damn. I should i've thought about that.

I have another stream which from a different server but I have just tested under vpn and it is also geo restricted. If you want to try that out, to see if it works for you, here is the link to generate the encrypted stream http://videoplatform.sky.it/player/json/get_livestream_1.json The streaming url generated is in field "streaming_url". It should be something like this: "//skyanywhere3-i.akamaihd.net/hls/..../someverylongurl"

Maybe you can use some italian vpn or some sort of proxy from italy of some kind to connect to those stream and test them?

In the meantime i will search for others "bugged" streams like these here, to find which ones gives that message, because sometimes ab-loop-dump-cache works, sometimes it doesn't.

ghost commented 5 years ago

Maybe you can use some italian vpn or some sort of proxy from italy of some kind to connect to those stream and test them?

No.

stifani commented 5 years ago

I think I've found something. Tested under vpn in USA, Japan, Germany, France, Australia. It does load the stream and the .ts segments. I think it should work for you and for your country. And it has that too many queued packets; dropping. thing when executing ab-loop-dump-cache :smile: .Let me know. :wink:

http://deejay_tv-lh.akamaihd.net/i/DeejayTv_1@129866/master.m3u8

ghost commented 4 years ago

Is it better now?

stifani commented 4 years ago

Hey wm4. I don't know, i'm waiting for next git release for windows by shinchiro. Actually I don't have time to compile it by myself. But for what i understood, the problem was that hls streaming with multitrack (that disables streams) could cause problems if using cache dump. Right? I'm a C/C++ coder but i'm not into video/audio coding projects, so I don't know the exact dynamics. But I'll let you know when the next git release of mpv will be released :smile: