<br><br>On Saturday, December 18, 2021, Terje J. Hanssen <<a href="mailto:terjejhanssen@gmail.com">terjejhanssen@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Den 17.12.2021 22:49, skrev Andrew Randrianasulu:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Saturday, December 18, 2021, Terje J. Hanssen via Cin <<a href="mailto:cin@lists.cinelerra-gg.org" target="_blank">cin@lists.cinelerra-gg.org</a> <mailto:<a href="mailto:cin@lists.cinelerra-gg.org" target="_blank">cin@lists.cinelerra-gg<wbr>.org</a>>> wrote:<br>
<br>
<br>
<br>
Den 17.12.2021 15:00, skrev Terje J. Hanssen:<br>
<br>
<br>
Den 17.12.2021 04:58, skrev Andrew Randrianasulu:<br>
<br>
<br>
<br>
On Friday, December 17, 2021, Terje J. Hanssen<br>
<<a href="mailto:terjejhanssen@gmail.com" target="_blank">terjejhanssen@gmail.com</a> <mailto:<a href="mailto:terjejhanssen@gmail.com" target="_blank">terjejhanssen@gmail.co<wbr>m</a>><br>
<mailto:<a href="mailto:terjejhanssen@gmail.com" target="_blank">terjejhanssen@gmail.co<wbr>m</a><br>
<mailto:<a href="mailto:terjejhanssen@gmail.com" target="_blank">terjejhanssen@gmail.co<wbr>m</a>>>> wrote:<br>
<br>
[......]<br>
<br>
===============<br>
<br>
I-frame-only 50 Megabit MPEG-2 or comparable DV50 in<br>
4:2:2 as<br>
high-end, "visually lossless" intermediate format for<br>
archival and<br>
suited for editing?<br>
<br>
-----------------<br>
<br>
Regarding DV50, FFMpeg has a friendly "target dv50"<br>
support<br>
(similar as "target DVD"). So to get a first look on a<br>
DV50 test<br>
file, I simply transcoded 422/10bit Video and PCM<br>
audio from a MOV<br>
file (ProRes 422HQ) to a raw DV50 (422/8bit) file:<br>
<br>
ffmpeg -i SD-MOV.mov -target pal-dv50 SD-DV50.dv<br>
<br>
[......]<br>
<br>
<br>
205M SD-DV50.dv (ffmpeg re-encoded/remuxed) AV-info:<br>
<br>
avprobe SD-DV50.dv<br>
avprobe version 12.3, Copyright (c) 2007-2018 the<br>
Libav developers<br>
built on Mar 26 2018 12:39 with gcc 11 (SUSE Linux)<br>
[dv @ 0x55cdddb96440] Estimating duration from<br>
bitrate, this may<br>
be inaccurate<br>
Input #0, dv, from 'SD-DV50.dv':<br>
Metadata:<br>
timecode : 00:00:00:00<br>
Duration: 00:00:29.80, start: 0.000000, bitrate:<br>
57600 kb/s<br>
Stream #0:0: Video: dvvideo, yuv422p, 720x576 [SAR<br>
16:15 DAR<br>
4:3], 25000 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc<br>
Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo,<br>
s16, 1536 kb/s<br>
Stream #0:2: Audio: pcm_s16le, 48000 Hz, stereo,<br>
s16, 1536 kb/s<br>
# avprobe output<br>
<br>
===================<br>
<br>
As seen above, it looks like ffmpeg produced wrong<br>
meta data for<br>
the DV50 video bitrate (25 Mb/s=DV25), while the total<br>
bitrate<br>
57.6 Mb/s is correct. (Also similar was seen with<br>
ffprobe and<br>
Mediainfo).<br>
<br>
My VLC player or Gnome movieplayer did not playback<br>
the DV50 file,<br>
while ffplay did (as usual without audio?).<br>
<br>
Cin-GG miss a DV50 preset among format setting.<br>
However DV50 else<br>
loades preliminary OK in Cin-GG (via ffmpeg).<br>
<br>
<br>
I'll look at dv50 output preset..<br>
<br>
Fine<br>
<br>
===============<br>
<br>
I tried also to transcode and remux 422 Video and PCM Audio to a<br>
50 Mbps MPEG-2 I-frame only program stream.<br>
<br>
1) MPG From MOV (ProRes 422HQ)<br>
------------------------------<br>
<br>
ffmpeg -i SD-MOV.mov -c:v mpeg2video -bf 2 -b:v 50M -maxrate 50M<br>
-minrate 50M -c:a pcm_s16be -f vob SD-MP2I-50.mpg<br>
[....]<br>
Stream mapping:<br>
Stream #0:0 -> #0:0 (prores (native) -> mpeg2video (native))<br>
Stream #0:1 -> #0:1 (pcm_s24le (native) -> pcm_s16be (native))<br>
Press [q] to stop, [?] for help<br>
[mpeg2video @ 0x560ffd164ec0] Automatically choosing VBV buffer<br>
size of 746 kbyte<br>
[vob @ 0x560ffd14d180] At most 8 channels allowed for LPCM streams.<br>
Could not write header for output file #0 (incorrect codec<br>
parameters ?): Invalid argument<br>
Error initializing output stream 0:1 --<br>
<br>
***This failed because PreRes Audio uses 16 channels:***<br>
<br>
<br>
yeah... interesting limitation.. and interesting number of channels..<br>
<br>
<br>
ffprobe SD-MOV.mov 2>&1 >/dev/null | grep Stream.*Audio<br>
Stream #0:1(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000<br>
Hz, 16 channels, s32 (24 bit), 18432 kb/s (default)<br>
<br>
<br>
2) MPG from DV50<br>
----------------<br>
ffmpeg -i SD-DV50.dv -c:v mpeg2video -bf 2 -b:v 50M -maxrate 50M<br>
-minrate 50M -c:a pcm_s16be -f vob SD-MP2I-50.mpg<br>
<br>
du -sh *<br>
205M SD-DV50.dv<br>
284M SD-MOV.mov<br>
186M SD-MP2I-50.mpg<br>
<br>
avprobe SD-MP2I-50.mpg<br>
Input #0, mpeg, from 'SD-MP2I-50.mpg':<br>
Duration: 00:00:29.77, start: 0.540000, bitrate: 52167 kb/s<br>
Stream #0:0[0x1e0]: Video: mpeg2video (4:2:2), yuv422p(tv,<br>
progressive), 720x576 [SAR 16:15 DAR 4:3], 50000 kb/s, 25 fps, 25<br>
tbr, 90k tbn, 50 tbc<br>
Stream #0:1[0xa0]: Audio: pcm_dvd, 48000 Hz, 2 channels, s16,<br>
1536 kb/s<br>
<br>
***** The SD-MP2I-50.mpg file size is here 90% of DV50 ********<br>
<br>
The SD-MP2I-50.mpg playback ok with VLC, Gnome movieplayer,<br>
ffplay, and loads and playback in Cin-GG<br>
The audio volume seems low (weak), but can probably be adjusted<br>
higher with ffmpeg<br>
<br>
<br>
well, but I missed keyframe parameter? bitrate is big but I think without special param ffmpeg still will not make all-I mpeg2 stream..?<br>
<br>
<br>
</blockquote>
<br>
The first Video part of my ffmpeg script was based on this standard FFmpeg Howto for<br>
"MPEG-2 I-frame only Highest Quality Encoding", which didn't include a keyframe parameter !?<br>
<a href="https://brunosan.eu/images/ffmpeg_howto.html#Encoding_MPEG-2_I-frame_only_in_Highest_Quality" target="_blank">https://brunosan.eu/images/ffm<wbr>peg_howto.html#Encoding_MPEG-<wbr>2_I-frame_only_in_Highest_<wbr>Quality</a><br>
<br>
ffmpeg -i <input_file> -vcodec mpeg2video -pix_fmt yuv422p -qscale 1 -qmin 1 -intra -an output.m2v</blockquote><div><br></div><div> </div><div>you missed </div><div><br></div><div>-intra? </div><div><br></div><div>ffmpeg changes cmd line and API quickly.. (</div><div><br></div><div>try "-g 1" and check keyframes with some linevlike those? </div><div><br></div><div><a href="https://snippets.bentasker.co.uk/page-1707191206-Get-Video-Keyframe-Interval-(ffprobe)-BASH.html">https://snippets.bentasker.co.uk/page-1707191206-Get-Video-Keyframe-Interval-(ffprobe)-BASH.html</a></div><div><br></div><div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I dropped -pix_fmt yuv422p when I saw it was detected and automatic from the input file.<br>
<br>
<br>
So I added the second PCM Audio part (similar I did for SD-DV) according to 1. Answer at<br>
<a href="https://stackoverflow.com/questions/48265448/mpeg-2-program-stream-w-pcm-audio" target="_blank">https://stackoverflow.com/ques<wbr>tions/48265448/mpeg-2-program-<wbr>stream-w-pcm-audio</a><br>
<br>
FFmpeg only supports muxing 16 bit PCM in a MPEG2 PS. Use<br>
<br>
ffmpeg -i "input.mov" \<br>
-c:v mpeg2video -pix_fmt yuv422p -bf 2 -b:v 50M -maxrate 50M -minrate 50M \<br>
-s 1920x1080 -aspect 16:9 \<br>
-c:a pcm_s16be -f vob "output.mpg"<br>
<br>
The -f vob is needed to force a MPEG-2 PS, else ffmpeg will select MPEG-1 Systems muxer.<br>
<br>
<br>
<br>
<br>
</blockquote>