[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
avconv AVI to WEBM
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 66
Thread images: 12
File: compare.png (370 KB, 1251x457) Image search: [Google]
compare.png
370 KB, 1251x457
I've screencast to RAW avi with kazam (i'm on debian sid)

and I try to convert RAW avi to WebM

left: a frame of the RAW avi
right: a frame of the WebM

Quality of my WebM is very bad, i want to have the same quality of RAW avi

I've convert my RAW avi to WebM with avconv with this command line:

avconv -i input.avi -c:v libvpx -crf 10 -b:v 2M output.webm


How should I do to have same quality of my AVI (or better quality) on my WebM output?

thanks
>>
File: ffmpeg_guide.png (128 KB, 1446x1165) Image search: [Google]
ffmpeg_guide.png
128 KB, 1446x1165
>>46833737
ffmpeg -y -i poop.avi -threads 8 -sn -an -c:v libvpx -b:v 5M -quality best -slices 8  -lag-in-frames 25 -deadline realtime -pass 1 poop.webm


You can adjust the -b:v till you are happy, especially if file size is a secondary concern. You should run this command once more changing -pass 1 to -pass 2. HTH
>>
>>46833794
thanks you

do you know if I can make same things with avconv ?

because it's seems to be very difficult to install real ffmpeg, in debian sid repository it's libav and not ffmpeg
>>
>>46833737
At least with ffmpeg when you use -b:v and -crf the -b:v sets the maximum bitrate. If you just want a high quality vbr encode then set that to something very high and let crf handle the quality.
>>
>>46834071
I never used avconv, but you can simply
avconv -h long >> help.txt and see what you need to use instead,  then simply substitute the arguments for the proper syntax.

Good luck.
>>
>>46834307
>>46834363

thanks you, i've try to find equivalent option on man of avconv

and i've made this command-line

avconv -i test.avi -aspect 16:9 -threads:1 4 -an -c:v libvpx -q:v 1 -b 200M poop.webm


test.avi: RAW file (rawvideo native) 83.6Mo
poop.webm: WebM 2.8Mo but bad quality like on screen of my first post

I don't understand why I don't have the same quality of my input file

i've put a good bitrate

do you have an idea ?

thanks
>>
>>46834816
perhaps remove -q:v 1 and add -qmax 0 -qmin 0
also, what did you use to encode the avi?

Here is some more information
http://wiki.webmproject.org/ffmpeg
http://ffmpeg.org/ffmpeg.html#libvpx
https://trac.ffmpeg.org/wiki/Encode/VP8
>>
File: Kazam Preferences_048.png (19 KB, 534x298) Image search: [Google]
Kazam Preferences_048.png
19 KB, 534x298
>>46834931

avconv -i test.avi -aspect 16:9 -threads:1 4 -an -c:v libvpx -qmax 0 -qmin 0 -b 200M poop.webm


i've this command line now, and no change, it isn't same quality of AVI input

my AVI input is from Kazam, it's a screencaster

I use "RAW (AVI)" like on the screenshot i've join with this message

it's with RAW (AVI) i've the best quality on Kazam

output of the command-line

avconv -i test.avi -aspect 16:9 -threads:1 4 -an -c:v libvpx -qmax 0 -qmin 0 -b 200M poop.webm
avconv version 11.2-6:11.2-1, Copyright (c) 2000-2014 the Libav developers
built on Jan 17 2015 21:51:46 with gcc 4.9.2 (Debian 4.9.2-9)
Input #0, avi, from 'test.avi':
Duration: 00:00:01.73, start: 0.000000, bitrate: 385918 kb/s
Stream #0.0: Video: rawvideo, bgra, 723x556, 30 fps, 30 tbn
Codec AVOption threads () specified for output file #0 (poop.webm) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
[libvpx @ 0x18c0fa0] v1.3.0
Output #0, webm, to 'poop.webm':
Metadata:
encoder : Lavf56.1.0
Stream #0.0: Video: libvpx, yuv420p, 723x556 [PAR 175:128 DAR 126525:71168], q=0-0, 200000 kb/s, 1k tbn, 30 tbc
Metadata:
encoder : Lavc56.1.0 libvpx
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> vp8 (libvpx))
Press ctrl-c to stop encoding
frame= 52 fps= 11 q=0.0 Lsize= 2691kB time=1.70 bitrate=12968.3kbits/s
video:2690kB audio:0kB other streams:0kB global headers:0kB muxing overhead: 0.032379%


avconv detect input AVI video like a "rawvideo (native)"

 Stream #0:0 -> #0:0 (rawvideo (native) -> vp8 (libvpx))
>>
>>46833794
>-quality best with -deadline realtime
deadline realtime is -quality rt.

>no qmax
Enjoy your shit encodes. VP8 can't distribute bitrate worth a damn.
I'd recommend -qmax under 35.
qmin I haven't tested yet, but Xmedia Recode sets it to 4 and I'm not seeing a problem with it. VP8 is probably being retarded assigning areas with a lossless quantizer if you let it, since that's the only explanation I have for how you can have a 5Mbps 720p encode with backgrounds that are blocky as hell.

One of these days I'll get around to doing constant quantizer test encodes.
>>
>>46835111
Try using a real OS.
>>
>>46835237
I don't know if OpenBSD support ffmpeg
>>
>>46835111
>723x556
That isn't 16:9, so you are probably distorting the video.
-padright 132 -padleft 132 -padcolor 000000
>>
>>46835297
thanks,

avconv don't know padleft, padright and padcolor, and i don't find equivalent for avconv

so i've remove -aspect 16:9, but i've no change :/
>>
You know the first stream is 0, right? Why are you using -threads for a stream you don't have?
>>
>>46835379
I wish I could be more help. It is pretty hard when there is a large disconnect between us also.
Have you tried to record directly to webm?

There are static builds of ffmpeg available you can use without having to install, that might give you a better chance.
>>
723x556 isn't mod anything. Try changing to a proper mod8 or mod16 resolution.
>>
File: poop.webm (2 MB, 640x480) Image search: [Google]
poop.webm
2 MB, 640x480
>>46835532
I've record a new AVI video with Kazam with 640*480 resolution

>>46835496
I've try to record directly to webm with Kazam, but quality is very very very bad, so i try to convert AVI record to webm with avconv

I will try with static binaries ffmpeg after this post

my current command-line

avconv -i Kazam_scree_00000.avi -threads:0 4 -an -c:v libvpx -qmax 0 -qmin 0 -b 200M poop.webm


output

avconv version 11.2-6:11.2-1, Copyright (c) 2000-2014 the Libav developers
built on Jan 17 2015 21:51:46 with gcc 4.9.2 (Debian 4.9.2-9)
Input #0, avi, from 'Kazam_scree_00000.avi':
Duration: 00:00:02.11, start: 0.000000, bitrate: 265429 kb/s
Stream #0.0: Video: rawvideo, bgra, 640x480, 27 fps, 27 tbn
[libvpx @ 0x1b10180] v1.3.0
Output #0, webm, to 'poop.webm':
Metadata:
encoder : Lavf56.1.0
Stream #0.0: Video: libvpx, yuv420p, 640x480, q=0-0, 200000 kb/s, 1k tbn, 27 tbc
Metadata:
encoder : Lavc56.1.0 libvpx
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> vp8 (libvpx))
Press ctrl-c to stop encoding
frame= 57 fps= 27 q=0.0 Lsize= 2157kB time=2.07 bitrate=8518.7kbits/s
video:2156kB audio:0kB other streams:0kB global headers:0kB muxing overhead: 0.041585%


poop.webm join with this message

quality is bad :/

a screen of original animation i try to record and convert to webm:
http://pix.toile-libre.org/upload/original/1425424278.png
>>
>>46835827
It would help if you would use a useful test.

>"Hey guys, what's wrong with my audio setup? Here's a clip of static."
>>
>>46836248
thanks you for your help everyone
can you suggest an useful test please which help you to help me ?

>>46835496
I've try with static ffmpeg

this command-line:

./ffmpeg -y -i Kazam_scree_00000.avi -threads 8 -sn -an -c:v libvpx -qmax 0 -qmin 0 -b:v 200M -slices 8  -lag-in-frames 25 -deadline realtime -pass 1 poop.webm


and this same command with -pass 2

I've poop.webm: 6.5Mo

but poop.webm is bad quality, it's not same quality of input file

here my workflow: https://asciinema.org/a/17250

I hope it will be useful for more help

thanks you !
>>
It would help if you would use a useful test.
>>
>>46836559
You might need to look into using -pix_fmt .
-px_fmt bgra
-pix_fmt yuvj420p
>>
>>46836708
>Stream #0.0: Video: rawvideo, bgra
>Stream #0.0: Video: libvpx, yuv420p
>>
>>46836772
>might need to look into using -px_fmt
Apparently it isn't very easy to do losslessly between the two.
>>
>>46836930
You can't. That's the point of 4:2:0.
>>
>>46837136
Perhaps he needs to somehow express what he is trying to do in the form of command line arguments.
>>
>>46837182
see
>>46836772
>>
>>46833737
Could you upload the RAW avi somewhere so we can mess with it?
>>
File: output.webm (1 MB, 640x480) Image search: [Google]
output.webm
1 MB, 640x480
>>46837413
i've upload this video on my server
http://5.39.92.127/Kazam_screencast_00000.avi

thank you if you find a method to convert this video to webm without loss quality

otherwise,

this video was register by Kazam on Debian

but i've try to record by ffmpeg directy

./ffmpeg -video_size 640x480 -framerate 60 -f x11grab -i :0.0+100,200 -c:v libvpx -quality realtime output.webm


quality is very bad (cf webm join with this message)

this 3D model is on a OpenGL context (mesa on debian sid), and I try to have a record with the best quality possible on a webm
>>
>>46837588
try to record using -c:v huffyuv
encode capture
ffmpeg -rtbufsize 2000M -f x11grab -r 60 -i :0.0+100,200 -c:v huffyuv -threads 0 poop.mkv
transcode capture
ffmpeg -y -i poop.mkv -threads 0 -c:v libvpx -quality best -slices 8 -lag-in-frames 25 -deadline realtime -pass 1 poop.webm
>>
>>46837588
try setting qmin to 1 and qmax to 3 or something and see what happens
don't set bitrate
>>
File: poop.webm (1 MB, 640x480) Image search: [Google]
poop.webm
1 MB, 640x480
>>46837665
waw, thanks you, output poop.mkv have a very very good quality, better than video record by Kazam

but transcode destruct this quality (cf webm i've join)
>>
>>46837735
his ffmpeg argument doesn't have a bitrate, and ffmpeg defaults to 500k.
Also, deadline realtime is shit. Take that out. And he only gave you pass 1.

ffmpeg -y -i poop.mkv -sn -c:v libvpx -quality good -speed 0 -b:v 5M -qmin 10 -qmax 40 -pass 1 -auto-alt-ref 1 -lag-in-frames 20 -f webm NUL 

ffmpeg -y -i poop.mkv -sn -c:v libvpx -quality good -speed 0 -b:v 5M -qmin 10 -qmax 40 -pass 2 -auto-alt-ref 1 -lag-in-frames 20 poop.webm
>>
>>46837890
http://forum.videohelp.com/threads/338031-Difference-Between-1-pass-2-pass-encoding
>If you encode a video using constant quality encoding, then go back and make another video the same size using 2-pass VBR encoding, the two videos will be the same size and similar quality.
Why use multipass encoding when he has no file size limitation?
>>
>>46838000
I was always under the impression it produced higher quality since it used the first pass to determine optimal placement.
I have never bothered to use anything else.
>>
>>46838024
I assumed the same, after some googling it looks like it doesn't.
If you don't have file size limits it's probably best to use constant quality over multipass.
>>
>>46838098
I will read into it I suppose. There is so much ffmpeg is capable of that when I find something that works, I lock it down and then try not to change it too much.
One less thing to worry about. Thanks.
>>
>>46838124
effectively multipass uses the first pass to determine the qmin and qmax which will lead to a file of size bitrate * length
so if you don't need to limit absolute file size, but quality is main concern, just assign qmin and qmax according to quality you want; no need to do the first pass
>>
it's my poop.mkv
http://5.39.92.127/poop.mkv

i haven't size limits, i just want the best quality on my webm from poop.mkv

when I transcode with libvxp to have webm, i've a loss of quality, i don't understand
>>
>>46838171
see what happens with qmin and qmax both very low (under 10)
although when encoding videos in a lossy format you will always have some quality loss whatever you do
>>
>>46837890
with theses command line i've this:
http://5.39.92.127/poop.webm
>>
>>46838170
Good stuff. -pass 1/2 dropped
;_; 7 so long old friend
>>
>>46838170
It sets the average quantizer, but it also allows for alt reference frames in VP8. Though if he has no filesize limits he can just go with a constant quantizer of 0
>>
>>46838180
http://5.39.92.127/poop2.webm

i've this with this command line (and same for pass 2):

./ffmpeg -y -i poop.mkv -threads 0 -c:v libvpx -quality best -slices 8 -qmin 0 -qmax 0 -lag-in-frames 25 -deadline realtime -pass 1 poop.webm


last frames is strange
>>
File: a.webm (3 MB, 512x512) Image search: [Google]
a.webm
3 MB, 512x512
>>46835297
>That isn't 16:9, so you are probably distorting the video.
i hate it when encoders lower vertical resolution to make the DAR correct with a PAR of 1:1

why are they so scared of using non-1:1 PAR?

ffmpeg -ss 11:30 -i title00.mkv -t 10 -map 0:0 -vf scale=512x512 -aspect 16:9 -c:v libvpx -deadline best -b:v 40M -crf 7 -qmin 0 -threads 8 /tmp/a.webm
>>
>>46838352
You don't need 2 passes with a constant quantizer.

Dunno what the problem is. Try taking out slices and the deadline realtime.
>>
>>46838414
thanks, i've try

i've this:
http://5.39.92.127/poop3.webm

with this command-line:

./ffmpeg -y -i poop.mkv -threads 0 -c:v libvpx -quality realtime -qmin 0 -qmax 0 poop.webm


the difference is like difference on image of my first post

Do you think it isn't possible to have same quality on webm ?

I had seen webm 1080p 60fps on /wsg/, very very good quality, it's very strange i can't have same quality of a .mkv with standard quality

(sorry for my bad english, i'm not nativ)
>>
>>46838746
Get rid of the realtime.
-quality good or best

This would be a lot easier if you were on a real OS with real screencap tools. Why can't you afford Windows?
>>
>>46838807
I've try with -quality best
no differences

I've upload poop.mkv
5.39.92.127/poop.mkv

can you try to transcode to a webm with best quality ?

>Why can't you afford Windows?
I'm a poor CS students :/
>>
>>46838987
I don't know what you're doing, but that video breaks everything.
Switch to a real OS.
>>
>>46839121
it's very strange

do you have a real OS to suggest ?
>>
>>46839157
XP.
>>
>>46838987
I will give it a shot. It better not be some scat porn.
>>
File: favicon.png (10 KB, 64x64) Image search: [Google]
favicon.png
10 KB, 64x64
>>46839212
http://a.pomf.se/hmovsg.webm
>>
>>46839212
Good luck. It breaks FFMS2. Handbrake outputs a corrupted file. FFMPEG libvpx can't do a pass 1 and breaks on trying CRF.
The screencap software probably outputs something that's broken as fuck.
>>
File: poop.webm (3 MB, 1280x960) Image search: [Google]
poop.webm
3 MB, 1280x960
>>46838987
the color and pattern is a pretty bad scenario for most video encoders, it's no surprise it's difficult to keep the quality up

sharp and highly saturated lines will inevitably be blurred when converted to 4:2:0 color, and since you can't do higher with VP8 the only way to work around it is to upscale the video

ps. if are rendering this animation, consider using a black and white color scheme and/or thicker lines, this will help a lot
>>
>>46839767
FFMpeg can't output a pass 1 stats file.
It Dr Watson's FFMS2.

There's noting there that can't be encoded. It's just it's breaking on serving it.
>>
>>46839767
wow, thank you

i've try with white thicker edges
http://5.39.92.127/poop4.webm

it's better, i think i will stop and keep that workflow

thank you /g/
>>
File: poop.webm (3 MB, 640x480) Image search: [Google]
poop.webm
3 MB, 640x480
>>46840016
>>46839767
damn, and i just finished converting your first video to white lines with imagemagick
>>
>>46840123
>http://5.39.92.127/poop4.webm
waw !

but your webm is <3MB, and my WebM ~33MB

i don't know if if stop, or if i continue improve my future workflow and understand how do you do to have a webm like that with imagemagick

it was difficult ?

because I will have a shell script with ffmpeg command-line, and upload webm into a server

do you think integer imagemagick like you did on my future workflow worth it ?

(sorry for my bad english, and i'm tired)
>>
>>46840212
the imagemagick use was just converting to greyscale then inverting, so blue became white, then encoding those frames to webm with ffmpeg as usual

convert frames to individual png's
ffmpeg -i poop.mkv -f image2 frame%04d.png

convert blue to white in the extracted frames
for i in frame*.png; do convert $i -colorspace gray -negate -background black -flatten new$i; done

convert modified frames into webm
ffmpeg -r 60 -f image2 -i "newframe%04d.png" -map 0:0 -pix_fmt yuv420p -c:v libvpx -b:v 7500k -threads 8 -deadline best poop.webm
>>
http://www.wikihow.com/Screen-Capture-to-File-Using-VLC
>>
>>46840267
ps. you don't need to use imagemagick if you can choose the color of your rendering in the first place
i only did it this way because i only had blue lines to work with
>>
File: has_u_red_it.jpg (3 MB, 2448x3264) Image search: [Google]
has_u_red_it.jpg
3 MB, 2448x3264
>>46840267
Wizard™
>>
>>46840268
simplescreenrecorder is a good choice on linux
>>
File: poop.gif (3 MB, 640x480) Image search: [Google]
poop.gif
3 MB, 640x480
>>46840267
also what might be interesting is that while this is a bad clip for video encoders, this is a pretty good case for gif, especially since your lossless video included transparency information

ffmpeg -i poop.mkv -r 30 -f image2 frame%03d.png
convert -delay 3.333 -alpha set -dispose previous frame*.png poop.gif
>>
>>46840424
JIF will never die.
Thread replies: 66
Thread images: 12

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.