Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mpeg flow writes dummy data ! #33

Open
tgamal opened this issue Aug 1, 2018 · 2 comments
Open

Mpeg flow writes dummy data ! #33

tgamal opened this issue Aug 1, 2018 · 2 comments

Comments

@tgamal
Copy link

tgamal commented Aug 1, 2018

When I run mpeg flow on a couple of my videos I see that it writes a lot of dummy data. So if you have 2 frames in my video I will see around 512 dummy vectors in between
'''
pts=0 frame_index=1 pict_type=I output_type=arranged shape=56x28 origin=video
pts=1 frame_index=-1 pict_type=? output_type=arranged shape=56x28 origin=dummy
pts=2 frame_index=-1 pict_type=? output_type=arranged shape=56x28 origin=dummy
#----
pts=512 frame_index=2 pict_type=P output_type=arranged shape=56x28 origin=video
'''
Is it something wrong with my videos ?

@Squolly
Copy link

Squolly commented Sep 13, 2018

I had a similar problem. It happens because of lines 310 and 312 in mpegflow.c:

Line 310: if(!prev.empty() && pts != prev.back().Pts + 1)
Line 312: for(int64_t dummy_pts = prev.back().Pts + 1; dummy_pts < pts; dummy_pts++)

In both cases it is assumed the pts of consecutive frames increases by 1 which is not always the case. It depends on time_base in AVStream and the frame rate aimed for.
I assume if you change the +1 into +512 in both lines (and dummy_pts+=512) it may work in your case (in addition you would have to change Line 126 in vis.cpp too). In my case I tried to replace +1 with a delta calculated cased on time_base and avg_frame_rate (I don't know if it works for all videos yet).

A change should also consider to adjust Line 154 in mpegflow.cpp to work in cases without pkt_pts and pkt_dts.

@rohit-gupta
Copy link

Has anyone resolved this issue ? It seems like a waste of memory to do this, and pointlessly requires us to filter the text file afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants