[Cin] Blu-ray compliant MPEG-2 SD video - 2022 mod
Terje J. Hanssen
terjejhanssen at gmail.com
Fri Dec 9 02:27:13 CET 2022
Den 09.12.2022 01:41, skrev Andrew Randrianasulu:
>
>
> пт, 9 дек. 2022 г., 03:36 Terje J. Hanssen <terjejhanssen at gmail.com>:
>
>
>
> Den 08.12.2022 01:26, skrev Terje J. Hanssen:
>>
>>
>> Den 08.12.2022 00:54, skrev Andrew Randrianasulu:
>>>
>>>
>>> чт, 8 дек. 2022 г., 02:50 Terje J. Hanssen
>>> <terjejhanssen at gmail.com>:
>>>
>>>
>>> Den 07.12.2022 22:40, skrev Andrew Randrianasulu:
>>>>
>>>>
>>>> чт, 8 дек. 2022 г., 00:36 Terje J. Hanssen
>>>> <terjejhanssen at gmail.com>:
>>>>
>>>>
>>>>
>>>> Den 07.12.2022 00:13, skrev Andrew Randrianasulu:
>>>>> may be try field_order as recommended here
>>>>>
>>>>> https://forum.videohelp.com/threads/396483-ffmpeg-changes-interlaced-to-progressive
>>>>>
>>>>> ?
>>>>
>>>> I tried to add '-field_order bb'
>>>>
>>>> ffmpeg -i dv28.dv -c:v mpeg2video -c:a copy
>>>> -mpegts_m2ts_mode 1 -field_order bb
>>>> dv28-mpeg2-SD-bluray.mts
>>>> ...........
>>>> Stream #0:0: Video: mpeg2video (Main), yuv420p(bottom
>>>> first), 720x576 [SAR 16:15 DAR 4:3], q=2-31, 200 kb/s,
>>>> 25 fps, 90k tbn
>>>> Metadata:
>>>> encoder : Lavc59.37.100 mpeg2video
>>>> Side data:
>>>> cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0
>>>> vbv_delay: N/A
>>>> Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16,
>>>> 1536 kb/s
>>>>
>>>> [mpegts @ 0x564149f05bc0] Stream 1, codec pcm_s16le, is
>>>> muxed as a private data stream and may not be
>>>> recognized upon reading.
>>>> ...............
>>>>
>>>>
>>>> I tried also the other -field_order values according to
>>>> the ffmpeg manual: 'tt', 'tb', 'bt'
>>>> but all changed the input DV interlaced videdo to Scan
>>>> type Progressive MPEG-2 output video, as in first post
>>>> below.
>>>>
>>>>
>>>>
>>>> there also some other suggestions, like -top 1 (tff?)
>>>> and/or two i* flags (interlaced dct, motion estimation)
>>>>
>>>> you can also try to set -profile to some dvd variant may be
>>>> it will be smart enough to at least add all flags correctly
>>>> ....
>>>
>>>
>>> I tried '-flags +ilme+ildct' and got the output video kept
>>> interlaced BFF
>>> The Bit rate parameters are just copied from the 2021
>>> command line. Not sure what -refs 1 -bf 2 and -dc 10 do (?)
>>> '-c:a copy -mpegts_m2ts_mode 1' doesn't help here with
>>> regards to LPCM, which disappear in a private stream!?
>>>
>>>
>>>
>>>
>>> do not do c:a copy, try same bluray pcm or ac3 with high bitrate
>>> ....
>>>
>>>
>>
>>
>> Thank you, pcm_bluray worked better. I thought LPCM from DV now
>> was equivalent to and accepted muxed with ffmpeg.mts
>> I can hear the audio with VLC, and will try bdwrie to udffs and
>> burn it to disc to-morrow.
>>
>>
>> Latest code line
>> ffmpeg -i dv28.dv -c:v mpeg2video -refs 1 -bf 2 -b:v 25M -maxrate
>> 25M -minrate 25M -bufsize 45M -muxrate 45M -dc 10 -c:a
>> pcm_bluray -mpegts_m2ts_mode 1 -flags +ilme+ildct
>> dv28-mpeg2-SD-bluray.mts
>
>
>
> may be change bufsize and muxrate down to 25M too ?
I tried tests with each and both set down to 25M and got the file size
shrinked to 456M
But at the same time a lot of invalid messages arrived from ffmpeg
encoder : Lavc59.37.100 pcm_bluray
[mpegts @ 0x55bec4e8a040] dts < pcr, TS is invalid00:05.00
bitrate=24327.0kbits/s speed=9.81x
Last message repeated 30 times
...........snip
[mpegts @ 0x55bec4e8a040] dts < pcr, TS is invalid02:05.28
bitrate=27871.6kbits/s speed=6.59x
Last message repeated 378 times
[mpegts @ 0x55bec4e8a040] dts < pcr, TS is invalid02:12.44
bitrate=27869.1kbits/s speed=6.79x
Last message repeated 247 times
I seem to remember there were similar (overrun?) messages earlier for
the dvd/vob video, before we tuned up bufsize and muxrate .....
>
>
>
>>
>>
>> ffmpeg -i dv28-mpeg2-SD-bluray.mts 2>&1 >/dev/null | egrep
>> "Video|Audio"
>> Stream #0:0[0x1011]: Video: mpeg2video (Main) ([2][0][0][0] /
>> 0x0002), yuv420p(tv, bottom first), 720x576 [SAR 16:15 DAR 4:3],
>> 25 fps, 25 tbr, 90k tbn
>> Stream #0:1[0x1100]: Audio: pcm_bluray ([128][0][0][0] /
>> 0x0080), 48000 Hz, stereo, s16, 1536 kb/s
>>
>
>
> Yes, I got the dv28-mpeg2-SD-bluray.mts file written to udfs with
> bdwrite and burned with K3b to a BD-RE disc. The SD Blu-ray disc
> was also auto-playable in the Blu-ray hardare player.
>
> But look at the file-sizes, where the latest mts file is 749M,
> that is 60-70% bigger than the DV source and the previous
> generated iso, m2ts and mpg files.
>
> 457M dv28_25mbps.iso
> 455M dv28_25mbps.m2ts
> 437M dv28_25mbps.mpg
> 458M dv28_Blu-ray.iso
> 470M dv28.dv
> ----------------------
> 749M dv28-mpeg2-SD-bluray.mts
>
>
> Is there any difference in the bit rate syntax or other in the
> ffmpeg code line that causes the video data rate to be much bigger?
>
>
> Here is diff between the most relevant output from mediainfo for
> two of the written SD Blu-ray video files:
>
> diff <(mediainfo dv28-mpeg2-SD-bluray.mts | egrep
> 'Format|Scan|Bit|size') <(mediainfo dv28_25mbps.iso | egrep
> 'Format|Scan|Bit|size')
>
> 1,3c1,3
> < Format : BDAV
> < Format/Info : Blu-ray Video
> < File size : 749 MiB
> ---
> > Format : MPEG Video
> > Format version : Version 2
> > File size : 457 MiB
> 11d10
> < Format settings, picture structure : Frame
> 13c12
> < Bit rate : 42.6 Mb/s
> ---
> > Bit rate : 28.0 Mb/s
> 15,25c14,16
> < Scan type : Interlaced
> < Scan order : Bottom Field First
> < Bits/(Pixel*Frame) : 4.108
> < Stream size : 694 MiB (93%)
> < Format : PCM
> < Format settings : Big / Signed
> < Bit rate mode : Constant
> < Bit rate : 1 536 kb/s
> < Bit depth : 16 bits
> < Stream size : 25.0 MiB (3%)
> < Format : MPEG Video / PCM
> ---
> > Scan type : Progressive
> > Bits/(Pixel*Frame) : 2.703
> > Stream size : 457 MiB (100%)
>
> -----------------
>
>>
>>>
>>>
>>>
>>>
>>> ffmpeg -i dv28.dv -c:v mpeg2video -refs 1 -bf 2 -b:v 25M
>>> -maxrate 25M -minrate 25M -bufsize 45M -muxrate 45M -dc 10
>>> -c:a copy -mpegts_m2ts_mode 1 -flags +ilme+ildct
>>> dv28-mpeg2-SD-bluray.mts
>>> ................
>>> Stream #0:0: Video: mpeg2video (Main), yuv420p(bottom coded
>>> first (swapped)), 720x576 [SAR 16:15 DAR 4:3], q=2-31, 25000
>>> kb/s, 25 fps, 90k tbn
>>> Metadata:
>>> encoder : Lavc59.37.100 mpeg2video
>>> Side data:
>>> cpb: bitrate max/min/avg: 25000000/25000000/25000000
>>> buffer size: 45000000 vbv_delay: N/A
>>> Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536
>>> kb/s
>>> [mpegts @ 0x560287e48040] Stream 1, codec pcm_s16le, is
>>> muxed as a private data stream and may not be recognized
>>> upon reading.
>>> frame= 3416 fps=373 q=1.6 Lsize= 766566kB time=00:02:16.64
>>> bitrate=45958.1kbits/s speed=14.9x
>>> video:415619kB audio:25620kB subtitle:0kB other streams:0kB
>>> global headers:0kB muxing overhead: 73.730377%
>>>
>>>
>>> mediainfo dv28-mpeg2-SD-bluray.mts | egrep
>>> 'Format|Scan|Width|Height|Bit'
>>> Format : BDAV
>>> Format/Info : Blu-ray Video
>>> Format : MPEG Video
>>> Format version : Version 2
>>> Format profile : Main at Main
>>> Format settings : BVOP
>>> Format settings, BVOP : Yes
>>> Format settings, Matrix : Default
>>> Format settings, GOP : M=3, N=12
>>> Format settings, picture structure : Frame
>>> Bit rate mode : Variable
>>> Bit rate : 44.1 Mb/s
>>> Width : 720 pixels
>>> Height : 576 pixels
>>> Bit depth : 8 bits
>>> Scan type : Interlaced
>>> Scan order : Bottom Field First
>>> Bits/(Pixel*Frame) : 4.256
>>> Format : MPEG Video /
>>>
>>>
>>>>
>>>>
>>>>
>>>> A side notes;
>>>> 1080i HDV (scan order tff) copied to Blu-ray MPEG-2 did
>>>> work interlaced.
>>>>
>>>> According to wikipedia the supported SD formats on
>>>> Blu-ray video are interlaced 720×576 25i and 720×480
>>>> 29.97i, 4:3 or 16:9
>>>> Yet, the SD VOB (dvd) progressive mpeg-2 video I
>>>> encoded to BD, did playback in my Blu-ray hardware player.
>>>>
>>>>
>>>>
>>>>>
>>>>> ср, 7 дек. 2022 г., 01:53 Terje J. Hanssen via Cin
>>>>> <cin at lists.cinelerra-gg.org>:
>>>>>
>>>>> With HDV 'in the Blu-ray box' I would like to test
>>>>> if it possible to use
>>>>> equivalent procedures for DV to SD-Blu-ray video.
>>>>>
>>>>> That is continue as an alternative to the 2021
>>>>> thread here:
>>>>> https://lists.cinelerra-gg.org/pipermail/cin/2021-December/004268.html
>>>>>
>>>>> Blu-ray compliant MPEG-2 SD video with LPCM audio
>>>>> -------------------------------------------------
>>>>>
>>>>> 1) Encode DV to MPEG-2 video and copy PCM audio as
>>>>> is to a VOB/MPG format:
>>>>>
>>>>> ffmpeg -i dv28.dv -c:v mpeg2video -refs 1 -bf 2
>>>>> -b:v 25M -maxrate 25M
>>>>> -minrate 25M -bufsize 45M -muxrate 45M -dc 10 -c:a
>>>>> pcm_s16be -f vob
>>>>> dv28_25mbps.mpg
>>>>>
>>>>> 2) tsMuxer
>>>>> As FFMpeg (then) would not allow to mux PCM or
>>>>> remux MPG to M2TS, I
>>>>> tested tsMuxer,
>>>>> see the attached screenshot: tsMuxer_SD_M2TS
>>>>> Input file: dv28_25mbps.mpg
>>>>> Tracs: MPEG-2 video stream and LPCM audio stream
>>>>> Output: dv28_25mbps.iso
>>>>>
>>>>> ------------------------
>>>>>
>>>>> Using Mediainfo to compare the source dv28.dv
>>>>> ffmpeg input file with its
>>>>> output file dv28_25mbps.mpg (intermediate) and
>>>>> with the resulting
>>>>> dv28_25mbps.iso, show that the interlaced dv video
>>>>> was changed to
>>>>> progressive VOB/BVOB dvd video.
>>>>>
>>>>> > mediainfo dv28.dv | egrep
>>>>> 'Format|Scan|Width|Height|Bit'
>>>>> Format : DV
>>>>> Format : DV
>>>>> Bit rate mode : Constant
>>>>> Bit rate : 24.4 Mb/s
>>>>> Width : 720 pixels
>>>>> Height : 576 pixels
>>>>> Bit depth : 8 bits
>>>>> Scan type : Interlaced
>>>>> Scan order : Bottom Field First
>>>>> Bits/(Pixel*Frame) : 2.357
>>>>> Format : PCM
>>>>> Format settings : Big / Signed
>>>>> Bit rate mode : Constant
>>>>> Bit rate : 1 536 kb/s
>>>>> Bit depth : 16 bits
>>>>>
>>>>> > mediainfo dv28_25mbps.mpg | egrep
>>>>> 'Format|Scan|Width|Height|Bit'
>>>>> Format : MPEG-PS
>>>>> Format : MPEG Video
>>>>> Format version : Version 2
>>>>> Format profile : Main at Main
>>>>> Format settings : BVOP
>>>>> Format settings, BVOP : Yes
>>>>> Format settings, Matrix : Default
>>>>> Format settings, GOP : M=3, N=12
>>>>> Bit rate mode : Variable
>>>>> Bit rate : 24.7 Mb/s
>>>>> Width : 720 pixels
>>>>> Height : 576 pixels
>>>>> Bit depth : 8 bits
>>>>> Scan type : Progressive
>>>>> Bits/(Pixel*Frame) : 2.384
>>>>> Format : PCM
>>>>> Format settings : Big / Signed
>>>>> Bit rate mode : Constant
>>>>> Bit rate : 1 536 kb/s
>>>>> Bit depth : 16 bits
>>>>>
>>>>> > mediainfo dv28_25mbps.iso | egrep
>>>>> 'Format|Scan|Width|Height|Bit'
>>>>> Format : MPEG Video
>>>>> Format version : Version 2
>>>>> Format : MPEG Video
>>>>> Format version : Version 2
>>>>> Format profile : Main at Main
>>>>> Format settings : BVOP
>>>>> Format settings, BVOP : Yes
>>>>> Format settings, Matrix : Default
>>>>> Format settings, GOP : M=3, N=12
>>>>> Bit rate mode : Variable
>>>>> Bit rate : 28.0 Mb/s
>>>>> Width : 720 pixels
>>>>> Height : 576 pixels
>>>>> Bit depth : 8 bits
>>>>> Scan type : Progressive
>>>>> Bits/(Pixel*Frame) : 2.703
>>>>>
>>>>> -----------------------------------
>>>>>
>>>>> That is, suggestion how to merge/customize the
>>>>> newer ffmpeg HDV to
>>>>> Blu-ray procedure
>>>>> ffmpeg -i hdv.m2t -c:v copy -c:a pcm_bluray
>>>>> -mpegts_m2ts_mode 1 output.mts
>>>>>
>>>>> for SD-DV to keep it interlaced and get
>>>>> dv28_25mbps.m2ts muxed directly?
>>>>>
>>>>> ------------------
>>>>>
>>>>> I did a first try with the following line, without
>>>>> taking care of
>>>>> 25mbps, but got lost the pcm audio to a privat
>>>>> stream (change mode?).
>>>>> Additional the vido is not kept interlaced.
>>>>>
>>>>>
>>>>> ffmpeg version 5.1.2 Copyright (c) 2000-2022 the
>>>>> FFmpeg developers
>>>>> built with gcc 12 (SUSE Linux)
>>>>> ..........snip
>>>>> [dv @ 0x55b59acfeb80] Estimating duration from
>>>>> bitrate, this may be
>>>>> inaccurate
>>>>> Input #0, dv, from 'dv28.dv':
>>>>> Metadata:
>>>>> timecode : 00:00:00:00
>>>>> Duration: 00:02:16.64, start: 0.000000,
>>>>> bitrate: 28800 kb/s
>>>>> Stream #0:0: Video: dvvideo, yuv420p, 720x576
>>>>> [SAR 16:15 DAR 4:3],
>>>>> 25000 kb/s, 25 fps, 25 tbr, 25 tbn
>>>>> Stream #0:1: Audio: pcm_s16le, 48000 Hz,
>>>>> stereo, s16, 1536 kb/s
>>>>> Stream mapping:
>>>>> Stream #0:0 -> #0:0 (dvvideo (native) ->
>>>>> mpeg2video (native))
>>>>> Stream #0:1 -> #0:1 (copy)
>>>>> Press [q] to stop, [?] for help
>>>>> Output #0, mpegts, to 'dv28-mpeg2-SD-bluray.mts':
>>>>> Metadata:
>>>>> timecode : 00:00:00:00
>>>>> encoder : Lavf59.27.100
>>>>> Stream #0:0: Video: mpeg2video (Main),
>>>>> yuv420p(bottom coded first
>>>>> (swapped)), 720x576 [SAR 16:15 DAR 4:3], q=2-31,
>>>>> 200 kb/s, 25 fps, 90k tbn
>>>>> Metadata:
>>>>> encoder : Lavc59.37.100 mpeg2video
>>>>> Side data:
>>>>> cpb: bitrate max/min/avg: 0/0/200000 buffer
>>>>> size: 0 vbv_delay: N/A
>>>>> Stream #0:1: Audio: pcm_s16le, 48000 Hz,
>>>>> stereo, s16, 1536 kb/s
>>>>> [mpegts @ 0x55b59ad3dd40] Stream 1, codec
>>>>> pcm_s16le, is muxed as a
>>>>> private data stream and may not be recognized upon
>>>>> reading.
>>>>> frame= 3416 fps=586 q=31.0 Lsize= 39336kB
>>>>> time=00:02:16.64
>>>>> bitrate=2358.3kbits/s speed=23.4x
>>>>> video:11070kB audio:25620kB subtitle:0kB other
>>>>> streams:0kB global
>>>>> headers:0kB muxing overhead: 7.211923%
>>>>> terje at localhost:/run/media/terje/Seagate_4TB_back/data/Video-test/SD_Blu-ray>
>>>>>
>>>>>
>>>>> terje at localhost:/run/media/terje/Seagate_4TB_back/data/Video-test/SD_Blu-ray>
>>>>>
>>>>> ffmpeg -i dv28-mpeg2-SD-bluray.mts 2>&1 >/dev/null
>>>>> | egrep "Video|Audio"
>>>>> Stream #0:0[0x1011]: Video: mpeg2video (Main)
>>>>> ([2][0][0][0] /
>>>>> 0x0002), yuv420p(tv, progressive), 720x576 [SAR
>>>>> 16:15 DAR 4:3], 25 fps,
>>>>> 25 tbr, 90k tbn
>>>>>
>>>>>
>>>>> mediainfo dv28-mpeg2-SD-bluray.mts | egrep
>>>>> 'Format|Scan|Width|Height|Bit'
>>>>> Format : BDAV
>>>>> Format/Info : Blu-ray
>>>>> Video
>>>>> Format : MPEG Video
>>>>> Format version : Version 2
>>>>> Format profile : Main at Main
>>>>> Format settings, BVOP : No
>>>>> Format settings, Matrix : Default
>>>>> Format settings, GOP : Variable
>>>>> Bit rate mode : Variable
>>>>> Bit rate : 2 257 kb/s
>>>>> Width : 720 pixels
>>>>> Height : 576 pixels
>>>>> Bit depth : 8 bits
>>>>> Scan type : Progressive
>>>>> Bits/(Pixel*Frame) : 0.218
>>>>> Format : MPEG
>>>>> Video /
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Cin mailing list
>>>>> Cin at lists.cinelerra-gg.org
>>>>> https://lists.cinelerra-gg.org/mailman/listinfo/cin
>>>>>
>>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20221209/59c2fbbd/attachment-0001.htm>
More information about the Cin
mailing list