Code Monkey home page Code Monkey logo

mpv-scripts's People

Contributors

joeynotjoe avatar kaoneko avatar kars0n777 avatar occivink avatar pavelxdd avatar viliml avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpv-scripts's Issues

[encode] -ss after input

I’m trying to change the command of ffmpeg to put -ss after the input, because i’m getting weird extractions doing it without re-encoding. Doing directly in ffmpeg the command would be like:

ffmpeg -i input -ss 00:00:00 -to 00:00:00 -c copy output

I believe that the current script is doing something like:

ffmpeg -ss 00:00:00 -i input -to 0.000000 -c copy output

I only changed the order of the line ("-ss", start,) to be before of ("-i", input_path,) and it works sometimes. Doing that i believe i’m getting something like:

ffmpeg -i input -ss 00:00:00 to 0.000000 -c copy output

I believe the problem is related to the format of time duration, i need it to be like the format of the start duration, but i’m not able to do it.
Sorry for bad explication, but i’m amateur and don't know anything about coding.

encode_slice - Possible to 'copy' the container format?

Hello!

I am wondering how, to get my _slice profile to not use a set container. I had it set to mkv, but I ran into an mp4 source that had incompatible subtitle attachments. It would be great if there was a way to copy the extension/container when copying all streams.

[encode] Cannot write filenames that contain '%' symbol

Hi,

I have compiled the latest mpv from github and have pulled the latest copy of encode.lua and the issue persists. Namely, if the filename contains the '%' symbol, encode.lua will fail to export the new file.

To test this, rename any file to 100%.mp4, for example, and try to use encode.lua to extract a portion of it. It will fail. The culprit is line 53:

https://github.com/occivink/mpv-scripts/blob/master/scripts/encode.lua#L53

I'm running Linux so I don't know if this is an issue under other OSes as well. I've been using this script for a very long time without any issues. Today, I was watching some anime that had '%' in the title and it failed to work.

Key binding names in `start_crop()` and `cancel_crop()` should be the same

Key binding names in start_crop() should be "crop-"..key.

mp.remove_key_binding("crop-"..key)

mp.remove_key_binding("crop-"..key)

mp.add_forced_key_binding(key, "crop--"..key, func)

mp.add_forced_key_binding(key, "crop--"..key, func, { repeatable = true })

Help with understanding this script for mpv please

I am very new to mpv player and scripting in general, so please bear with me if I seem slow.
I am only interested in the encode.lua script
I want to create my own profile that will let me encode to .mp4 format
I have gotten it to work with .webm files using the encode_webm.conf file the creator has provided.
according to the instructions, these variables mean
$f input filename
$n incrementing number
$x input extension
so I simply took the encode_webm.conf file renamed it to encode_mp4.conf and changed the line output_format=$f_$n.webm to output_format=$f_$n.mp4
but its still encoding to .webm. Am I missing something else here? Thanks allot for your help.

Cannot crop with hwdecoding

Hello!

Recently updated and noticed you now forcibly disable cropping when hwdecoding is active. While you may not be able to see the effect of your crop in real time, this did in fact work when cropping a video for encode.lua.

Could we exchange the hard-stop for an OSD notice instead?

Thank you!

Best practice for adding in custom commands?

Hello, I have been modifying encode.lua in an effort to include some custom commands before the encode command, such as running Noti. I have been successful in getting that one to work by itself, but if I try and add in other commands in the Args section, I run into problems. I don't see much info in the logs, just the line of the command that was run, but no mention of the failures.

Is there a better way to include these types of commands? Maybe a better spot in the code than the args?

This is what I have now, which is indeed working (however, I could not get the timestamp of the encode to work in the -m flag portion, but it did work with -t... but I am also very much an amateur when it comes to Lua)

function start_encoding(input_path, from, to, settings)
    local args = {
        "noti",
        "-t", mp.get_property("filename/no-ext"),
        "-m", '🎥 Your clip is finished encoding.',
        "ffmpeg",
        "-loglevel", "panic", "-hide_banner", --stfu ffmpeg
        "-ss", seconds_to_time_string(from, false),
        "-i", input_path,
        "-to", tostring(to-from),
        }

It would be cool if there was a place in the config, preferably in the profile .conf settings, where you could define any other commands to be run before or after the script. Bonus points if those commands can reference the variables like $t or $s, as that would be super beneficial.

Thanks so much for your invaluable script!

[encode] Doesn't seem to work but produces a valid command

I had to edit encode.lua to make it work at all (issue #38), but this issue looks like it shouldn't exist. I'm trying to use multiple complex filter graphs, and it fails, but the command that is (supposedly) used is valid and works if I copy-paste it to a regular console window.

My config file: https://pastebin.com/PV11Fpts

[vo/gpu/d3d11] shaderc: 1978us, SPIRV-Cross: 151us, D3DCompile: 1749us
[statusline] AV: 00:00:01 / 00:00:05 (23%) A-V:  0.000
[encode] Opened config file script-opts/encode_gif.conf.
[encode] ffmpeg -ss 00:00.701 -i "C:\Users\Ten\Desktop\mpv\ff.mkv" -to 0.5423416661745 -map 0 -sn -an -f gif -filter_complex "[0:v] fps=1,scale=2*trunc(iw/max(1\,sqrt((iw*ih)/(640*360)))/2):-2,split [a][b];[a] palettegen [p];[b][p] paletteuse" "C:\Users\Ten\Desktop\mpv\ff_2.gif"
[statusline] AV: 00:00:02 / 00:00:05 (38%) A-V:  0.000
[cplayer] Set property: pause -> 1
[statusline] (Paused) AV: 00:00:02 / 00:00:05 (38%) A-V:  0.000

encode.lua output_directory how fix the path?

Hi How do i set the output_directory? i have i like this 'output_directory=D:\Programs\MPV\Files' and i still saves input path.
Could it be the input file is from another disk?
Thanks!

encode.lua youtube stream

Im trying to clip a certain part of a longer youtube video but it won't work. I assume its because youtube has a different stream for video and audio and it doesnt split the 2 links because other sites such as streamable work fine.
Not sure if its a limitation of the script/ffmpeg or me, is there a way to fix this because the script is flawless otherwise..
I attached the ffmpeg log, Thanks.

Im on windows and using the latest version of ffmpeg and youtube.dl.

ffmpeg-20201004-190149.log

lua-settings/ is deprecated, and warning message

Hello,
Thanx for your great scripts !
I've seen in several mpv scripts the indication that lua-settings is deprecated, and that we should use the script-opts directory instead.
Furthermore, I find it always disturbing not to know when the encode script has ended : say I launch an encode work, how do I know when it's finished ? I think a warning message would be nice. Also, what happens if the video ends before the encode is finished ?
Sorry for my poor english, I hope I'm understandable...
Best regards,
Dupond

No encoding, just clipping?

I tried to modify the script so it would take a section of the video without re-encoding but I failed.

Any suggestions to modify the code to clip without encoding would be welcome.

This is not a an issue, thanks for the code :), more of a request

youtube-dl and audio

Hello!

When playing a video from youtube with separate audio and video streams, encode.lua only operates on the video stream and omits the audio. Would it be possible to include external audio streams in the conversion?

Thanks!

About crop

If is is possible to setting same hotkey to crop/undo crop?
I know the script easycrop can do this
https://github.com/aidanholm/mpv-easycrop
But i like your script that can show the position and size when cropping.

Anyway thank you for watching,if it is not possible to use the same hotkey
i will set different to use.

Do you think the crop script can be be easily modified for "automatic zoom"?

I am interested to have some kind of "automatic zoom" inside mpv (where the input is based on selecting a region) in the way explained in mpv-player/mpv#8794

The crop script here given comes very close to what I would like to have. The cropping of "crop.lua" provides a kind of zoom (which is useful), but unfortunately the cropping also kills the possibility to span (and move around) in the "zoomed version".

Since at present I am not familiar with lua language I am not following the details of your code, and before going deeper into it I wonder whether you consider that the approach you have implemented could be adopted for "automatic zoom" purpose. I suspect the cropping is easier than what I want, but depending on how you have designed the cropping it might the case that I can easily adapt it to my aim.

Do you think the approach of you crop script can be be easily modified for "automatic zoom"? I would like to know your opinion on this question before spending time on lua language.

Thanks.

NUMENTER

I'd like to change Enter to NumEnter how can I do that?

Preserve filter (crop) not applying to Encode

Snippet of my mpv-crop-snippet.log shows the crop being detected and applied, but for some reason the mpv-ffmpeg-encode-snippet.log doesn't seem to apply the crop filter.

I've also attached my encode.confin case I might've messed something up there.

mpv-crop-snippet.log

[   1.429][d][cplayer] Run command: vf, flags=73, args=["remove", "@autocrop-cropdetect"]
[   1.429][v][vf] User filter list:
[   1.429][v][vf]   (empty)
[   1.467][d][cplayer] Run command: vf, flags=73, args=["pre", "@autocrop-crop:lavfi-crop=w=1920:h=816:x=0:y=132"]
[   1.468][v][vf] User filter list:
[   1.468][v][vf]   lavfi-crop (autocrop-crop)
[   1.508][v][vf] [lavfi-crop] 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[   1.508][d][ffmpeg] mpv_src_default_in: w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 fr:919025/38331 sar:1/1
[   1.509][d][ffmpeg] filter: w:1920 h:1080 sar:1/1 -> w:1920 h:816 sar:1/1
[   1.510][v][vf] [autorotate] 1920x816 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[   1.510][v][vf] [convert] 1920x816 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[   1.510][v][vf] [out] 1920x816 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264

mpv-ffmpeg-encode-snippet.log

[   7.455][i][encode] /usr/local/bin/ffmpeg -ss 1:33:39.656 -i '/Users/user/Movies/Hospital.Playlist.S02E05.1080p.NF.WEB-DL.DDP2.0.x264-HoneyG.mkv' -to 2.6068541660998 -map 0:0 -map 0:1 -map 0:2 -an '/Users/user/Movies/Hospital.Playlist.S02E05.1080p.NF.WEB-DL.DDP2.0.x264-HoneyG_1.mkv' 
[   7.455][d][cplayer] Run command: run, flags=64, args=["/usr/local/bin/ffmpeg", "-loglevel", "panic", "-hide_banner", "-ss", "1:33:39.656", "-i", "/Users/user/Movies/Hospital.Playlist.S02E05.1080p.NF.WEB-DL.DDP2.0.x264-HoneyG.mkv", "-to", "2.6068541660998", "-map", "0:0", "-map", "0:1", "-map", "0:2", "-an", "/Users/user/Movies/Hospital.Playlist.S02E05.1080p.NF.WEB-DL.DDP2.0.x264-HoneyG_1.mkv"]

encode.conf

only_active_tracks=yes
preserve_filters=yes
append_filter=
#codec=-c:v h264 -an
codec=-an
output_format=$f_$n.$x
output_directory=
detached=yes
ffmpeg_command=/usr/local/bin/ffmpeg
print=yes

P.S. I hope what I provided was sufficient enough, but if you need more logs, do let me know what you're looking for in particular so I can extract them and not upload the entire log file.

Issues with encode.lua to record clips of anime streamed with ani-cli

I like to use a tool called ani-cli to watch anime, and an issue I've had with the encode.lua script is that it fails to encode video streamed using this tool. the encode script works just fine for videos already downloaded onto my computer, however. I know this isn't a problem with ani-cli itself, as recording a clip using VLC media player's built-in record tool works just fine.

Interestingly, the error message Failed to encode, check log only appears when using my own script option I created, encode_mp4.txt (this is a .conf file in my script-opts folder, I just had to make a copy as a .txt file because GitHub won't let me upload .conf files), and not with encode_slice.conf or encode_webm.conf, even if detached is set to no; those two options will just say Encoding from <start time> to <end time>, and will not give the fail message, giving the impression that the encoding was successful, but the file is nowhere to be found in the output directory I have set, which means they are also failing, but it is not getting picked up by the script.

this is an issue on both Linux (I use Manjaro, if that matters) as well as Windows (Windows 10). Any help with resolving this issue would be greatly appreciated.

blur-edges partially works

First I have to say that your scripts are awesome! Thanks for sharing!
Probably I am too newbie to the MPV world, but I gotta ask you this..

When using your script I get the blur effect working on the left half of the screen (above and below the video) while the right half of the screen shows a green fill instead of the blur effect.. My screen gets divided right in the middle, the left part working, and the right part filled with green... Could you help my find out whats happening?

Thank you very much!

Crop.lua videos (zoomed in) keep resetting.

Hello, it's not really an issure, more like a small bug - i have 'loop-file=inf' in my mpv config, and if I crop a part of a videofile and the file ends, then it plays again with the cropped part (zoomed in) still showing. But if I skip forward the videofile and the video ends, it plays again - but only this time it will completely reset and the cropped part dissapear (zoomed out).

Does clipping streams work?

I've seen some mentions of clipping streams but I'm having trouble with it. Here's what's passed through with these settings,

only_active_tracks=yes
preserve_filters=no
append_filter=
codec=-c copy
output_format=$f_$n.$x
output_directory=WINDOWS PATH\
detached=yes
ffmpeg_command=ffmpeg
print=yes
ffmpeg -ss 00:01.455 -i 'edl://!no_clip;!no_chapters;%847%https://r2---sn-c5ioiv45c-5goe.googlevideo.com/videoplayback?expire=1569730344&ei=yNqPXcGUIYroyQXAxqqoCw&ip=185.159.156.18&id=o-AIFcq4x0DshBJ_wt3FvFp4q-J_i_BVcTIG8gvTGafJ2i&itag=242&aitags=133%2C160%2C242%2C278&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-c5ioiv45c-5goe%2Csn-i5heen7s&ms=au%2Conr&mv=m&mvi=1&pl=24&initcwndbps=1948750&mime=video%2Fwebm&gir=yes&clen=314635&dur=20.091&lmt=1501671820684451&mt=1569708581&fvip=2&keepalive=yes&fexp=23842630&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRQIhAJmwcYUWljb1GoJfoWZ7z9AtUB5qx2RwX85EvdALzSg0AiA5gztEH8fEOKX3KEjt0I6LJB7uxIdiceqQ5l5JMmRztQ%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIhANta1G8Y7zKyLrNMVYxt_iiMQ9NSFTw-LjK3UUexw5wEAiBO6x4bFa_4H_Hc2slFPKPP9O7K5xf71UVYnTHIeze4iQ%3D%3D&ratebypass=yes;!new_stream;!no_clip;!no_chapters;%814%https://r2---sn-c5ioiv45c-5goe.googlevideo.com/videoplayback?expire=1569730344&ei=yNqPXcGUIYroyQXAxqqoCw&ip=185.159.156.18&id=o-AIFcq4x0DshBJ_wt3FvFp4q-J_i_BVcTIG8gvTGafJ2i&itag=251&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-c5ioiv45c-5goe%2Csn-i5heen7s&ms=au%2Conr&mv=m&mvi=1&pl=24&initcwndbps=1948750&mime=audio%2Fwebm&gir=yes&clen=340363&dur=20.201&lmt=1501671719011165&mt=1569708581&fvip=2&keepalive=yes&fexp=23842630&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRgIhAMb8t36ldaM-3HwJMzPde5CIxTrOcTQVArDlDUppGOUBAiEAztgsnD69KJGkwjglU-wB8qH40t4LGXplNlAhGmnwDOE%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIhANta1G8Y7zKyLrNMVYxt_iiMQ9NSFTw-LjK3UUexw5wEAiBO6x4bFa_4H_Hc2slFPKPP9O7K5xf71UVYnTHIeze4iQ%3D%3D&ratebypass=yes;' -to 2.6587272727273 -map 0:0 -map 0:1 -c copy 'WINDOWS PATH\watch?v=qzdPTjk9aTg_1.mkv'

encode.lua output directory?

I can't find where the result of the encode.lua command gets output to (if anywhere, at the moment?). I'm running one of the "OS X builds by stolendata" (https://mpv.io/installation/), not the command line version of mpv. ffmpeg (installed via Homebrew) is in my PATH. The "Encoding from … to …" message goes away which makes me think it was successful, but I'm not sure where to see the result/output.

Relatedly, can the output directory be changed/set on a per-profile basis, i.e. in a .conf file in lua-settings/? Thanks!

Cropping with the keyboard

I run mpv from a framebuffer on my raspberry pi, but this setup unfortunately does not have any mouse support. I do have gpm installed, but the mpv devs have explicitly expressed no interest in supporting it. Can your script be extended to be used with keyboard support? (might be interested in implementing it myself, just wanted to know if this can be done easily, maybe without writing a lot of extra code).

I already saw a function crop_video(x, y, w, h) in your code, which might allow for manual keyboard entry of it's parameters (thereby bypassing all the interactive stuff). The interactive part of this script is okay btw, I'm just not that sure if it fits in well with keyboard movement.

MPV crop video playback/cut the part of the video into new file - How to install and use it

Here is what worked for me on Linux to setup the cropping and cutting MPV player scripts:

Setup/3 commands:

  1. for i in encode crop; do wget https://raw.githubusercontent.com/occivink/mpv-scripts/master/scripts/$i.lua -O ~/.config/mpv/scripts/$i.lua; done
  2. echo -e "\n\n# crop.lua - c/C keys and then click+click to select crop rectangle; d key to reset, l key to obfuscate the logo\nc script-message-to crop start-crop hard\nalt+c script-message-to crop start-crop soft\nl script-message-to crop start-crop delogo\nd vf del -1\n\nC script-message-to crop toggle-crop hard\n\n# encode.lua\ne script-message-to encode set-timestamp\nalt+e script-message-to encode set-timestamp encode_webm\nE script-message-to encode set-timestamp encode_slice" >> ~/.config/mpv/input.conf
  3. sed -i "s|-an -sn||g" ~/.config/mpv/scripts/encode.lua
  4. quit MPV player, open the media file

Usage (keyboard keys for MPV):
e,e - define cut points, make new cut file(no HW encoding)
c/C and mouse clicks - crop the video playback
l (lowercase L) and mouse clicks - dissolve/obfuscate logo, seems to work for playback not for cut new file

For Windows, i think one would have to manually copy scripts and append the contents of input.conf into the %appdata%\mpv *.conf file :-/ setup is not easy, can be good if these features are built in mpv mpv-player/mpv#4639 .

encode.lua

i have to replace

mp.add_key_binding(nil, "set-timestamp", set_timestamp)
mp.add_key_binding(nil, "clear-timestamp", clear_timestamp)

by

mp.add_key_binding(nil, "set_timestamp", set_timestamp)
mp.add_key_binding(nil, "clear_timestamp", clear_timestamp)

to do the script working

When use with crop, doesn't work with vdpau !

Cheers

Standard 8-bit H.264 profile

I am trying to make a profile that records a clip in standard 8-bit in a mp4 container and hardsubs the subtitles.

only_active_tracks=yes
preserve_filters=yes
append_filter=
codec= -c:v libx264 -profile:v high -level 4.2 -pix_fmt yuv420p -crf 13 -c:a libfdk_aac -b:a 128k
output_format=$f_$n.mp4
output_directory=
detached=yes
ffmpeg_command=ffmpeg
print=yes

Any suggestions ?

Proper Crop Toggle and Cycle Crops

toggle-crop removes crop, not toggle it.

It would be great to switch between cropped and uncropped. my use case would be cropping GUI elements of an editor in tutorials, but toggle to full video when the instructor switches the editor window.

It would also be great to cycle between crops instead of switching crop on/off. crop.lua can already define multiple crops within each other.

osd-back-color and draw_crosshair=yes cause the video to be hidden.

If draw_crosshair is true and if my mpv.conf contains:
osd-back-color=0.0/0.0/0.0/0.5
the crop.lua does this:
screen shot 2018-05-09 at 2 00 50 pm

As an experiment I made a change to function draw_crosshairs to reduce the extent of the crosshairs to 100x100:

function draw_crosshair(ass, center, window_size)
    ass:new_event()
    ass:append("{\\bord0}")
    ass:append("{\\shad0}")
    ass:append("{\\c&HBBBBBB&}")
    ass:append("{\\alpha&H00&}")
    ass:pos(0, 0)
    ass:draw_start()
    ass:rect_cw(center.x - 0.5, center.y-50, center.x + 0.5, center.y+50)
    ass:rect_cw(center.x-50, center.y - 0.5, center.x+50, center.y + 0.5)
    ass:draw_stop()
end

The result was a 100x100 black square at the top right of the video:
screen shot 2018-05-09 at 2 15 58 pm

The part that really confuses me is that draw_shade seems to be working fine. Were it not for that I'd think this were an mpv/libass bug.

(Using mpv 0.28.2 and libass 0.14.0)

Crop filter doesn't work with certain resolutions

For certain resolutions (3000x2000 is one example) I get this error when trying to use crop:

[ffmpeg] Impossible to convert between the formats supported by the filter 'mpv_src_default_in' and the filter 'auto_scaler_0'
[lavfi] failed to configure the filter graph
Disabling filter crop.00 because it has failed.

crop doesn't work for rotated movies

from ffprobe:

  Duration: 00:30:00.07, start: 0.000000, bitrate: 20261 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 19998 kb/s, SAR 1:1 DAR 16:9, 29.98 fps, 30 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2018-07-15T13:57:28.000000Z
      handler_name    : VideoHandle
    Side data:
      displaymatrix: rotation of -90.00 degrees

notice the displaymatrix: rotation of -90.00 degrees.

MPV will automatically rotates the video -90 degrees. Unfortunately the video-rotate property returns back 0, which is expected based on the docs:

       --video-rotate=<0-360|no>
              Rotate the video clockwise, in degrees. Currently supports 90° steps only.   If  no
              is  given, the video is never rotated, even if the file has rotation metadata. (The
              rotation value is added to the rotation metadata, which means  the  value  0  would
              rotate the video according to the rotation metadata.)

Then, the cropping is all funny.

Green bars on Blurred Edges

Half the width (the right half) of what's supposed to be blurred edges is a green vertical bar. How do I make that go away?

Change formatting of start and end time in file name

I tried looking through the code to find where I might be able to change it, but was unable to do so successfully.

Basically, I would love to be able to change the start time and end time formatting to use periods as separators, instead of colons, in the file name.

Is there somewhere easy to do this in the script?

[encode] Unable to find a suitable output format for streams

Hello,
I've tested the following with two computers, and, having the same problem, I've thought I would report it here.
I'm trying to slice (without reencoding) a stream file :

mpv https://www.youtube.com/watch?v=B-8fXb8tts0

No file is created at all. So I've tried to copy/paste the code in the console :

ffmpeg -ss 00:03.560 -i "https://r2---sn-1gi7zn7l.googlevideo.com/videoplayback?key=yt6&ipbits=0&clen=80997447&itag=137&c=WEB&requiressl=yes&ip=185.230.125.38&mime=video%2Fmp4&source=youtube&mm=31%2C26&mn=sn-1gi7zn7l%2Csn-2gb7sn7k&pl=24&id=o-ANQQIuyT8a1KfDi93P7l130hLeYfbzj1d46XPM9eJkyt&keepalive=yes&ms=au%2Conr&mt=1526740456&mv=m&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&gir=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&lmt=1438402447902317&ei=RTYAW_r0I4KV1gKG3IVI&expire=1526762149&initcwndbps=457500&dur=178.960&fvip=4&signature=84F897178FEDBF3E36C9766D86A1FEB5290378D2.46C32A8318BC0D9B5580F5B203D4FF663A044759&ratebypass=yes" -to 4.7 -map 0 -c copy "./watch?v=B-8fXb8tts0_1.46C32A8318BC0D9B5580F5B203D4FF663A044759&ratebypass=yes"

The result is :

Unable to find a suitable output format for './watch?v=B-8fXb8tts0_1.46C32A8318BC0D9B5580F5B203D4FF663A044759&ratebypass=yes'
./watch?v=B-8fXb8tts0_1.46C32A8318BC0D9B5580F5B203D4FF663A044759&ratebypass=yes: Invalid argument

My configuration file is the following one :

only_active_tracks=no
preserve_filters=no
append_filter=
codec=-c copy
output_format=$f_$n.$x
output_directory=
detached=yes
ffmpeg_command=ffmpeg
print=yes

I use the latest version of your script (commited on may 18) with mpv 0.28.2.
Thanx !
Best regards,
Dupond

-map parameters seem to be wrong

Hi,

I tried encoding part of a video which had subtitles (enabled in mpv) and an audio stream (disabled in mpv)

The script generated this command:

ffmpeg -ss 08:52.098 -i "./Knowing.Bros.E120.180324.1080p-NEXT.mkv" -to 3.3866823334108 -map 0:0 -map 0:2 -filter:v "crop=892:1064:14:14" -c:v libx264 -c:a aac -b:a 128k -preset slow -crf 19 "<...>/Knowing.Bros.E120.180324.1080p-NEXT_1.mp4"

which fails with this output:

Automatic encoder selection failed for output stream #0:1. Default encoder for format mp4 (codec none) is probably disabled. Please choose an encoder manually.
Error selecting an encoder for stream 0:1

If I change the -map 0:2 parameter to -map 0:1, it works

Avoid NTFS invalid characters

Hey, sorry to bug you about Windows specific issues again, but this one has been a thorn in my side for a while now.

Youtube urls can come in two flavors:
https://www.youtube.com/watch?v=XXXXX
yout.ube/XXXXX

The first one will cause any encodings to fail on Windows because the filename contains a question mark. I would really appreciate it if we could sanitize output filenames, so I could cut out segments of streams without having to modify the url (or more likely just download the video to make sure it works).

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.