Coder Social home page Coder Social logo

Comments (15)

ekisu avatar ekisu commented on May 28, 2024

Which build are you using? Please post the output from mpv --ovc=help and mpv --oac=help.

from mpv-webm.

nickbudi avatar nickbudi commented on May 28, 2024

here's the mpv output

from mpv-webm.

ekisu avatar ekisu commented on May 28, 2024

Apparently your libavcodec was compiled without libvpx/libvorbis encoding support. I don't know if macOS mpv builds are statically or dynamically linked, but there's not much that can be done aside from enabling the right flags on the build.

Edit: just for the record, can your mpv play webm files?

from mpv-webm.

nickbudi avatar nickbudi commented on May 28, 2024

Yeah my mpv build is able to play webm files.

Looks like --enable-libvorbis --enable-libvpx are the required build flags

from mpv-webm.

ekisu avatar ekisu commented on May 28, 2024

Can you (re)install ffmpeg enabling libvpx and libvorbis, and report if it works?

Maybe this helps.

from mpv-webm.

nickbudi avatar nickbudi commented on May 28, 2024

Thanks, reinstalling ffmpeg with those flags works.

But I think the webm output file is corrupt:
original
webm output

Same output for other video formats. I also noticed encoding will fail if I open the video through finder instead of the command line.

from mpv-webm.

nickbudi avatar nickbudi commented on May 28, 2024

Setting the script to use to libvpx-v9 instead of libvpx fixed everything.

from mpv-webm.

ekisu avatar ekisu commented on May 28, 2024

Could you try encoding it with ffmpeg, as described here? Using VP8 alone shouldn't be the reason why it's producing such broken files.

from mpv-webm.

nickbudi avatar nickbudi commented on May 28, 2024

using -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis is working, but VP8 from the script is still broken

from mpv-webm.

ekisu avatar ekisu commented on May 28, 2024

I'm running out of ideas here, sadly I don't have a Mac to try this myself. Does modifying the 1/2-pass setting change anything? Maybe VP8 can't, for some reason, use/write the first pass log file. Also, if you execute the mpv encoding command on the terminal again, does anything change (for both 1 and 2 pass variations)?

Please post logs if you find them necessary/somewhat useful.

from mpv-webm.

nickbudi avatar nickbudi commented on May 28, 2024

As far as my issues go single or two pass doesn't matter. I figured out the VP8 corruption is caused by libvpx_threads being set to anything other than 1 (default 4), so I can get a proper webm files with VP8, but only if I open the video through a terminal.

When I open a video through finder instead of the terminal encoding fails. The mpv command being run for both terminal and finder processes are the same though, and running the mpv command separately works so I'm stumped there. And switching to VP9 and encoding through finder works, including libvpx_threads=4.

Don't think this is helpful but here's the relevant part of the log from encoding through finder with twopass=false:

[   4.632][i][webm] Encoding to ~/small-[00_01.066-00_02.866]-audio.webm
[   4.632][v][webm] Command line: mpv ~/small.mp4 --start=0:00:01.066 --end=0:00:02.866 --ovc=libvpx --oac=libvorbis --vid=1 --aid=1 --sid=no --vf lavfi=[colormatrix=bt709:bt601] --ovcopts-add=threads=1 --ovcopts-add=b=11111k --ovcopts-add=crf=10 -o=~/small-[00_01.066-00_02.866]-audio.webm
[   4.632][v][cplayer] Run command: show-text, flags=0, args=[�Started encode..., 5000, 0]
[   4.643][v][osd/libass] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 1.5.1 (COMPLEX)
[   4.643][v][osd/libass] Setting up fonts...
[   4.644][v][osd/libass] Using font provider coretext
[   4.644][v][osd/libass] Done.
[   4.647][v][osd/libass] fontselect: (sans-serif, 400, 0) -> /System/Library/Fonts/Helvetica.ttc, -1, Helvetica
[   4.649][v][vo/opengl] Reallocating OSD texture to 512x128.
[   4.724][v][cplayer] Run command: script-binding, flags=9, args=[webm/e]
[   4.739][v][cplayer] Run command: show-text, flags=0, args=[�Encode failed! Check the logs for details., 5000, 0]
[   4.744][v][vo/opengl] Reallocating OSD texture to 1024x128.
[   4.826][v][lavf] EOF reached.
[   5.508][v][cplayer] Run command: quit, flags=9, args=[0]
[   5.508][v][cplayer] EOF code: 6

from mpv-webm.

ekisu avatar ekisu commented on May 28, 2024

I've updated the script to produce better logging. Please try it out and post logs.

Edit: if the libvpx_threads issue occurs even when using ffmpeg directly, you might consider opening a bug on their tracker.

from mpv-webm.

nickbudi avatar nickbudi commented on May 28, 2024

Ah you're right the threads issue lies with ffmpeg. I'll open a bug report with them.

I noticed with your last update encoding failure prints success and vice versa.
Here's the updated log when encoding through finder

[  17.771][i][webm] Encoding to ~/small-[00_01.900-00_03.733]-audio.webm
[  17.771][v][webm] Command line: mpv ~/small.mp4 --start=0:00:01.900 --end=0:00:03.733 --ovc=libvpx --oac=libvorbis --vid=1 --aid=1 --sid=no --vf lavfi=[colormatrix=bt709:bt601] --ovcopts-add=threads=1 --ovcopts-add=b=10909k --ovcopts-add=crf=10 -o=~/small-[00_01.900-00_03.733]-audio.webm
[  17.771][v][cplayer] Run command: show-text, flags=0, args=[�Started encode..., 5000, 0]
[  17.870][v][webm] Command failed! Reason:  nil  Killed by us?  no
[  17.870][v][webm] Command stdout:
[  17.870][v][webm]
[  17.870][v][cplayer] Run command: show-text, flags=0, args=[�Encoded successfully! Saved to\N{\b1}~/small-[00_01.900-00_03.733]-audio.webm{\b0}, 5000, 0]

from mpv-webm.

ekisu avatar ekisu commented on May 28, 2024

I noticed with your last update encoding failure prints success and vice versa.

Fixed that.

Anyway, I think this might be, somehow, related to mpv not allowing multiple instances under macOS (mpv-player/mpv#1377) when using the app bundle (the Terminal allows you to run as many instances as you like). But, because it works when libvpx-vp9 is used, I'm not entirely sure why that would matter. I'll try wrapping it on a bash instance or something.

Edit: try this and this, you should find 2 files named "encode-log.log" on your home dir, please upload them.

from mpv-webm.

ekisu avatar ekisu commented on May 28, 2024

Closed, seems to be working as of now (see #13).

from mpv-webm.

Related Issues (20)

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.