dfaker / WebmGenerator

UI and Automation to cut, filter and join high quality webms, mp4s or gifs.
Mozilla Public License 2.0
524 stars 33 forks source link

Linux mentioned, but not possible to get working? #108

Closed spacelama closed 3 months ago

spacelama commented 1 year ago

There's several mentions on Linux/ubuntu etc in eg README.md, but judging from requirements.txt, this is never going to work with the dependency on pywin32 and inherent dependencies on things such as mpv-2.dll. Looking at git log/git blame, it looks like linux has been an afterthought since well before 4420ee3 and maybe all the way back to v2.1.4 (which I couldn't get pip3 install -r requirements.txt to run anyway).

If it's no longer a consideration, maybe that should be clarified in README.md.

dfaker commented 1 year ago

The win32 module is only used for supporting long and network hosted files on Windows, and the import is skipped on other platforms.

And yes on Linux it's the .so version of the library not the .dll, support for either us handled by pythonmpv.

Looks like removing the win32 line from the requirements.txt should get it all installing for you. I'll see about adding in a Linux specific requirements.txt

spacelama commented 1 year ago

OK, I had further problems when I tried that originally, but didn't realise most of the python stack dumps were from code paths that were try/excepted. Still unable to test probably because of my libmpv version (libmpv1) - I can't test that until I'm in a position to update my workstation from debian oldstable. (install instructions for linux could probably do with a note to ensure apt install libmpv2 or equivalent if available)

LeKite commented 10 months ago

Is it still not possible to run this on Linux? I recently put Manjaro and I'd love to have this on it. I really like the tool.

dfaker commented 8 months ago

@LeKite I've added a requirements-linux.txt now skipping the win32 dependency, that along with libmpv2 should be all you need, give it a go and if you get any failures we'll see what additional guidance we need to add to a linux install note.

LeKite commented 7 months ago

Mmm im very stupid to know how to make it run though. An AUR package would be awesome

broconut123 commented 5 months ago

Haven't used this program in a while but I cloned it today and i'm unable to get it to work. Using arch linux.

`(webms) x@zxc ~/WebmGenerator (master)> python webmGenerator.py Initial working directory /home/x/WebmGenerator Current working directory /home/x/WebmGenerator 2024-06-17 21:32:50,196 [MainThread ] [INFO ] Startup. /home/x/WebmGenerator/src /home/x/WebmGenerator/webms/bin module 'os' has no attribute 'add_dll_directory' 2024-06-17 21:32:50,210 [MainThread ] [ERROR] win32api getShortPathName Exception Traceback (most recent call last): File "/home/x/WebmGenerator/src/encodingUtils.py", line 26, in import win32api ModuleNotFoundError: No module named 'win32api' /home/x/WebmGenerator/src /home/x/WebmGenerator/webms/bin module 'os' has no attribute 'add_dll_directory' 2024-06-17 21:32:50,301 [MainThread ] [INFO ] data registered as img_not_supported No module named 'webrtcvad' cleanInitialFiles {} [] 2024-06-17 21:32:50,383 [MainThread ] [ERROR] Zoomed state not avaliable, possibly on some linux distros? Traceback (most recent call last): File "/home/x/WebmGenerator/src/webmGeneratorUi.py", line 224, in init self.master.state('zoomed') File "/usr/lib/python3.12/tkinter/init.py", line 2295, in wm_state return self.tk.call('wm', 'state', self._w, newstate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _tkinter.TclError: bad argument "zoomed": must be normal, iconic, or withdrawn Failed to load player bg image couldn't open ".\resources\playerbg.png": no such file or directory 2024-06-17 21:32:50,494 [MainThread ] [ERROR] Startup Exception Traceback (most recent call last): File "/home/x/WebmGenerator/webmGenerator.py", line 32, in webmGenerator = WebmGeneratorController(initialFiles) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/x/WebmGenerator/src/webmGeneratorController.py", line 247, in init self.cutselectionController = CutselectionController(self.cutselectionUi, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/x/WebmGenerator/src/cutselectionController.py", line 28, in init self.initialisePlayer() File "/home/x/WebmGenerator/src/cutselectionController.py", line 302, in initialisePlayer self.player = mpv.MPV(wid=str(int(playerFrameWid)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/x/WebmGenerator/webms/lib/python3.12/site-packages/mpv.py", line 861, in init _mpv_set_optionstring(self.handle, k.replace('', '-').encode('utf-8'), istr(v).encode('utf-8')) File "/home/x/WebmGenerator/webms/lib/python3.12/site-packages/mpv.py", line 142, in raise_for_ec raise ex ValueError: ('Invalid value for mpv option', -7, (<MpvHandle object at 0x788630b17e50>, b'background', b'#282828')) 2024-06-17 21:32:50,496 [MainThread ] [ERROR] Traceback (most recent call last): File "/home/x/WebmGenerator/webmGenerator.py", line 32, in webmGenerator = WebmGeneratorController(initialFiles) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/x/WebmGenerator/src/webmGeneratorController.py", line 247, in init self.cutselectionController = CutselectionController(self.cutselectionUi, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/x/WebmGenerator/src/cutselectionController.py", line 28, in init self.initialisePlayer() File "/home/x/WebmGenerator/src/cutselectionController.py", line 302, in initialisePlayer self.player = mpv.MPV(wid=str(int(playerFrameWid)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/x/WebmGenerator/webms/lib/python3.12/site-packages/mpv.py", line 861, in init _mpv_set_optionstring(self.handle, k.replace('', '-').encode('utf-8'), istr(v).encode('utf-8')) File "/home/x/WebmGenerator/webms/lib/python3.12/site-packages/mpv.py", line 142, in raise_for_ec raise ex ValueError: ('Invalid value for mpv option', -7, (<MpvHandle object at 0x788630b17e50>, b'background', b'#282828'))

2024-06-17 21:32:50,496 [MainThread ] [INFO ] DONE `

dfaker commented 5 months ago

@broconut123 That background property was renamed in the last mpv release, patched now in #111

broconut123 commented 5 months ago

@dfaker thanks!

LeKite commented 5 months ago

@broconut123 hey buddy I saw you're using Arch.. would you help me make this run? ;w;

broconut123 commented 5 months ago

@broconut123 hey buddy I saw you're using Arch.. would you help me make this run? ;w;

Sure. Install tk and possibly mpv with aur helper yay or paru

paru -S tk mpv

cd into the webmgenerator folder

make a virtual environment https://wiki.archlinux.org/title/Python/Virtual_environment python -m venv envname then activate environment with source envname/bin/activate then pip install -r requirements-linux.txt then run it with python webmGenerator.py

LeKite commented 5 months ago

@broconut123 hey buddy I saw you're using Arch.. would you help me make this run? ;w;

Sure. Install tk and possibly mpv with aur helper yay or paru

paru -S tk mpv

cd into the webmgenerator folder

make a virtual environment https://wiki.archlinux.org/title/Python/Virtual_environment

python -m venv envname

then activate environment with

source envname/bin/activate

then

pip install -r requirements-linux.txt

then run it with

python webmGenerator.py

I will try this asap. Is mpv from AUR needed? I think I run it from arch repo

LeKite commented 5 months ago

@broconut123 hey buddy I saw you're using Arch.. would you help me make this run? ;w;

Sure. Install tk and possibly mpv with aur helper yay or paru

paru -S tk mpv

cd into the webmgenerator folder

make a virtual environment https://wiki.archlinux.org/title/Python/Virtual_environment python -m venv envname then activate environment with source envname/bin/activate then pip install -r requirements-linux.txt then run it with python webmGenerator.py

Holy it worked! Thanks! This should be added as a Linux installation guide by @dfaker Imo! Thanks a lot I really missed this on Arch :)

LeKite commented 4 months ago

@dfaker hey sorry to bump this again, but I am getting this error with every file I try to render

b'\rframe=  108 fps=108 q=17.0 size=   16128KiB time=00:00:04.42 bitrate=29884.3kbits/s speed=4.41x    '
b'\rframe=  176 fps=117 q=17.0 size=   26624KiB time=00:00:07.25 bitrate=30053.3kbits/s speed=4.83x    '
b'\rframe=  235 fps=117 q=17.0 size=   35840KiB time=00:00:09.71 bitrate=30212.0kbits/s speed=4.85x    '
b'\rframe=  296 fps=118 q=17.0 size=   45824KiB time=00:00:12.30 bitrate=30509.7kbits/s speed=4.91x    '
b'\rframe=  358 fps=119 q=17.0 size=   56320KiB time=00:00:14.84 bitrate=31072.8kbits/s speed=4.94x    '
b'\rframe=  417 fps=119 q=17.0 size=   66048KiB time=00:00:17.30 bitrate=31259.3kbits/s speed=4.94x    '
b'\rframe=  480 fps=120 q=17.0 size=   76544KiB time=00:00:19.93 bitrate=31452.2kbits/s speed=4.98x    '
b'\rframe=  538 fps=119 q=17.0 size=   86272KiB time=00:00:22.35 bitrate=31613.5kbits/s speed=4.96x    '
b'\rframe=  598 fps=119 q=17.0 size=   96768KiB time=00:00:24.85 bitrate=31889.9kbits/s speed=4.96x    '
b'\rframe=  659 fps=119 q=17.0 size=  107264KiB time=00:00:27.40 bitrate=32066.8kbits/s speed=4.97x    '
allowableTargetSizeUnderrun 0.15
sizeLimitMax 4194304.0
sizeLimitMin 3565158.4
Encoding final 2352718937_8.webm 0.48717948717948717
------
sizeLimitMax 4194304.0
targetSizeMedian 3879731.2
sizeLimitMin 3565158.4
dependentValueMaximum 6144000.0
val 982863.2106666667
------
VP9 targetWidth: 1280
VP9 tileColumns: 1
Ffmpeg command: ffmpeg -y -i tempVideoFiles/0_2352718937mp4_4.824177741514362_34.82417774151436_9149d78ba7_1720869227_0.mp4 -filter_complex_script tempVideoFiles/filters_8.txt -map [outvfinal] -map [outa] -pass 1 -passlogfile tempVideoFiles/encoder_8.log -shortest -copyts -start_at_zero -c:v libvpx-vp9 -c:a libopus -stats -pix_fmt yuv420p -threads 4 -auto-alt-ref 6 -lag-in-frames 25 -quality good -psnr -row-mt 1 -tile-columns 1 -tile-rows 0 -arnr-maxframes 7 -arnr-strength 5 -aq-mode 0 -tune-content film -enable-tpl 1 -frame-parallel 0 -metadata Title=2352718937 WmG -b:v 982863 -an -sn -f null /dev/null
None None
Complete Pass 1 Stats Pass 2  tempVideoFiles/2352718937_8.webm 0.48717948717948717
VP9 targetWidth: 1280
VP9 tileColumns: 1
Ffmpeg command: ffmpeg -y -i tempVideoFiles/0_2352718937mp4_4.824177741514362_34.82417774151436_9149d78ba7_1720869227_0.mp4 -filter_complex_script tempVideoFiles/filters_8.txt -map [outvfinal] -map [outa] -pass 2 -passlogfile tempVideoFiles/encoder_8.log -shortest -copyts -start_at_zero -c:v libvpx-vp9 -c:a libopus -stats -pix_fmt yuv420p -threads 4 -auto-alt-ref 6 -lag-in-frames 25 -speed 1 -quality good -psnr -row-mt 1 -tile-columns 1 -tile-rows 0 -arnr-maxframes 7 -arnr-strength 5 -aq-mode 0 -tune-content film -enable-tpl 1 -frame-parallel 0 -metadata Title=2352718937 WmG -b:v 982863 -ac 1 -ar 48k -b:a 65536 -sn tempVideoFiles/2352718937_8.webm
None None
Complete Pass 1 Encode Pass 2  tempVideoFiles/2352718937_8.webm 0.7435897435897436
2024-07-13 13:22:40,580 [Thread-6 (en] [ERROR]  unhandled CONCAT exception
Traceback (most recent call last):
  File "/home/beki/WebmGenerator/src/ffmpegService.py", line 1448, in encodeWorker
    encodeConcat(tempPathname,outputPathName,runNumber,requestId,mode,seqClips,options,filenamePrefix,statusCallback)
  File "/home/beki/WebmGenerator/src/ffmpegService.py", line 1417, in encodeConcat
    finalEncoder(inputsList,
  File "/home/beki/WebmGenerator/src/encoders/webmvp9Encoder.py", line 253, in encoder
    finalFilenameConfirmed = optimiser(encoderFunction=encoderFunction,
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/beki/WebmGenerator/src/optimisers/linear.py", line 54, in encodeTargetingSize
    finalSize,lastpsnr,returnCode = encoderFunction(val,passCount,passReason,passPhase=2,requestId=requestId,widthReduction=widthReduction,cqMode=cqMode)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/beki/WebmGenerator/src/encoders/webmvp9Encoder.py", line 235, in encoderFunction
    finalSize = os.stat(tempVideoFilePath).st_size
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'tempVideoFiles/2352718937_8.webm'
`
LeKite commented 4 months ago

I have to add, I made webms previously with this method on Arch...

dfaker commented 4 months ago

@LeKite not really enough to go on there apart from ffmpeg is failing to produce a file.

"previously with this method" could mean anything!

Is this for all encode types? (mp4 and VP8 webm too for example), do you have any filters applied?

What ffmpeg version do you have installed?

LeKite commented 4 months ago

@LeKite not really enough to go on there apart from ffmpeg is failing to produce a file.

"previously with this method" could mean anything!

Is this for all encode types? (mp4 and VP8 webm too for example), do you have any filters applied?

What ffmpeg version do you have installed?

Sorry. To clarify. This method means on arch with the installation provided from the other user.. anyway no filters. Happens with mp4 rendering and vp9 webm at least. I can try more and give you any info you ask me

dfaker commented 4 months ago

Does seem like the ffmpeg version mismatch in that case, please run a ffmpeg -version and confirm what you're running.

LeKite commented 4 months ago

Hello @dfaker thanks for your reply. ffmpeg version n7.0.1 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14.1.1 (GCC) 20240522 configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-mbedtls --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan libavutil 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat 61. 1.100 / 61. 1.100 libavdevice 61. 1.100 / 61. 1.100 libavfilter 10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc 58. 1.100 / 58. 1.100

Here we go!

dfaker commented 4 months ago

All seems correct, try running those Ffmpeg commands it's printing into the console in the same wording dir as WmG and see what the internal failure in ffmpeg is.

You'll need to get the console output from a running instance of WmG and make sure to keep WmG open so it doesn't delete the temporary files.

LeKite commented 4 months ago

image Hello, even without making ffmpeg test you told me about, I see that the file is not present in the folder.

FileNotFoundError: [Errno 2] No such file or directory: 'tempVideoFiles/dHisueOMr-k-3Fig_3.webm'

While in the folder I have this as you can see /home/beki/WebmGenerator/tempVideoFiles/0_dHisueOMr-k-3Figmp4_0.0_11.586757369614512_9149d78ba7_1721060907_0.mp4

Is this of any help?

This is my whole terminal


------
['ffmpeg', '-y', '-i', 'tempVideoFiles/0_dHisueOMr-k-3Figmp4_0.0_11.586757369614512_9149d78ba7_1721060907_0.mp4', '-filter_complex_script', 'tempVideoFiles/filters_3.txt', '-map', '[outvfinal]', '-map', '[outa]', '-pass', '1', '-passlogfile', 'tempVideoFiles/encoder_3.log', '-shortest', '-slices', '8', '-copyts', '-start_at_zero', '-c:v', 'libvpx', '-c:a', 'libvorbis', '-stats', '-pix_fmt', 'yuv420p', '-bufsize', '5357458', '-threads', '4', '-crf', '4', '-auto-alt-ref', '1', '-lag-in-frames', '25', '-deadline', 'best', '-slices', '8', '-cpu-used', '16', '-psnr', '-movflags', '+faststart', '-f', 'webm', '-metadata', 'title=dHisueOMr-k-3Fig WmG', '-metadata', 'WritingApp=WebmGenerator v3.41.1', '-metadata', 'DateUTC=2024-07-15T16:29:10.308536']
None None
Complete Pass 1 Stats Pass 2  tempVideoFiles/dHisueOMr-k-3Fig_3.webm 0.5
['ffmpeg', '-y', '-i', 'tempVideoFiles/0_dHisueOMr-k-3Figmp4_0.0_11.586757369614512_9149d78ba7_1721060907_0.mp4', '-filter_complex_script', 'tempVideoFiles/filters_3.txt', '-map', '[outvfinal]', '-map', '[outa]', '-pass', '2', '-passlogfile', 'tempVideoFiles/encoder_3.log', '-shortest', '-slices', '8', '-copyts', '-start_at_zero', '-c:v', 'libvpx', '-c:a', 'libvorbis', '-stats', '-pix_fmt', 'yuv420p', '-bufsize', '5357458', '-threads', '4', '-crf', '4', '-auto-alt-ref', '1', '-lag-in-frames', '25', '-deadline', 'best', '-slices', '8', '-cpu-used', '16', '-psnr', '-movflags', '+faststart', '-f', 'webm', '-metadata', 'title=dHisueOMr-k-3Fig WmG', '-metadata', 'WritingApp=WebmGenerator v3.41.1', '-metadata', 'DateUTC=2024-07-15T16:29:10.349243']
None None
Complete Pass 1 Encode Pass 2  tempVideoFiles/dHisueOMr-k-3Fig_3.webm 0.75
2024-07-15 18:29:10,388 [Thread-6 (en] [ERROR]  unhandled CONCAT exception
Traceback (most recent call last):
  File "/home/beki/WebmGenerator/src/ffmpegService.py", line 1448, in encodeWorker
    encodeConcat(tempPathname,outputPathName,runNumber,requestId,mode,seqClips,options,filenamePrefix,statusCallback)
  File "/home/beki/WebmGenerator/src/ffmpegService.py", line 1417, in encodeConcat
    finalEncoder(inputsList,
  File "/home/beki/WebmGenerator/src/encoders/webmvp8Encoder.py", line 193, in encoder
    finalFilenameConfirmed = optimiser(encoderFunction=encoderFunction,
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/beki/WebmGenerator/src/optimisers/linear.py", line 54, in encodeTargetingSize
    finalSize,lastpsnr,returnCode = encoderFunction(val,passCount,passReason,passPhase=2,requestId=requestId,widthReduction=widthReduction,cqMode=cqMode)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/beki/WebmGenerator/src/encoders/webmvp8Encoder.py", line 176, in encoderFunction
    finalSize = os.stat(tempVideoFilePath).st_size
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'tempVideoFiles/dHisueOMr-k-3Fig_3.webm'
dfaker commented 4 months ago

in that case the question is why isn't the prior command producing an output file.

LeKite commented 4 months ago

in that case the question is why isn't the prior command producing an output file.

... do I do the same thing as you previously explained?

Mojavve commented 3 months ago

I'm running into the same FileNotFoundError: [Errno 2] No such file or directory issue. The encode gets stuck at 75% and the errors are the same ( [Thread-6 (en] [ERROR] unhandled CONCAT exception and then the no such file error) ffmpeg version n7.0.1 Arch Linux I've encoded hundreds of vp9 webms using WmG previously on the same setup. cloned the repo today

Trying to encode an h.264 mp4 with the filename test.mp4 to vp9 webm.

At the time of the error, my tempVideoFiles folder has filters_1.txt along with 0_testmp4_0.0_1.0010000000000001_c0a5150cb0_1722805269_0.mp4 but no log file despite it claiming it finished pass 1.

Trying to run the ffmpeg commands given

ffmpeg -y -i tempVideoFiles/0_testmp4_0.0_1.0010000000000001_c0a5150cb0_1722805269_0.mp4 -filter_complex_script tempVideoFiles/filters_1.txt -map [outvfinal] -pass 1 -passlogfile tempVideoFiles/encoder_1.log -shortest -copyts -start_at_zero -c:v libvpx-vp9 -c:a libopus -stats -pix_fmt yuv420p -threads 4 -auto-alt-ref 6 -lag-in-frames 25 -quality good -psnr -row-mt 1 -tile-columns 1 -tile-rows 0 -arnr-maxframes 7 -arnr-strength 5 -aq-mode 0 -tune-content film -enable-tpl 1 -frame-parallel 0 -metadata Title=test WmG -b:v 6144000.0 -an -sn -f null /dev/null

I get zsh: no matches found: [outvfinal] Assuming this is just a formatting error with my shell I put it in quotations. Next I get Unrecognized option 'psnr'. if I remove the psnr flag I get [AVFormatContext @ 0x63c31e0e5900] Unable to choose an output format for 'WmG'; use a standard extension for the filename or specify the format manually. [out#0 @ 0x63c31e0a5b00] Error initializing the muxer for WmG: Invalid argument Error opening output file WmG. Error opening output files: Invalid argument I assume this is also just a weird formatting error with the title metadata and my shell so I put that in quotations.

After that, it did work. It created a log, and I then continued to run the 2nd pass command after fixing it up in the same way (adding quotations, removing -psnr):

ffmpeg -y -i tempVideoFiles/0_testmp4_0.0_1.0010000000000001_c0a5150cb0_1722805269_0.mp4 -filter_complex_script tempVideoFiles/filters_1.txt -map "[outvfinal]" -pass 2 -passlogfile tempVideoFiles/encoder_1.log -shortest -copyts -start_at_zero -c:v libvpx-vp9 -c:a libopus -stats -pix_fmt yuv420p -threads 4 -auto-alt-ref 6 -lag-in-frames 25 -speed 1 -quality good -row-mt 1 -tile-columns 1 -tile-rows 0 -arnr-maxframes 7 -arnr-strength 5 -aq-mode 0 -tune-content film -enable-tpl 1 -frame-parallel 0 -metadata Title="test WmG" -b:v 6144000.0 -an -sn tempVideoFiles/test_1.webm

and it worked as well although the output webm was extremely low bitrate for whatever reason. I'm not super familiar with what the PSNR option is supposed to do so maybe the quality is related to removing that?

I know most of this was me adjusting for zsh but I wanted to thoroughly explain all of my steps. psnr being an unrecognized option seemed to be the only real roadblock.

If there's anything else I can supply let me know.

dfaker commented 3 months ago

@Mojavve very helpful I saw that was being deprecated but isn't yet gone on my version, will toggle that to the new option.

LeKite commented 3 months ago

I'm running into the same FileNotFoundError: [Errno 2] No such file or directory issue. The encode gets stuck at 75% and the errors are the same ( [Thread-6 (en] [ERROR] unhandled CONCAT exception and then the no such file error) ffmpeg version n7.0.1 Arch Linux I've encoded hundreds of vp9 webms using WmG previously on the same setup. cloned the repo today

Trying to encode an h.264 mp4 with the filename test.mp4 to vp9 webm.

At the time of the error, my tempVideoFiles folder has filters_1.txt along with 0_testmp4_0.0_1.0010000000000001_c0a5150cb0_1722805269_0.mp4 but no log file despite it claiming it finished pass 1.

Trying to run the ffmpeg commands given

ffmpeg -y -i tempVideoFiles/0_testmp4_0.0_1.0010000000000001_c0a5150cb0_1722805269_0.mp4 -filter_complex_script tempVideoFiles/filters_1.txt -map [outvfinal] -pass 1 -passlogfile tempVideoFiles/encoder_1.log -shortest -copyts -start_at_zero -c:v libvpx-vp9 -c:a libopus -stats -pix_fmt yuv420p -threads 4 -auto-alt-ref 6 -lag-in-frames 25 -quality good -psnr -row-mt 1 -tile-columns 1 -tile-rows 0 -arnr-maxframes 7 -arnr-strength 5 -aq-mode 0 -tune-content film -enable-tpl 1 -frame-parallel 0 -metadata Title=test WmG -b:v 6144000.0 -an -sn -f null /dev/null

I get zsh: no matches found: [outvfinal] Assuming this is just a formatting error with my shell I put it in quotations. Next I get Unrecognized option 'psnr'. if I remove the psnr flag I get [AVFormatContext @ 0x63c31e0e5900] Unable to choose an output format for 'WmG'; use a standard extension for the filename or specify the format manually. [out#0 @ 0x63c31e0a5b00] Error initializing the muxer for WmG: Invalid argument Error opening output file WmG. Error opening output files: Invalid argument I assume this is also just a weird formatting error with the title metadata and my shell so I put that in quotations.

After that, it did work. It created a log, and I then continued to run the 2nd pass command after fixing it up in the same way (adding quotations, removing -psnr):

ffmpeg -y -i tempVideoFiles/0_testmp4_0.0_1.0010000000000001_c0a5150cb0_1722805269_0.mp4 -filter_complex_script tempVideoFiles/filters_1.txt -map "[outvfinal]" -pass 2 -passlogfile tempVideoFiles/encoder_1.log -shortest -copyts -start_at_zero -c:v libvpx-vp9 -c:a libopus -stats -pix_fmt yuv420p -threads 4 -auto-alt-ref 6 -lag-in-frames 25 -speed 1 -quality good -row-mt 1 -tile-columns 1 -tile-rows 0 -arnr-maxframes 7 -arnr-strength 5 -aq-mode 0 -tune-content film -enable-tpl 1 -frame-parallel 0 -metadata Title="test WmG" -b:v 6144000.0 -an -sn tempVideoFiles/test_1.webm

and it worked as well although the output webm was extremely low bitrate for whatever reason. I'm not super familiar with what the PSNR option is supposed to do so maybe the quality is related to removing that?

I know most of this was me adjusting for zsh but I wanted to thoroughly explain all of my steps. psnr being an unrecognized option seemed to be the only real roadblock.

If there's anything else I can supply let me know.

Now that you mention it. I may have swapped from bash to zsh and the error started occurring.

dfaker commented 3 months ago

PSNR flag changed in master now.

LeKite commented 3 months ago

PSNR flag changed in master now.

I can confirm it worked, but the result is very bad. image

This is a 30second clip, webm VP9 with audio. rez is 720p. Is this normal behavior?

LeKite commented 3 months ago

image Another 16 second clip from instagram

dfaker commented 3 months ago

Yep that definitely seems worse than expected, I'll need to bisect the ffmpeg versions.

dfaker commented 3 months ago

seemingly an ffmpeg 2-pass regression

dfaker commented 3 months ago

@LeKite okay that seems a lot prettier try a fresh pull.

LeKite commented 3 months ago

Hello, I just did a fresh pull and tried again... image Not very different..

dfaker commented 3 months ago

@LeKite Very strange, this is master and ffmpeg version 2024-08-01-git-bcf08c1171 encoding https://www.youtube.com/watch?v=aqz-KE-bpKQ as 20 second 4MB VP9 10BPP webm, timestamps 00:60-00:80

mpv-shot0055

and the standard depth 4MB VP9:

mpv-shot0056

Can you confirm your ffmpeg -version and post the output of ffprobe outputfile.webm?

LeKite commented 3 months ago

ffmpeg -version ffmpeg version n7.0.1 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14.1.1 (GCC) 20240522 configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-mbedtls --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan libavutil 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat 61. 1.100 / 61. 1.100 libavdevice 61. 1.100 / 61. 1.100 libavfilter 10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc 58. 1.100 / 58. 1.100 [beki@arch finalVideos]$ ffprobe -Video-by-chrizzhall-_3.webm ffprobe version n7.0.1 Copyright (c) 2007-2024 the FFmpeg developers built with gcc 14.1.1 (GCC) 20240522 configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-mbedtls --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan libavutil 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat 61. 1.100 / 61. 1.100 libavdevice 61. 1.100 / 61. 1.100 libavfilter 10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc 58. 1.100 / 58. 1.100

Is this good?

Anyway I cannot download with yt-dlp idk why Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.12/tkinter/__init__.py", line 1968, in __call__ return self.func(*args) ^^^^^^^^^^^^^^^^ File "/home/beki/WebmGenerator/src/timeLineSelectionFrameUI.py", line 1117, in timelineMousePress self.timeline_canvas.config(cursor="no") File "/usr/lib/python3.12/tkinter/__init__.py", line 1722, in configure return self._configure('configure', cnf, kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/tkinter/__init__.py", line 1712, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) _tkinter.TclError: bad cursor spec "no" Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.12/tkinter/__init__.py", line 1968, in __call__ return self.func(*args) ^^^^^^^^^^^^^^^^ File "/home/beki/WebmGenerator/src/timeLineSelectionFrameUI.py", line 1117, in timelineMousePress self.timeline_canvas.config(cursor="no") File "/usr/lib/python3.12/tkinter/__init__.py", line 1722, in configure return self._configure('configure', cnf, kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/tkinter/__init__.py", line 1712, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) _tkinter.TclError: bad cursor spec "no" Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.12/tkinter/__init__.py", line 1968, in __call__ return self.func(*args) ^^^^^^^^^^^^^^^^ File "/home/beki/WebmGenerator/src/timeLineSelectionFrameUI.py", line 1117, in timelineMousePress self.timeline_canvas.config(cursor="no") File "/usr/lib/python3.12/tkinter/__init__.py", line 1722, in configure return self._configure('configure', cnf, kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/tkinter/__init__.py", line 1712, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) _tkinter.TclError: bad cursor spec "no"

LeKite commented 3 months ago

Also I pulled again the project and tried again, but still super grainy. Also for the yt-dlp I have updated it via the GUI, and my system is up to date.

dfaker commented 3 months ago

ffprobe outputfile.webm on any of your 'grainy' files will be fine.

LeKite commented 3 months ago

yeah I posted it previously

[beki@arch finalVideos]$ ffprobe -Video-by-chrizzhall-_3.webm ffprobe version n7.0.1 Copyright (c) 2007-2024 the FFmpeg developers built with gcc 14.1.1 (GCC) 20240522 configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-mbedtls --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan libavutil 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat 61. 1.100 / 61. 1.100 libavdevice 61. 1.100 / 61. 1.100 libavfilter 10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc 58. 1.100 / 58. 1.100

LeKite commented 3 months ago

Another one: [beki@arch finalVideos]$ ffprobe dreamymoo_1.webm ffprobe version n7.0.1 Copyright (c) 2007-2024 the FFmpeg developers built with gcc 14.1.1 (GCC) 20240522 configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-mbedtls --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan libavutil 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat 61. 1.100 / 61. 1.100 libavdevice 61. 1.100 / 61. 1.100 libavfilter 10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc 58. 1.100 / 58. 1.100 Input #0, matroska,webm, from 'dreamymoo_1.webm': Metadata: title : dreamymoo WmG COMPATIBLE_BRANDS: isomiso2avc1mp41 MAJOR_BRAND : isom MINOR_VERSION : 512 ENCODER : Lavf61.1.100 Duration: 00:00:16.50, start: -0.007000, bitrate: 126 kb/s Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv, bt709/bt709/smpte170m, progressive), 718x1280, SAR 1:1 DAR 359:640, 30 fps, 30 tbr, 1k tbn Metadata: ENCODER : Lavc61.3.100 libvpx-vp9 DURATION : 00:00:16.500000000 Stream #0:1: Audio: opus, 48000 Hz, mono, fltp Metadata: ENCODER : Lavc61.3.100 libopus DURATION : 00:00:16.488000000

broconut123 commented 3 months ago

Just wanted to chip in. Did a fresh clone, made a new venv and did the pip install and I just made a VP9 webm without issues.

LeKite commented 3 months ago

Just wanted to chip in.

Did a fresh clone, made a new venv and did the pip install and I just made a VP9 webm without issues.

Mmm, maybe I need to make a new venv? I never done that for previous releases but I will try.

dfaker commented 3 months ago

@LeKite

Another one: [beki@arch finalVideos]$ ffprobe dreamymoo_1.webm ...

That's consistent with the prior commit not the current state of master, please share the tempVideoFiles/filters_*.txt it's attempting to use.

LeKite commented 3 months ago

I can confirm, creating again the env, and reinstalling requisites made it work properly. I didn't think it was needed. Previously I just overwrote the files with the new ones. This is what I always used to do in Windows.. works now. Thanks everyone.

dfaker commented 3 months ago

@LeKite great news! I think something went wrong with your pull there as that shouldn't actually be needed.

Closing this thread now, as it's become a grab-bag of Linux issues, if any further problems arise please raise a separate issue.