检测到无效且无效的vfw-avi打包B帧 [英] Invalid and inefficient vfw-avi packed B frames detected

查看:66
本文介绍了检测到无效且无效的vfw-avi打包B帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在转换视频时,我收到消息Invalid and inefficient vfw-avi packed B frames detected.

I got message Invalid and inefficient vfw-avi packed B frames detected while video was converted.

转换视频后,我检查了视频中的像素值.值与原始视频不同.为什么值在转换后会发生变化?

After converting the video, I checked pixel values in video. Values are different from original video. Why values change after converting?

我使用无损帧内视频编解码器'ffv1'

and I use lossless intra-frame video codec 'ffv1'

命令: ffmpeg -i input_video -vcodec ffv1 -acodec pcm_s16le output_video

command : ffmpeg -i input_video -vcodec ffv1 -acodec pcm_s16le output_video

ffmpeg version 1.1.1 Copyright (c) 2000-2013 the FFmpeg developers  
built on Jan 20 2013 23:05:28 with gcc 4.7.2 (GCC)   configuration:
--enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib   libavutil      52. 13.100 / 52. 13.100   libavcodec     54. 86.100 / 54. 86.100   libavformat    54. 59.106 / 54. 59.106   libavdevice    54.  3.102 / 54.  3.102   libavfilter     3. 32.100 /  3. 32.100   libswscale      2.  1.103 / 
2.  1.103   libswresample   0. 17.102 /  0. 17.102   libpostproc    52.  2.100 / 52.  2.100 [mpeg4 @ 02e218c0] Invalid and inefficient vfw-avi packed B frames detected Input #0, avi, from
'D:\video_output\avi\1.avi':   Metadata:
    encoder         : Lavf54.59.106   Duration: 00:04:25.52, start: 0.000000, bitrate: 2744 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (DX50 / 0x30355844), yuv420p, 720x544 [SAR 1:1 DAR 45:34], 25 tbr, 25 tbn, 25
tbc
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s Output #0, matroska, to 'D:\video_output\avi\1_2.mkv': 
Metadata:
    encoder         : Lavf54.59.106
    Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv420p, 720x544 [SAR 1:1 DAR 45:34], q=2-31, 200 kb/s, 1k tbn, 25 tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Stream mapping:   Stream #0:0 -> #0:0 (mpeg4 -> ffv1)   Stream #0:1 ->
#0:1 (ac3 -> pcm_s16le) Press [q] to stop, [?] for help [mpeg4 @ 02e27920] Invalid and inefficient vfw-avi packed B frames detected
frame=   36 fps=0.0 q=0.0 size=    1916kB time=00:00:01.56
bitrate=10008.5kbits/s
...
frame= 6565 fps= 46 q=0.0 size=  862611kB time=00:04:22.72
bitrate=26897.5kbits/s     frame= 6594 fps= 46 q=0.0 size=  864799kB
time=00:04:23.87 bitrate=26848.0kbits/s     frame CRC mismatch frame=
6629 fps= 46 q=0.0 size=  866407kB time=00:04:25.20
bitrate=26763.2kbits/s     frame= 6638 fps= 46 q=0.0 Lsize=  866521kB
time=00:04:25.56 bitrate=26730.5kbits/s    

video:816725kB audio:49668kB subtitle:0 global headers:0kB muxing
overhead 0.014713%

c ++代码

void ProcessVideo::processFrame1(string fileName1, string fileName2) {
this->capture.open(fileName1);
if (!this->capture.isOpened())
    cout<<"video1 error";

get_videoInfo();

set_videoInfo();

this->capture1.open(fileName2);
if (!this->capture1.isOpened())
    cout<<"video2 error";

cv::Mat frame; // current video frame
cv::Mat frame1; // current video frame

cv::namedWindow("image1");
cv::namedWindow("image2");

int count = 0;
int count1 = 0;

while (1) {
    capture >> frame;
    capture1 >> frame1;

    if (frame.empty()) {
        //break;
        cout<<"Frame1 Empty"<<endl;
    }
    cv::Mat_<cv::Vec3b>::iterator it=frame.begin<cv::Vec3b>();
    cv::Mat_<cv::Vec3b>::iterator itend=frame.end<cv::Vec3b>();

    if (frame1.empty()) {
        //break;
        cout<<"Frame2 Empty"<<endl;
    }

    cv::Mat_<cv::Vec3b>::iterator it1=frame1.begin<cv::Vec3b>();
    cv::Mat_<cv::Vec3b>::iterator itend1=frame1.end<cv::Vec3b>();

    if(frame.empty() && frame1.empty()) {
        break;
    }

    count1++;

    int i=0,j=0,k=0;

    while(it!=itend && it1!=itend1) {
        ++it;
        ++it1;

        count++;

        if((*it)[0] != (*it1)[0]){
            i++;
        }
        else if((*it)[1] != (*it1)[1]){
            j++;
        }
        else if((*it)[2] != (*it1)[2]){
            k++;
        }
    }
    cout<<"count diffrent pixel : "<<i<<"\t"<<j<<"\t"<<k<<"\t";

    cout<<"\n------------------------"<<count1<<"finish frame-----------------------\n"<<endl;

    cv::imshow("image1", frame);
    cv::imshow("image2", frame1);
    cv::waitKey(1);
}

this->capture.release();
this->capture1.release();

}

推荐答案

avi容器格式不支持b帧.有些人使用"hack"将b帧放入avi容器. ffmpeg仅显示警告,让您知道由于输入文件不受支持而在转换过程中可能会遇到问题.至于不同的像素值",您将需要详细说明.视频压缩是一个有损过程.您不会获得与输入相同的值.只需足够接近"值即可.

The avi container format does not support b frames. There is a 'hack' that some people use to put b frames into avi containers. ffmpeg is just displaying a warning letting you know that it may run into problems during the conversion due to an unsupported input file. As far as different 'pixel values' You will need to elaborate. Video compression is a lossy process. You will not get the same values out that you put in. Just 'close enough' values.

如果您要进行多路复用(从一个容器转换为另一个而不进行代码转换),请使用 ffpmeg -acodec copy -vcodec copy

If you want to transmux (convert from one container to another without transcoding) use ffpmeg -acodec copy -vcodec copy

这篇关于检测到无效且无效的vfw-avi打包B帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆