Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encode-slice won't work if filetype is .mp4 #58

Open
nnuel opened this issue Jan 26, 2022 · 6 comments
Open

encode-slice won't work if filetype is .mp4 #58

nnuel opened this issue Jan 26, 2022 · 6 comments

Comments

@nnuel
Copy link

nnuel commented Jan 26, 2022

For me it works splendid for .mkv file, for which many kudo's. However, the .mp4 files leave me with 0 byte files.

@Zoxjib
Copy link

Zoxjib commented Apr 26, 2022

I'm not sure its an issue with .mp4 files. I have this issue now with .mkv files, while some other .mkv files seem to get processed by encode-slice without issues.

@Zoxjib
Copy link

Zoxjib commented Apr 27, 2022

When it happens with detached=no the error says 'Encode failed, check the log'. I can't find the log, it doesn't appear in the console/terminal. Is there another location for this specific log?

@Zoxjib
Copy link

Zoxjib commented Apr 27, 2022

@nnuel I was investigating the problem over the mpv irc channel and with occivink's help found that the issue was related to a subtitle track. by adding -sn to the codec command (-sn disables the encoding of subtitles) or just shutting the subtitle off during playback/encode, I was able to bypass the issue.

Apparently no logs are saved because the script uses a detached process, so the ffmpeg output log goes into nothingness. If you want to see the log, you can run mpv through cli, run the encode script (which will print out the ffmpeg command to the cli, without the log). then copy-paste the same ffmpeg command manually in the cli to see which errors appear.

@Zoxjib
Copy link

Zoxjib commented Apr 27, 2022

For future reference, the errors were along these lines:

[mp4 @ 000002e3cebbd240] Could not find tag for codec ass in stream #2, codec not currently supported in container

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

@Vaykte
Copy link

Vaykte commented Jul 25, 2024

I have the same problem as OP
I tried @Zoxjib's solution and put the -sn in the codec command but it still saves a .mp4 with 0 bytes of info

My encode_slice.conf file has

codec=-sn -c:v libvpx -crf 10 -b:v 1000k

@Vaykte
Copy link

Vaykte commented Jul 25, 2024

Ok nevermind, I found the solution
Basically comes from my non-existent knowledge of the ffmpeg command

It works with
codec=-sn -c:v copy -b:v 1000k
for just copying

or
codec=-sn -c:v libx264 -crf 18 -b:v 1000k
to downgrad the quality

Whole encode_slice.conf :
only_active_tracks=yes preserve_filters=yes append_filter= codec=-sn -c:v libx264 -crf 18 -b:v 1000k output_format=$f_$n.mp4 output_directory=D:\Dos\mpv screenshots\mpv video detached=no ffmpeg_command=ffmpeg print=yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants