[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/wsg/ - Worksafe GIF

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • Supported file types are: GIF, WEBM, MP4

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


Janitor applications are now open. Apply here!


[Advertise on 4chan]


rave/dance/breakbeat/hip-hop/trip-hop
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
File: N-Joi - Mindflux.webm (5.89 MB, 480x264)
5.89 MB
5.89 MB WEBM
>>
>>
File: The Prodigy - Poison.webm (5.9 MB, 576x324)
5.9 MB
5.9 MB WEBM
>>
>>
>>
>>
>>
File: Sy-Kick - Nasty.webm (5.93 MB, 480x352)
5.93 MB
5.93 MB WEBM
>>
>>
File: Latryx - Say That.mp4 (5.69 MB, 320x240)
5.69 MB
5.69 MB MP4
>>
>>
>>
>>
>>
File: LFO - LFO.webm (6 MB, 480x360)
6 MB
6 MB WEBM
>>
File: GTA 2 Opening Intro.webm (5.88 MB, 640x432)
5.88 MB
5.88 MB WEBM
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
i've been using this to convert btw
https://github.com/chameleon-ai/webm-for-4chan
it's very quick and easy for hitting target filesizes required here

general usage:
webm_for_4chan.py <yt-URL>
webm_for_4chan.py -i input.mp4 -b 2 --music_mode --auto_crop --board wsg -o "output.webm"
>>
>>
>>
>>
>>6156893
Author here
> -b 2
Do you often find that it overshoots in music mode and you have to specify -b? I can do some more tests and make adjustments to the bitrate compensation table if this is a persistent problem.
Also "--board wsg" is default, no need to specify.
"--blackframe" also seeks past the initial black frames as seen in >>6156903 which seems to be very common in music videos.
>>
>>6156913
>Do you often find that it overshoots
out of the about 50 files i converted so far without that flag it overshot maybe 10 times by a few kb, so i'm just adding it preemptively to avoid needing to re-encode. it's great to have a tool to do this for me so i'm trying to see how fast/efficient i can make it.

i just got it to overshoot just now without -b 2, and adding --fast, but that's to be expected from expediting a 2-pass.

so on average it's hitting the mark without any help, but -b is a time-saving flag if the source material is garbage quality anyway and don't think it would harm it to have a few more pixels.

there were only 2 videos i just couldn't get under 6 and gave up on because the sources were of higher original quality/weren't garbo VHS rips. one was the voodoo ray official video https://www.youtube.com/watch?v=j7vxHOCeiQ4

so per your suggestions this is what i'll run for my own example:
.\webm_for_4chan.py https://www.youtube.com/watch?v=7mXHV5JaZnw -b 2 --fast --blackframe --music_mode --auto_crop -o "House Corporation - I Know I Can Do It.webm"

i've noticed that if i try change the value for -o to a full path or a relative path when specifying a youtube url, i get a file not found and the terminal breaks. i'm running the .py from H:\downloads\ and would prefer to make it go to H:\downloads\out\
but i can work around this probably by just running the py from that folder or something.
>>
File: DJ Krush - Kemuri.webm (5.91 MB, 368x272)
5.91 MB
5.91 MB WEBM
>>
>>
>>
i'm getting into the homage/homemade part of youtube that aren't real music videos but it will have to do
>>
>>6156931
Got Voodoo Ray first try with "--audio_rate 96 --blackframe" but it looked like ass so I redid with "--deadline best". Still looks like ass, but slightly less crunchy ass.
I'm wondering if the overshoot is because audio rate in music mode is typically higher than 96k so ffmpeg is really struggling to get 4-5 minute videos into like 1-2MB. Actually for most old music videos I'd be surprised if the true audio quality is over 96k anyway so you may be wasting audio bits with music mode.
I'll look into the path issue, that sounds pretty annoying.

Also be careful using yt-dlp with youtube, 50 in a day can get you IP banned, they've really ramped up recently on detection.
>>
>>6156981
crunchy is par for the thread theme so anything goes

>yt-dlp with youtube
ye it's happened already but it's always temporary, i sat out the cooldown with a burger and fries. i get banned more often and for longer from this shithole board than i do from yt. i'm fizzling out now anyway might be back later or tomorrow

one more thing and i hate to pile this on but i got an 'input file not found' error just by running this
.\webm_for_4chan.py https://www.youtube.com/watch?v=Lxx9rTEOo-U -b 2 --fast --blackframe --music_mode --auto_crop -o "Sunset Regime - I've Got The Real Feel.webm"
i think it's because the title has an apostrophe in it closing the input filename too early, could be an easy fix
>>
>>6157002
Thanks for the data point.
Sometimes direct url downloads don't work because it will first use yt-dlp to fetch the file name, then download it, but if yt-dlp fails and falls back to a different file name (like it wanted to download the .mkv but fell back to the .mp4) it will fail.
But yeah I'll see if it's something besides that, and the output directory problem is probably a separate issue. I like the feedback though because it makes the experience more seamless for everyone when bugs are fixed.
>>
>>
>>6156821
This song gives me the urge to drink some Blackcurrant Tango.
>>
>>
>>
>>
>>
>>
>>
File: The Movement - Jump.webm (5.94 MB, 480x341)
5.94 MB
5.94 MB WEBM
>>
>>
>>
>>
File: Prezioso - Don't Stop.mp4 (4.72 MB, 320x240)
4.72 MB
4.72 MB MP4
>>
>>6157002
I've made some tweaks, you can now specify an output directory, like "-o videos/" and it should encode the video in that directory using the same name.
I've also added some stuff for yt-dlp so hopefully you'll get a more informative print if you get a file not found error. Let me know if you have problems or if you still run into the same errors.
>>
>>6157912
cool that works
it helps me keep yt dls out of the same folder as converted files

the only other error i ran into was when i messed up and forgot a double hyphen for --audio_rate
unfortunately i don't have the log open anymore. it would say something verbatim like "unknown command: udio rate" which seems like the switch gets truncated due to the missing hyphen? it's user error, i just mentioned it in case that's not intentional.

one thing i would like to know, can i pass through -y for overwrite to ffmpeg?

again thanks for making this tool, it's the only reason i made this thread and i wouldn't have done this many webms if i didn't have it
>>
>>6157949
> one thing i would like to know, can i pass through -y for overwrite to ffmpeg?
You're talking about the duplicate filename check? Alright, not a bad idea, so I added it. Just don't shoot yourself in the foot with "-o ./ -y"
The other thing is just user error, can't do anything about it and I don't control how python parses arguments.
Glad you like the script. Over time I've added a lot of features due to feedback from anons. Everyone seems to use it a little differently and I keep getting surprised at edge cases. Cheers anon, I've been grooving to this thread.
>>
>>
hwaccel test
>>
>>
>>6158039
i'm getting extremely fast encodes with h264_nvenc on my 3060Ti
instead of 3-4 minutes per VP9 with my CPU at 100%, with H264 on my GPU it's 6 seconds.

would be great to have this option native

all i did was change every instance of 'libx264' to 'h264_nvenc' in the script and adjusted the preset names and it works way faster on my hardware

https://pastebin.com/3uMCemVb

875:
ffmpeg_args.extend(["-c:v", "h264_nvenc", "-preset", "p1", "-tune", "lossless"])
1493:
video_codec = ["-c:v", "h264_nvenc", "-preset", 'p4' if args.fast else 'p6']
1526:
carbon_copy_cmd.extend(['-c:v', 'h264_nvenc', '-preset', 'p4', '-tune', 'hq', '-c:a', 'libopus', '-b:a', '512k', '-sn', carbon_copy_output])
>>
>>
File: De'lacy - Hideaway.mp4 (5.98 MB, 480x256)
5.98 MB
5.98 MB MP4
>>
>>
>>
>>
>>
>>
>>
>>
>>6158187
My hardware doesn't support that, so I can't test it, but I did add it as an option, so you can now specify "--codec h264_nvenc" and I believe it will work based on my research of the documentation.
By the way, if your hardware supports it, you can also specify "--codec vp9_vaapi' for hardware accelerated webm.

I recommend webm for music since opus generally performs better than aac at the same bitrate, and youtube usually gives you audio in the form of 128kbps opus.
>>
File: Strike - U Sure Do.mp4 (5.93 MB, 640x360)
5.93 MB
5.93 MB MP4
>>6158487
i was testing it last night. vp9_vaapi is fast and it works but it still uses CPU on my setup.
h264_nvenc was a couple seconds faster and i can see on my performance graphs the entire encode happened on the GPU.

i tested the script it seems to be working perfectly

it seems to fall back to using libx264 if i specify --mp4 alongside --codec h264_nvenc
and then the encode takes about 10 seconds because it's using my weaker CPU

but if i go with --codec h264_nvenc raw, the second pass encode is literally 2 seconds on my GPU

this is useful for me because my CPU might already be working while my GPU typically sits idle
ffmpeg seems to support nvidia hardware support out of the box, i didn't compile a special version or anything, and every nvidia GPU made in the past few presidential terms should support H264 encode

thanks again for your work
>>
>>6158574
Yeah "--mp4" is just a shorthand for "--codec libx264" so they will conflict. I didn't really think about people using both flags so I'll probably add some logic in there to deconflict and make it less surprising.
But I'm glad it's working. Always kinda awkward making a commit I can't test.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.