Open anoniniarz opened 7 months ago
Managed to make MP4 work by adding brew's ffmpeg to PATH again, but MP3 still does not work
EDIT: nevermind, it does not work again, even tho PATH is set correctly. I am tired of this system
Running into this same error. Did you solve this, @anoniniarz? Any ideas, @ekisu?
Running into this same error. Did you solve this, @anoniniarz? Any ideas, @ekisu?
I did not solve it, currently I am just converting to webm and then use ffmpeg to conver to mp4 when I need it. :(
Looking into this more. I'm able to replicate it just by running the same command manually in my Terminal. The error is:
[encode] codec 'libx264' not found.
Which means it seems to be a specific problem with the --ovc=libx264
parameter. mpv documentation defines that command as "Specifies the output video codec. See --ovc=help
for a full list of supported codecs.". Running that command lists these codecs for me:
Available output video codecs:
--ovc=a64multi Multicolor charset for Commodore 64
--ovc=a64multi5 Multicolor charset for Commodore 64, extended with 5th color (colram)
--ovc=alias_pix Alias/Wavefront PIX image
--ovc=amv AMV Video
--ovc=apng APNG (Animated Portable Network Graphics) image
--ovc=asv1 ASUS V1
--ovc=asv2 ASUS V2
--ovc=avrp Avid 1:1 10-bit RGB Packer
--ovc=avui Avid Meridien Uncompressed
--ovc=ayuv Uncompressed packed MS 4:4:4:4
--ovc=bitpacked Bitpacked
--ovc=bmp BMP (Windows and OS/2 bitmap)
--ovc=cfhd GoPro CineForm HD
--ovc=cinepak Cinepak
--ovc=cljr Cirrus Logic AccuPak
--ovc=dnxhd VC3/DNxHD
--ovc=dpx DPX (Digital Picture Exchange) image
--ovc=dvvideo DV (Digital Video)
--ovc=exr OpenEXR image
--ovc=ffv1 FFmpeg video codec #1
--ovc=ffvhuff Huffyuv FFmpeg variant
--ovc=fits Flexible Image Transport System
--ovc=flashsv Flash Screen Video
--ovc=flashsv2 Flash Screen Video Version 2
--ovc=flv FLV / Sorenson Spark / Sorenson H.263 (Flash Video)
--ovc=gif GIF (Graphics Interchange Format)
--ovc=h261 H.261
--ovc=h263 H.263 / H.263-1996
--ovc=h263p H.263+ / H.263-1998 / H.263 version 2
--ovc=huffyuv Huffyuv / HuffYUV
--ovc=jpeg2000 JPEG 2000
--ovc=jpegls JPEG-LS
--ovc=ljpeg Lossless JPEG
--ovc=magicyuv MagicYUV video
--ovc=mjpeg MJPEG (Motion JPEG)
--ovc=mpeg1video MPEG-1 video
--ovc=mpeg2video MPEG-2 video
--ovc=mpeg4 MPEG-4 part 2
--ovc=msmpeg4v2 MPEG-4 part 2 Microsoft variant version 2
--ovc=msmpeg4 MPEG-4 part 2 Microsoft variant version 3
--ovc=msvideo1 Microsoft Video-1
--ovc=pam PAM (Portable AnyMap) image
--ovc=pbm PBM (Portable BitMap) image
--ovc=pcx PC Paintbrush PCX image
--ovc=pfm PFM (Portable FloatMap) image
--ovc=pgm PGM (Portable GrayMap) image
--ovc=pgmyuv PGMYUV (Portable GrayMap YUV) image
--ovc=phm PHM (Portable HalfFloatMap) image
--ovc=png PNG (Portable Network Graphics) image
--ovc=ppm PPM (Portable PixelMap) image
--ovc=prores Apple ProRes
--ovc=prores_aw Apple ProRes
--ovc=prores_ks Apple ProRes (iCodec Pro)
--ovc=qoi QOI (Quite OK Image format) image
--ovc=qtrle QuickTime Animation (RLE) video
--ovc=r10k AJA Kona 10-bit RGB Codec
--ovc=r210 Uncompressed RGB 10-bit
--ovc=rawvideo raw video
--ovc=roqvideo id RoQ video
--ovc=rpza QuickTime video (RPZA)
--ovc=rv10 RealVideo 1.0
--ovc=rv20 RealVideo 2.0
--ovc=sgi SGI image
--ovc=smc QuickTime Graphics (SMC)
--ovc=snow Snow
--ovc=speedhq NewTek SpeedHQ
--ovc=sunrast Sun Rasterfile image
--ovc=svq1 Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1
--ovc=targa Truevision Targa image
--ovc=tiff TIFF image
--ovc=utvideo Ut Video
--ovc=v210 Uncompressed 4:2:2 10-bit
--ovc=v308 Uncompressed packed 4:4:4
--ovc=v408 Uncompressed packed QT 4:4:4:4
--ovc=v410 Uncompressed 4:4:4 10-bit
--ovc=vbn Vizrt Binary Image
--ovc=vc2 SMPTE VC-2
--ovc=wrapped_avframe AVFrame to AVPacket passthrough
--ovc=wmv1 Windows Media Video 7
--ovc=wmv2 Windows Media Video 8
--ovc=xbm XBM (X BitMap) image
--ovc=xface X-face image
--ovc=xwd XWD (X Window Dump) image
--ovc=y41p Uncompressed YUV 4:1:1 12-bit
--ovc=yuv4 Uncompressed packed 4:2:0
--ovc=zlib LCL (LossLess Codec Library) ZLIB
--ovc=zmbv Zip Motion Blocks Video
--ovc=libopenjpeg OpenJPEG JPEG 2000
--ovc=libvpx libvpx VP8
--ovc=libvpx-vp9 libvpx VP9
--ovc=h264_videotoolbox VideoToolbox H.264 Encoder
--ovc=hevc_videotoolbox VideoToolbox H.265 Encoder
--ovc=prores_videotoolbox VideoToolbox ProRes Encoder
I'm also at a loss as to why libx264 is not here. Googling "mpv" and "libx264" together only return this Reddit post which I presume is by you or someone else with the exact same issue.
I will note that since "h264_videotoolbox" is installed, you can change line 1059 of the .lua (self.videoCodec = ...
) to use this codec instead, which works for my purposes, and indeed results in an .mp4 output file. But technically that is using H.264 and not x264.
Yeah, that was my post. I am lost too why mpv cannot access libx264 codec, I thought that there is a problem with PATH (since I was sometimes able to convert to mp4 when running mpv from terminal), but i am unable to reproduce it reliably and I think my PATH is set correct
I will note that since "h264_videotoolbox" is installed, you can change line 1059 of the .lua (self.videoCodec = ...) to use this codec instead, which works for my purposes, and indeed results in an .mp4 output file. But technically that is using H.264 and not x264.
this sounds great. I will check it out. Good job!
I'd say it really boils down to whether the mpv build you've obtained was compiled with an FFmpeg with support for x264.
As mpv does not directly uses the ffmpeg
system binary, but the libavcodec libraries, it's very possible that those libraries are in a separate instalation (maybe linked statically with the mpv binary, maybe linked dynamically but in a different location from your system ffmpeg
), so you'd need to investigate how your mpv build was packaged. You could verify if the installations are different by running ffmpeg -version
and seeing if the versions differ from the ones in mpv --version
As the h264_videotoolbox
codec is available, I could make the script use it as a fallback if x264
isn't available, although I don't really know if it's as good as x264
mpv version and platform
macOS Sonoma 14.3.1
Description
mpv cannot find libx264 and libmp3lame when encoding, suprisingly enough Webm-VP9 works fine so it is somehow communicating with ffmpeg. When I manually encode with libx264 in terminal with ffmpeg everything works correctly.
libx264 is listed in both codecs and encoders after running ffmpeg -encoders and ffmpeg -codecs
V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
V....D libx264rgb libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
V....D h264_videotoolbox VideoToolbox H.264 Encoder (codec h264)
and is enabled with --enable-libx264, same with libmp3lame
but log says [ 7.858][v][webm] "[encode] codec 'libx264' not found."
Log file
https://pastebin.com/YZsiZPAV