mpeg2 encoding with ffmpeg (for dvd, from doom9 forums)
I found few ffmpeg/mpeg2 related threads but nothing about mpeg2/bluray encoding https://forum.doom9.org/showthread.php?t=173332 ==== Quote: ffmpeg.exe -i # -aspect # -dc 10 -g 12 -maxrate 8000k -q:v 2 -b_strategy 2 -brd_scale 2 -bf 2 -profile:v 4 -intra_matrix "8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19,22,26,27,29,34,34,38,22,22,26,27,29,34,37,40,22,26,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27,29,34,38,46,56,69,27,29,35,38,46,56,69,83" -inter_matrix "16,17,18,19,20,21,22,23,17,18,19,20,21,22,23,24,18,19,20,21,22,23,24,25,19,20,21,22,23,24,26,27,20,21,22,23,25,26,27,28,21,22,23,24,26,27,28,30,22,23,24,26,27,28,30,31,23,24,25,27,28,30,31,33" -pass 1 -passlogfile "ffmpeg" -an -c:v mpeg2video pass1.m2v" ffmpeg.exe -i # -aspect # -dc 10 -g 12 -lmin 0.75 -mblmin 50 -qmin 1 -qmax 31 -maxrate 8000k -b:v 3500k -bf 2 -pre_dia_size 5 -dia_size 5 -qcomp 0.7 -qblur 0 -preme 2 -me_method dia -sc_threshold 0 -sc_factor 4 -bidir_refine 4 -profile:v 4 -mbd rd -mbcmp satd -precmp satd -cmp satd -subcmp satd -skipcmp satd -intra_matrix "8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19,22,26,27,29,34,34,38,22,22,26,27,29,34,37,40,22,26,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27,29,34,38,46,56,69,27,29,35,38,46,56,69,83" -inter_matrix "16,17,18,19,20,21,22,23,17,18,19,20,21,22,23,24,18,19,20,21,22,23,24,25,19,20,21,22,23,24,26,27,20,21,22,23,25,26,27,28,21,22,23,24,26,27,28,30,22,23,24,26,27,28,30,31,23,24,25,27,28,30,31,33" -pass 2 -passlogfile "ffmpeg" -an -c:v mpeg2video out.m2v Just replace the # characters with your own values, maybe play with the bitrate... === I never used those custom matrix params - someone with better eyesight (and low error-tolerance :-}) can check them.. about dvb-t muxing http://www.waveguide.se/?article=creating-dvb-t-compatible-mpeg2-streams-usi... http://forum.doom9.net/showthread.php?t=174620 === new-ish dvd encode with ffmpeg thread making use of negative sc_threshold value for less artefacting in areas with high motion. Not sure if our ffmpeg 4.4 still respects this. @REM Threshold for scene change detection (sc_threshold) [−1000000000;1000000000] (Negative values indicate that it is more likely to insert an I-frame when it detects a scene change) set E_TSD=-30000 === also, dc precision should be higher for higher bitrates (dc 12 for max?) .. As starting point for first shot just increase bitrates to BD-levels?
On Sunday, November 21, 2021, Andrew Randrianasulu <[email protected]> wrote:
I found few ffmpeg/mpeg2 related threads but nothing about mpeg2/bluray encoding
https://forum.doom9.org/showthread.php?t=173332 ==== Quote: ffmpeg.exe -i # -aspect # -dc 10 -g 12 -maxrate 8000k -q:v 2 -b_strategy 2 -brd_scale 2 -bf 2 -profile:v 4 -intra_matrix "8,16,19,22,26,27,29,34,16,16, 22,24,27,29,34,37,19,22,26,27,29,34,34,38,22,22,26,27,29,34, 37,40,22,26,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27, 29,34,38,46,56,69,27,29,35,38,46,56,69,83" -inter_matrix "16,17,18,19,20,21,22,23,17,18,19,20,21,22,23,24,18,19,20, 21,22,23,24,25,19,20,21,22,23,24,26,27,20,21,22,23,25,26,27, 28,21,22,23,24,26,27,28,30,22,23,24,26,27,28,30,31,23,24,25,27,28,30,31,33" -pass 1 -passlogfile "ffmpeg" -an -c:v mpeg2video pass1.m2v"
ffmpeg.exe -i # -aspect # -dc 10 -g 12 -lmin 0.75 -mblmin 50 -qmin 1 -qmax 31 -maxrate 8000k -b:v 3500k -bf 2 -pre_dia_size 5 -dia_size 5 -qcomp 0.7 -qblur 0 -preme 2 -me_method dia -sc_threshold 0 -sc_factor 4 -bidir_refine 4 -profile:v 4 -mbd rd -mbcmp satd -precmp satd -cmp satd -subcmp satd -skipcmp satd -intra_matrix "8,16,19,22,26,27,29,34,16,16, 22,24,27,29,34,37,19,22,26,27,29,34,34,38,22,22,26,27,29,34, 37,40,22,26,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27, 29,34,38,46,56,69,27,29,35,38,46,56,69,83" -inter_matrix "16,17,18,19,20,21,22,23,17,18,19,20,21,22,23,24,18,19,20, 21,22,23,24,25,19,20,21,22,23,24,26,27,20,21,22,23,25,26,27, 28,21,22,23,24,26,27,28,30,22,23,24,26,27,28,30,31,23,24,25,27,28,30,31,33" -pass 2 -passlogfile "ffmpeg" -an -c:v mpeg2video out.m2v
Just replace the # characters with your own values, maybe play with the bitrate...
===
I never used those custom matrix params - someone with better eyesight (and low error-tolerance :-}) can check them..
about dvb-t muxing http://www.waveguide.se/?article=creating-dvb-t-compatible-mpeg2-streams- using-ffmpeg
http://forum.doom9.net/showthread.php?t=174620
===
new-ish dvd encode with ffmpeg thread making use of negative sc_threshold value for less artefacting in areas with high motion. Not sure if our ffmpeg 4.4 still respects this.
@REM Threshold for scene change detection (sc_threshold) [−1000000000;1000000000] (Negative values indicate that it is more likely to insert an I-frame when it detects a scene change) set E_TSD=-30000
===
also, dc precision should be higher for higher bitrates (dc 12 for max?) ..
err, 11 max... I tried to create mpeg2 two-pass video profiles according to https://cinelerra-gg.org/download/CinelerraGG_Manual/Two_pass_Encoding_with_... and info above see attached (I tested those on android, so cin_stat_file must be altered for more generic logfile location) Note, second pass will crash if logfile was not created or removed...
As starting point for first shot just increase bitrates to BD-levels?
I tried to create mpeg2 two-pass video profiles according to
https://cinelerra-gg.org/download/CinelerraGG_Manual/Two_pass_Encoding_with_...
and info above
see attached (I tested those on android, so cin_stat_file must be altered for more generic logfile location)
Note, second pass will crash if logfile was not created or removed...
As starting point for first shot just increase bitrates to BD-levels?
In doing a quick test of the 2 pass mpeg this morning after changing the
location of the logfile, it worked. But it did put out a couple of error messages on pass 2which I am not too sure about. However, when I ran pass 2 without having run pass 1 first, it put out correct standard error messages and did not crash - which is good. Attached you will see the 2 error messages on pass 2 as also shown below. And my audio was not set up to work but I am not sure if 2 passes even allow for that. FFStream::encode_frame: encode failed. file: /tmp/junbefore1.mpeg err: Operation not permitted FFStream::flush failed :file:/tmp/junbefore1.mpeg err: Operation not permitted
Forgot to mention that the error may be due to testing with the additional ffmpeg 4.4. patches so will retest without these in 0013-More-ffmpeg-4.4-patches-renaming-B0-to-B0_-due-to-te.patch 00233-Hack-pix_fmts-for-yuv4mpegpipe-muxer-encoder-allow-f.patch 0032-HACK-make-avi-demuxer-in-ffmpeg-use-cin-specific-see.patch 0043-Add-two-more-libx264-patches-for-ffmpe-enable-avcint.patch On Sun, Nov 21, 2021 at 9:21 AM Phyllis Smith <[email protected]> wrote:
I tried to create mpeg2 two-pass video profiles according to
https://cinelerra-gg.org/download/CinelerraGG_Manual/Two_pass_Encoding_with_...
and info above
see attached (I tested those on android, so cin_stat_file must be altered for more generic logfile location)
Note, second pass will crash if logfile was not created or removed...
As starting point for first shot just increase bitrates to BD-levels?
In doing a quick test of the 2 pass mpeg this morning after changing the
location of the logfile, it worked. But it did put out a couple of error messages on pass 2which I am not too sure about. However, when I ran pass 2 without having run pass 1 first, it put out correct standard error messages and did not crash - which is good. Attached you will see the 2 error messages on pass 2 as also shown below. And my audio was not set up to work but I am not sure if 2 passes even allow for that. FFStream::encode_frame: encode failed. file: /tmp/junbefore1.mpeg err: Operation not permitted FFStream::flush failed :file:/tmp/junbefore1.mpeg err: Operation not permitted
I tried to create mpeg2 two-pass video profiles according to
https://cinelerra-gg.org/download/CinelerraGG_Manual/Two_pass_Encoding_with_...
and info above
see attached (I tested those on android, so cin_stat_file must be altered for more generic logfile location)
These 3 files where also checked into GIT today. A second test I ran on a
different video file for the pass1/2 did not have any errors.
With the git from Nov 23, 2021 I am unable to complete the build. I attach the cin5.log
On Tuesday, November 23, 2021, Andrea paz via Cin < [email protected]> wrote:
With the git from Nov 23, 2021 I am unable to complete the build. I attach the cin5.log
looks like webp example program failed? === inline ao_instance_t * ao_open (ao_open_t * open) | ^~~~~~~ /usr/bin/ld: CMakeFiles/vwebp.dir/examples/vwebp.c.o: warning: relocation against `glutBitmap9By15' in read-only se make[5]: ingresso nella directory «/home/paz/cinelerra5/cinelerra-5.1/thirdparty/ladspa-0.4.17» ! test -f "amp_1181.xml" || ./makestub.pl "amp_1181.xml" > "amp_1181.c" /usr/bin/ld: CMakeFiles/vwebp.dir/examples/vwebp.c.o: in function `HandleDisplay': vwebp.c:(.text+0x551): undefined reference to `glutBitmap9By15' /usr/bin/ld: vwebp.c:(.text+0x560): undefined reference to `glutBitmapCharacter' /usr/bin/ld: vwebp.c:(.text+0x5d1): undefined reference to `glutBitmap9By15' /usr/bin/ld: vwebp.c:(.text+0x5e0): undefined reference to `glutBitmapCharacter' /usr/bin/ld: vwebp.c:(.text+0x648): undefined reference to `glutBitmap9By15' /usr/bin/ld: vwebp.c:(.text+0x658): undefined reference to `glutBitmapCharacter' /usr/bin/ld: CMakeFiles/vwebp.dir/examples/vwebp.c.o: in function `decode_callback': vwebp.c:(.text+0x835): undefined reference to `glutPostRedisplay' --- check if you have glut (gl utility toolkit?) installed? I also can try and disable those examples..
I already had freeglut installed on my system; I added lib32-freeglut but it still gives me an error. I noticed a number of warnings about avx512, which my Ryzen processor does not support. Does this have something to do with it?
On Tuesday, November 23, 2021, Andrea paz <[email protected]> wrote:
I already had freeglut installed on my system; I added lib32-freeglut but it still gives me an error. I noticed a number of warnings about avx512, which my Ryzen processor does not support. Does this have something to do with it?
hm... I saw few avx-512 asm disable switches... so hopefully not? it all also was working before... try attached patch (it disables webp programs - not much use apart from testing libwebp itself..)
On Tuesday, November 23, 2021, Andrea paz <[email protected]> wrote:
try attached patch (it disables webp programs - not much use apart from testing libwebp itself..)
Success! Build OK, thanks. I tried to render a webp sequence and everything works fine (a little slow because single threads!); I thought the patch disabled webp?
intent was to disable only programs but not library itself.
participants (3)
-
Andrea paz -
Andrew Randrianasulu -
Phyllis Smith