copy encoder settings for cycling platform

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

copy encoder settings for cycling platform

Bernd Eller
Hello,

sorry for that beginner question.

I use Garmin Virb to create Videos (synced with GPS) for a online
cycling Platform and use some simple ffmpeg commands in the back..

The Videos a very big and after uploading the Platform will re-encode it
to a small but well working file

I wont upload big files which they reduce from eg. 17GB to 4GB, but i
dont wont upload it in a lesser quality than they re-code

This mean i want upload it in the same quality or a little bit higher.

I have checked the Encoder Settings of the Platform and want ask if i
can or how i can simply copy this setting to produce the same quality.

But it looks a little bit tricky to find all that settings. Can somebody
help me to find the complete ffmpeg command ?

This would be great and safe a lot of upload time for me.

Here is the he Encoder Setting of the Platform:

Encoding settings           : cabac=1 / ref=6 / deblock=1:0:0 /
analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 /
mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 /
deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 /
lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 /
interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 /
b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 /
weightp=2 / keyint=30 / keyint_min=3 / scenecut=40 / intra_refresh=0 /
rc_lookahead=30 / rc=2pass / mbtree=1 / bitrate=20000 / ratetol=1.0 /
qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 /
ip_ratio=1.40 / aq=1:1.00


I have found the following commands:

ffmpeg -i input.mkv  -coder 1 -refs 6 -me_method umh -subq 10 out.mkv

of course thats are only the beginning of my "search-command.tests"

but the subq 10 will give me a output: subme=9

and i believe its a "2 Step issue"

It would be realy great if somebody spend some time to help me, the
documentation is so big and i dont really understand all that things,
but willing to learn.


Tnx for helping.

Bernd


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: copy encoder settings for cycling platform

kumowoon1025
Hi there,

> The Videos a very big and after uploading the Platform will re-encode it to a small but well working file
>
> I wont upload big files which they reduce from eg. 17GB to 4GB, but i dont wont upload it in a lesser quality than they re-code
>
> This mean i want upload it in the same quality or a little bit higher.
>
> I have checked the Encoder Settings of the Platform and want ask if i can or how i can simply copy this setting to produce the same quality.

The short answer is no. Each iteration of encoding (especially compression-heavy codecs such as h264) is all but guaranteed to have adverse effects on perceived quality or fidelity, on every encoding iteration. Replicating the encoder settings is not going to produce "lossless," or, what I think you are expecting, "no more loss than is necessary" output.

The rule of thumb for codecs such as h264, hevc, vp9, etc. is to encode as few times as possible, if you are going for maximum fidelity to the original.

I may have misunderstood your question though, if that's the case, please let me know and I will try harder to understand your proposed workflow.

Regards,
Ted Park

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: copy encoder settings for cycling platform

Moritz Barsnick
In reply to this post by Bernd Eller
On Thu, Jun 11, 2020 at 09:33:55 +0200, Bernd Eller wrote:
> I wont upload big files which they reduce from eg. 17GB to 4GB, but i
> dont wont upload it in a lesser quality than they re-code
>
> This mean i want upload it in the same quality or a little bit higher.

As Edward said: If your upload platform recodes the video, and so do
you, you will have two processes involving loss of quality. This is not
recommended.

> I have checked the Encoder Settings of the Platform and want ask if i
> can or how i can simply copy this setting to produce the same quality.

If you just want to reduce your video size while retaining a certain
amount of quality, play with the CRF setting and the presets for
libx264. Make sure you understand the implications of them.

If you want to replicate that encoding, a first good bet might be to
see if those match one of x264's presets, and using that. (Note, CRF
vs. fixed bitrate, 1-pass vs. 2-pass, and so forth, will change the
parameters despite same preset.) Yours looks a bit like preset
"veryslow" with fixed-rate 2-pass encoding and changed GOP sizes.


But in case you or anybody else *really* wants to exactly reproduce
x264's reported encoding settings (for whatever reason), there is a
method. Quoting your video characteristics:

> Encoding settings           : cabac=1 / ref=6 / deblock=1:0:0 /
> analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 /
> mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 /
> deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 /
> lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 /
> interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 /
> b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 /
> weightp=2 / keyint=30 / keyint_min=3 / scenecut=40 / intra_refresh=0 /
> rc_lookahead=30 / rc=2pass / mbtree=1 / bitrate=20000 / ratetol=1.0 /
> qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 /
> ip_ratio=1.40 / aq=1:1.00

This output is from Mediainfo. You must understand that this is info
that the original encoder x264 has embedded into the video stream.

As ffmpeg uses x264, and has a lot of liberties, you *can* try to
exactly reproduce these setting. There's an option to the libx264
encoder names "-x264-params", which will pass these parameters directly
to the encoding library.

Unfortunately, the parameters don't match *exactly* (which is libx264's
fault), so you need to do some investigation as well as trial and error
in order to get them right. Also see here:

https://superuser.com/a/1559852/361295

I tried to replicate the "veryslow" prefix, which gives a video with
this info:

  cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

This is the command line option I need to use to replicate that. Note
the many discrepancies in the formatting of variables and values!

  -x264-params 'cabac=1:ref=16:deblock=0,0:analyse=all:me=umh:subme=10:psy=1:psy_rd=1.00,0.00:mixed-refs=1:me_range=24:chroma_me=1:trellis=2:8x8dct=1:cqm=flat:deadzone-inter=21:deadzone-intra=11:fast_pskip=1:chroma_qp_offset=0:threads=3:lookahead_threads=1:sliced_threads=0:nr=0:dct-decimate=1:interlaced=0:bluray_compat=0:constrained_intra=0:bframes=8:b_pyramid=2:b_adapt=2:b_bias=0:direct=auto:weightb=1:open_gop=0:weightp=2:keyint=250:keyint_min=25:scenecut=40:intra_refresh=0:rc_lookahead=60:mbtree=1:crf=23.0:qcomp=0.60:qpmin=0:qpmax=69:qpstep=4:ipratio=1.40:aq-mode=1:aq-strength=1.00'

I actually got bit-wise identical videos. Your mileage may vary.

> It would be realy great if somebody spend some time to help me, the
> documentation is so big and i dont really understand all that things,
> but willing to learn.

To learn, just play around with encoder settings a bit, and read about
the H.264 basics here:
https://trac.ffmpeg.org/wiki/Encode/H.264

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".