Selur's Little Message Board

Full Version: different frame counts in the source and in the destination file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Unless I can reproduce the problem, I have no clue how to help.

Cu Selur
re-save that xvid+pcm source.avi of yours as some lossless video codec(that ffmpeg supports)+pcm in vdub, then try again....see if the 'interleave' parameters of mediainfo changed....on the bottom of "text" output.

slightly unorthodox combo there, xvid with b frames and pcm audio.
I converted the source.avi to fvhuff.avi
Code:
ffmpeg -y -noautorotate -nostdin -threads 8 -i "C:\Users\Selur\Desktop\source.avi" -map 0:0 -an -sn -color_primaries bt470bg -color_trc smpte170m -colorspace bt470bg -color_range tv  -pix_fmt yuv420p10le -strict -1 -vsync 0 -vcodec ffvhuff -coder 0 -context 0 -non_deterministic true -metadata encoding_tool="Hybrid 2024.03.01.1" "J:\tmp\ffvhuff_1_2024-03-02@08_03_46_4610_02.avi"
and got:
Code:
General
Count                                    : 349
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Count of audio streams                   : 1
Video_Format_List                        : HuffYUV
Video_Format_WithHint_List               : HuffYUV
Codecs Video                             : HuffYUV
Audio_Format_List                        : PCM
Audio_Format_WithHint_List               : PCM
Audio codecs                             : PCM
Audio_Channels_Total                     : 2
Complete name                            : g:\Output\ffvhuff.avi
Folder name                              : g:\Output
File name extension                      : ffvhuff.avi
File name                                : ffvhuff
File extension                           : avi
Format                                   : AVI
Format                                   : AVI
Format/Info                              : Audio Video Interleave
Format/Extensions usually used           : avi
Commercial name                          : AVI
Format settings                          : PcmWaveformat
Internet media type                      : video/vnd.avi
Interleaved                              : Yes
File size                                : 114173262
File size                                : 109 MiB
File size                                : 109 MiB
File size                                : 109 MiB
File size                                : 109 MiB
File size                                : 108.9 MiB
Duration                                 : 14882
Duration                                 : 14 s 882 ms
Duration                                 : 14 s 882 ms
Duration                                 : 14 s 882 ms
Duration                                 : 00:00:14.882
Duration                                 : 00:00:14;26
Duration                                 : 00:00:14.882 (00:00:14;26)
Overall bit rate                         : 61375225
Overall bit rate                         : 61.4 Mb/s
Frame rate                               : 29.970
Frame rate                               : 29.970 FPS
Frame count                              : 446
Stream size                              : 37582
Stream size                              : 36.7 KiB (0%)
Stream size                              : 37 KiB
Stream size                              : 37 KiB
Stream size                              : 36.7 KiB
Stream size                              : 36.70 KiB
Stream size                              : 36.7 KiB (0%)
Proportion of this stream                : 0.00033
File creation date                       : 2024-03-02 07:03:50.649 UTC
File creation date (local)               : 2024-03-02 08:03:50.649
File last modification date              : 2024-03-02 07:03:50.791 UTC
File last modification date (local)      : 2024-03-02 08:03:50.791
Writing application                      : Lavf60.20.100
Writing application                      : Lavf60.20.100

Video
Count                                    : 390
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 0
ID                                       : 0
Format                                   : HuffYUV
Format                                   : HuffYUV
Commercial name                          : HuffYUV
Format version                           : Version 3
Codec ID                                 : FFVH
Codec ID/Url                             : http://ffdshow-tryout.sourceforge.net/
Duration                                 : 14882
Duration                                 : 14 s 882 ms
Duration                                 : 14 s 882 ms
Duration                                 : 14 s 882 ms
Duration                                 : 00:00:14.882
Duration                                 : 00:00:14;26
Duration                                 : 00:00:14.882 (00:00:14;26)
Bit rate                                 : 59824330
Bit rate                                 : 59.8 Mb/s
Width                                    : 640
Width                                    : 640 pixels
Height                                   : 480
Height                                   : 480 pixels
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.333
Display aspect ratio                     : 4:3
Frame rate                               : 29.970
Frame rate                               : 29.970 (30000/1001) FPS
FrameRate_Num                            : 30000
FrameRate_Den                            : 1001
Frame count                              : 446
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 10
Bit depth                                : 10 bits
Scan type                                : Progressive
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 6.498
Delay                                    : 0
Delay                                    : 00:00:00.000
Delay                                    : 00:00:00;00
Delay                                    : 00:00:00.000 (00:00:00;00)
Stream size                              : 111284832
Stream size                              : 106 MiB (97%)
Stream size                              : 106 MiB
Stream size                              : 106 MiB
Stream size                              : 106 MiB
Stream size                              : 106.1 MiB
Stream size                              : 106 MiB (97%)
Proportion of this stream                : 0.97470

Audio
Count                                    : 285
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
StreamOrder                              : 1
ID                                       : 1
ID                                       : 1
Format                                   : PCM
Format                                   : PCM
Commercial name                          : PCM
Format settings                          : Little / Signed
Format settings, Endianness              : Little
Format settings, Sign                    : Signed
Codec ID                                 : 1
Codec ID/Url                             : http://www.microsoft.com/windows/
Duration                                 : 14848
Duration                                 : 14 s 848 ms
Duration                                 : 14 s 848 ms
Duration                                 : 14 s 848 ms
Duration                                 : 00:00:14.848
Duration                                 : 00:00:14.848
Bit rate mode                            : CBR
Bit rate mode                            : Constant
Bit rate                                 : 1536000
Bit rate                                 : 1 536 kb/s
Channel(s)                               : 2
Channel(s)                               : 2 channels
Sampling rate                            : 48000
Sampling rate                            : 48.0 kHz
Samples count                            : 712704
Bit depth                                : 16
Bit depth                                : 16 bits
Delay                                    : 0
Delay                                    : 00:00:00.000
Delay                                    : 00:00:00.000
Delay, origin                            : Stream
Delay, origin                            : Raw stream
Delay relative to video                  : 0
Delay relative to video                  : 00:00:00.000
Delay relative to video                  : 00:00:00.000
Stream size                              : 2850848
Stream size                              : 2.72 MiB (2%)
Stream size                              : 3 MiB
Stream size                              : 2.7 MiB
Stream size                              : 2.72 MiB
Stream size                              : 2.719 MiB
Stream size                              : 2.72 MiB (2%)
Proportion of this stream                : 0.02497
Alignment                                : Aligned
Alignment                                : Aligned on interleaves
Interleave, duration                     : 0.64
Interleave, duration                     : 21
Interleave, duration                     : 21  ms (0.64 video frame
I noticed:
a. video frame count changed 'Frame count : 446' (not surprised, since b-frames in .avi is kind of 'hacky')
b. 'Interleave, duration' changed
Loading that file as source and looking at the source in the Vapoursynth/Avisynth Preview, as expected only (the original) 445 frames are there, so the actual frame count hasn't changed, just what mediainfo is reporting. (not surprised, since b-frames in .avi is kind of 'hacky')

Converting the video with NVEncC:
Code:
ffmpeg -y -loglevel fatal -noautorotate -nostdin -threads 8 -i "C:\Users\Selur\Desktop\ffvhuff.avi" -map 0:0 -an -sn -color_primaries bt470bg -color_trc smpte170m -colorspace bt470bg -color_range tv  -pix_fmt yuv420p10le -strict -1 -vsync 0 -f yuv4mpegpipe - | NVEnc --y4m -i - --fps 29.970 --codec av1 --sar 1:1 --output-depth 10 --vbr 0 --vbr-quality 23.00 --aq --aq-strength 5 --aq-temporal --gop-len 0 --ref 7 --multiref-l0 3 --multiref-l1 3 --bframes 3 --bref-mode auto --mv-precision Q-pel --preset quality --colorrange limited --colormatrix bt470bg --cuda-schedule sync --output "J:\tmp\reencode_1_2024-03-02@08_13_31_2910_01.av1"
I get:
Code:
General
Count                                    : 349
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Video_Format_List                        : AV1
Video_Format_WithHint_List               : AV1
Codecs Video                             : AV1
Complete name                            : g:\Output\reencode.mp4
Folder name                              : g:\Output
File name extension                      : reencode.mp4
File name                                : reencode
File extension                           : mp4
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v
Commercial name                          : MPEG-4
Format profile                           : Base Media
Internet media type                      : video/mp4
Codec ID                                 : iso4
Codec ID                                 : iso4 (iso4/av01)
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
CodecID_Compatible                       : iso4/av01
File size                                : 5404547
File size                                : 5.15 MiB
File size                                : 5 MiB
File size                                : 5.2 MiB
File size                                : 5.15 MiB
File size                                : 5.154 MiB
Duration                                 : 14847
Duration                                 : 14 s 847 ms
Duration                                 : 14 s 847 ms
Duration                                 : 14 s 847 ms
Duration                                 : 00:00:14.847
Duration                                 : 00:00:14;25
Duration                                 : 00:00:14.847 (00:00:14;25)
Overall bit rate                         : 2912129
Overall bit rate                         : 2 912 kb/s
Frame rate                               : 29.970
Frame rate                               : 29.970 FPS
Frame count                              : 445
Stream size                              : 2774
Stream size                              : 2.71 KiB (0%)
Stream size                              : 3 KiB
Stream size                              : 2.7 KiB
Stream size                              : 2.71 KiB
Stream size                              : 2.709 KiB
Stream size                              : 2.71 KiB (0%)
Proportion of this stream                : 0.00051
HeaderSize                               : 2690
DataSize                                 : 5401781
FooterSize                               : 76
IsStreamable                             : Yes
Encoded date                             : 2024-03-02 07:13:58 UTC
Tagged date                              : 2024-03-02 07:13:58 UTC
File creation date                       : 2024-03-02 07:13:58.684 UTC
File creation date (local)               : 2024-03-02 08:13:58.684
File last modification date              : 2024-03-02 07:13:58.702 UTC
File last modification date (local)      : 2024-03-02 08:13:58.702
Writing application                      : Hybrid 2024.03.01.1
Writing application                      : Hybrid 2024.03.01.1

Video
Count                                    : 391
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 1
ID                                       : 1
Format                                   : AV1
Format                                   : AV1
Format/Info                              : AOMedia Video 1
Format/Url                               : http://aomedia.org/
Commercial name                          : AV1
Format profile                           : Main@L3.0
Codec ID                                 : av01
Duration                                 : 14847
Duration                                 : 14 s 847 ms
Duration                                 : 14 s 847 ms
Duration                                 : 14 s 847 ms
Duration                                 : 00:00:14.847
Duration                                 : 00:00:14;25
Duration                                 : 00:00:14.847 (00:00:14;25)
Bit rate                                 : 2910402
Bit rate                                 : 2 910 kb/s
Maximum bit rate                         : 3555928
Maximum bit rate                         : 3 556 kb/s
Width                                    : 640
Width                                    : 640 pixels
Height                                   : 480
Height                                   : 480 pixels
Sampled_Width                            : 640
Sampled_Height                           : 480
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.333
Display aspect ratio                     : 4:3
Rotation                                 : 0.000
Frame rate mode                          : CFR
Frame rate mode                          : Constant
Frame rate                               : 29.970
Frame rate                               : 29.970 (30000/1001) FPS
FrameRate_Num                            : 30000
FrameRate_Den                            : 1001
Frame count                              : 445
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 10
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.316
Stream size                              : 5401773
Stream size                              : 5.15 MiB (100%)
Stream size                              : 5 MiB
Stream size                              : 5.2 MiB
Stream size                              : 5.15 MiB
Stream size                              : 5.152 MiB
Stream size                              : 5.15 MiB (100%)
Proportion of this stream                : 0.99949
Encoded date                             : 2024-03-02 07:13:58 UTC
Tagged date                              : 2024-03-02 07:13:58 UTC
colour_description_present               : Yes
colour_description_present_Source        : Container / Stream
Color range                              : Limited
colour_range_Source                      : Container / Stream
colour_primaries_Source                  : Container / Stream
transfer_characteristics_Source          : Container / Stream
Matrix coefficients                      : BT.470 System B/G
matrix_coefficients_Source               : Container / Stream
Codec configuration box                  : av1C
with the original frame count of 445.

=> still can't reproduce the problem here.
I would have understood that the frame count in the container, detected by mediainfo, changed if aac audio was used, but since you mentioned that not using the audio gives you the same result, that can't be it.
Side note: If mediaInfo mentions 'Frame Count' and 'Source Frame Count' the 'Source Frame Count' is the frame count indicated by the video stream itself and the 'Frame Count' is the frame count indicated by the container. (so, even in your case, the actual frame count has not changed, just what the container indicates)



Cu Selur
i ment original poster should do it, not you, nothing for you to do here, it's obviously issue of container from 1992 used(and abused) for all sorts of things.
but good thing you did it anyway...heh...

oh yeah, nothing could stop me from exactly inspecting which frames were added or removed, in 50 frame increments on timeline...  Big Grin
Pages: 1 2