Re: [Cin] Blu-ray encoding again
В сообщении от Friday 15 November 2019 01:01:29 Marton Balint написал(а):
On Thu, 14 Nov 2019, Andrew Randrianasulu wrote:
"Warning: Do not use the option x264opts, as it will eventually be removed. Use x264-params instead." *ok. we will change that.*
f*or bluray_format, mpegts_m2ts_mode=1 *(changed to 2 by me) causes the transport stream to set the transport_priority flag if the packet is audio ac3, which is sort of a kludge... but this is necessary to get audio to reproduce on my home bluray player (samsung ubd-k8500). This was discovered by checking the diff between the ffmpeg output (which fails on player) and the "sintel" iso file from blender site (which works on player). The mode=2 triggers mode=1 and add the transport_priority flag for ac3 audio. It definitely helps here at home. Similarly, *sdt_period=-1* turns off the service descriptor table output, since this is not a broadcast stream. I am not an expert on mpegts and these changes work for me. If you have better information, let me know.
I'm not expert too, but may be Marton can explain to us if those changes acceptable in upstream, or they must be done as separate parameters ..
I think we should just change behaviour unconditionally if m2ts mode is used, unless there is a known downside of doing so. I will extend my branch with a patch which makes the muxer not use SDT in m2ts mode, I was not aware that it is not needed in BluRay.
There is alternative ts muxer recently open-sourced, you can look into its code: https://github.com/justdan96/tsMuxer NOT guaranteed to be correct, but some code better than no code (buildable for me on 32-bit Slackware) File I used for test was named 1080p25.ts and I found it ... http://www.w6rz.net/1080p25.zip here I can try and locate some ps4 user, in theory this system should be able to play Blu-Rays: https://manuals.playstation.net/document/en/ps4/videos/videodisc.html
Regards, Marton
Andrew: File I used for test was named 1080p25.ts and I found it ...
Thanks for this test file. I have been testing the bluray.m2ts that you provided off and on all day. Everything seems to work just fine on our bluray burner and when played on the bluray player connected to the TV. The fake-interlaced=1 parameter was quite intriguing so at least once, I was able to get a failure with the provided media when I left out this fake parameter. So I guess it really does what it says it does! So this opts file will get checked in with, as always, a few gg tweaks. Thanks, Phyllis/gg
В сообщении от Friday 15 November 2019 02:40:35 Phyllis Smith написал(а):
Andrew:
File I used for test was named 1080p25.ts and I found it ...
Thanks for this test file. I have been testing the bluray.m2ts that you provided off and on all day. Everything seems to work just fine on our bluray burner and when played on the bluray player connected to the TV. The fake-interlaced=1 parameter was quite intriguing so at least once, I was able to get a failure with the provided media when I left out this fake parameter. So I guess it really does what it says it does! So this opts file will get checked in with, as always, a few gg tweaks. Thanks, Phyllis/gg
Thanks a lot for _your_ work. While optical media might be not as useful as it was even few years before - having spec-accurate files/streams still important goal, IMO. I'll reply to this thread if/when I'll hear from another user(s)
В сообщении от Friday 15 November 2019 02:40:35 Phyllis Smith написал(а):
Andrew:
File I used for test was named 1080p25.ts and I found it ...
Thanks for this test file. I have been testing the bluray.m2ts that you provided off and on all day. Everything seems to work just fine on our bluray burner and when played on the bluray player connected to the TV. The fake-interlaced=1 parameter was quite intriguing so at least once, I was able to get a failure with the provided media when I left out this fake parameter. So I guess it really does what it says it does! So this opts file will get checked in with, as always, a few gg tweaks. Thanks, Phyllis/gg
I tried to patch bdcreate.C but while it worked I'm sure i did it wrong (and you need to fix keyint by hand anyway): cat /dev/shm/bdcreate.patch diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C index 863c5d0..fdafa5c 100644 --- a/cinelerra-5.1/cinelerra/bdcreate.C +++ b/cinelerra-5.1/cinelerra/bdcreate.C @@ -44,6 +44,7 @@ static struct bd_format { { "1920x1080 29.97p*", 1920,1080, 29.97, 1, ILACE_MODE_NOTINTERLACED }, { "1920x1080 24p", 1920,1080, 24., 1, ILACE_MODE_NOTINTERLACED }, { "1920x1080 25i", 1920,1080, 25., 1, ILACE_MODE_TOP_FIRST }, + { "1920x1080 25p", 1920,1080, 25., 1, ILACE_MODE_NOTINTERLACED }, { "1920x1080 23.976p", 1920,1080, 23.976, 1, ILACE_MODE_NOTINTERLACED }, { "1440x1080 29.97i", 1440,1080, 29.97, -1, ILACE_MODE_TOP_FIRST }, { "1440x1080 25i", 1440,1080, 25., -1, ILACE_MODE_TOP_FIRST }, @@ -51,6 +52,8 @@ static struct bd_format { { "1440x1080 23.976p", 1440,1080, 23.976,-1, ILACE_MODE_NOTINTERLACED }, { "1280x720 59.94p", 1280,720, 59.94, 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 50p", 1280,720, 50., 1, ILACE_MODE_NOTINTERLACED }, + { "1280x720 29.97p", 1280,720, 29.97, 1, ILACE_MODE_NOTINTERLACED }, + { "1280x720 25p", 1280,720, 25., 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 24p", 1280,720, 24., 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 23.976p", 1280,720, 23.976, 1, ILACE_MODE_NOTINTERLACED }, { "720x576 25i", 720,576, 25., 0, ILACE_MODE_BOTTOM_FIRST }, @@ -325,11 +328,23 @@ int CreateBD_Thread::create_bd_jobs(ArrayList<BatchRenderJob*> *jobs, const char FFMPEG::set_option_path(option_path, "video/%s", asset->vcodec); FFMPEG::load_options(option_path, asset->ff_video_options, sizeof(asset->ff_video_options)); - const char *opts = 0; + char *opts = 0; + char *opts1 = 0; switch( asset->interlace_mode ) { case ILACE_MODE_TOP_FIRST: opts = ":tff\n"; break; case ILACE_MODE_BOTTOM_FIRST: opts = ":bff\n"; break; } + + if ((asset->width == 1920) && (asset->height == 1080) && (asset->frame_rate != 24) && (asset->interlace_mode==ILACE_MODE_NOTINTERLACED)) + opts1="fake-interlaced=1\n"; + if ((asset->width == 1280) && (asset->height == 720) && (asset->frame_rate == 25 || asset->frame_rate == 29.97 ) && (asset->interlace_mode==ILACE_MODE_NOTINTERLACED)) + opts1="pulldown=double\n"; + + if ((opts1) && (opts)) { + int len1 = strlen(opts); + char *cp1 = opts + len1-1; + strncpy(cp1, opts1, sizeof(opts)-len1); + } if( opts ) { int len = strlen(asset->ff_video_options); char *cp = asset->ff_video_options + len-1;
Bluray changes have been checked in as tested, noted, patched, provided by Andrew: 1) the hardware device "none" was giving an error message -- gg fixed this; 2) in the bluray...m2ts opts files the x264opts was switched to x264-params because of Andrew's note of future deprecation of x264opts (I still have to do the non-bluray ones); 3) bdcreate patch applied that adds 3 additional bluray settings (1920x1080, 25p and 1280x720p, 29.97p and 25) and changed the method of dealing with the fake_interlace versus tff/bff interlace; 4) modified bluray.m2ts based on Andrew's recommendation; 5) added bluray_interlace, bluray_tff, and bluray_bff .m2ts to handle specific cases as noted. I did quite a few tests and wore out the carpet between the bluray writer and the TV! so even though bluray is going out, we still use it a lot for home videos. Thanks for all of the research/work by Andrew. gg/Phyllis I tried to patch bdcreate.C but while it worked I'm sure i did it wrong
(and you need to fix keyint by hand anyway):
cat /dev/shm/bdcreate.patch diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C index 863c5d0..fdafa5c 100644 --- a/cinelerra-5.1/cinelerra/bdcreate.C +++ b/cinelerra-5.1/cinelerra/bdcreate.C @@ -44,6 +44,7 @@ static struct bd_format { { "1920x1080 29.97p*", 1920,1080, 29.97, 1, ILACE_MODE_NOTINTERLACED }, { "1920x1080 24p", 1920,1080, 24., 1, ILACE_MODE_NOTINTERLACED }, { "1920x1080 25i", 1920,1080, 25., 1, ILACE_MODE_TOP_FIRST }, + { "1920x1080 25p", 1920,1080, 25., 1, ILACE_MODE_NOTINTERLACED }, { "1920x1080 23.976p", 1920,1080, 23.976, 1, ILACE_MODE_NOTINTERLACED }, { "1440x1080 29.97i", 1440,1080, 29.97, -1, ILACE_MODE_TOP_FIRST }, { "1440x1080 25i", 1440,1080, 25., -1, ILACE_MODE_TOP_FIRST }, @@ -51,6 +52,8 @@ static struct bd_format { { "1440x1080 23.976p", 1440,1080, 23.976,-1, ILACE_MODE_NOTINTERLACED }, { "1280x720 59.94p", 1280,720, 59.94, 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 50p", 1280,720, 50., 1, ILACE_MODE_NOTINTERLACED }, + { "1280x720 29.97p", 1280,720, 29.97, 1, ILACE_MODE_NOTINTERLACED }, + { "1280x720 25p", 1280,720, 25., 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 24p", 1280,720, 24., 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 23.976p", 1280,720, 23.976, 1, ILACE_MODE_NOTINTERLACED }, { "720x576 25i", 720,576, 25., 0, ILACE_MODE_BOTTOM_FIRST }, @@ -325,11 +328,23 @@ int CreateBD_Thread::create_bd_jobs(ArrayList<BatchRenderJob*> *jobs, const char FFMPEG::set_option_path(option_path, "video/%s", asset->vcodec); FFMPEG::load_options(option_path, asset->ff_video_options, sizeof(asset->ff_video_options)); - const char *opts = 0; + char *opts = 0; + char *opts1 = 0; switch( asset->interlace_mode ) { case ILACE_MODE_TOP_FIRST: opts = ":tff\n"; break; case ILACE_MODE_BOTTOM_FIRST: opts = ":bff\n"; break; } + + if ((asset->width == 1920) && (asset->height == 1080) && (asset->frame_rate != 24) && (asset->interlace_mode==ILACE_MODE_NOTINTERLACED)) + opts1="fake-interlaced=1\n"; + if ((asset->width == 1280) && (asset->height == 720) && (asset->frame_rate == 25 || asset->frame_rate == 29.97 ) && (asset->interlace_mode==ILACE_MODE_NOTINTERLACED)) + opts1="pulldown=double\n"; + + if ((opts1) && (opts)) { + int len1 = strlen(opts); + char *cp1 = opts + len1-1; + strncpy(cp1, opts1, sizeof(opts)-len1); + } if( opts ) { int len = strlen(asset->ff_video_options); char *cp = asset->ff_video_options + len-1;
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
participants (2)
-
Andrew Randrianasulu -
Phyllis Smith