Author Topic: SpaceX Falcon 9 v1.1 CRS-3 Splashdown Video Repair Task Thread  (Read 852841 times)

Offline theshadow27

  • Member
  • Posts: 28
  • Liked: 27
  • Likes Given: 7
Which bits of the log do you need? There's already quite a bit there above the image.

As for auto adding pos, currently, because of the way it's built, that would end up adding a bunch of effectively useless parts to the mmb (i.e. if you just click around and don't actually do anything) There might be a way round this, I'll have a think tomorrow when I get back from work =)

I meant the scrolling image interpretation log below the image - can you position that to show the relevant block as maybe the third line in the window? And actually now you point out the line above the image (which I had been looking for and never found for some reason), that has the current position of the block anyway so it's fairly easy to cut and paste across.

I suspect you hadn't seen it because it was added yesterday :) I think this change (the extra info at the top) is better than scrolling the log, right? Or do you still see utility in that? This might actually be relevant with the new dc value logging (see edit2).


IainCole: Since the MB already auto-populates the mmb field, I think he's referring to the byte offset of the MB into the "Invert Bits" box. In your code, that's var pos = parseInt(match[4]); near line 714. It could just fill in a new invert bits with a mask of 0.

Edit: I don't know about utility, but it would also be fun to have 8 checkboxes rather than typing in the hex. It would make it easier for non-software people to visualize. Maybe a shift left/right/invert button. I can code it if you're busy

Edit2: I didn't think that it was actually possible to scroll a textarea in js but apparently it is http://features.sheep.art.pl/AutoscrolledTextarea , though due to interop issues it's non-trivial. The trick would be to append one line at a time, recording the length of the string when you hit a mb_pos_info and storing it with the rest of the MB data. 
« Last Edit: 05/15/2014 04:40 AM by theshadow27 »

Offline theshadow27

  • Member
  • Posts: 28
  • Liked: 27
  • Likes Given: 7
The online editor 2 will also have an updated version of those iframes for those that are using that tool.

Just to add on this: Big thanks to Iain for implementing some pretty cool new features in http://spacex.slapbet.org

- MB Errors (from the log) are now shown next to the MB X:Y display above the image when an MB is clicked. This includes DC clipping, dquant, ibpc, ac-tex, and stuffing (though I'm not even sure what they all mean ;) ).

...

Just to follow up with this, michaelni gave a nice description of each error on the IRC:

Quote from: michaelni
dquant means that a MB that changes the QP has occured, thats no error but possibly is not used by the encoder which in that case could be used to detect errors

ac-tex damaged means that something went wrong during decoding of the ac coefficients, for example the sum of runs being larger than the space in a 8x8 block or a invalid vlc

I cbpy damaged means that where the cbpy is stored there was a bit sequence that maps to no valid intra cbpy

marker bit missing in X. esc means that a bit that is required to be 1 in the ac coefficient escape coding was not 1

stuffing is a method used to increase the bitrate, aka to stuff (useless) bits in the stream, its allowed in mpeg4 but i suspect the encoder doesnt use it so it could be used to identify errors. That is, one MB type is for stuffing and when that occurs the decoder throws it away and reads the mb type again until it finds a non stuffing one, that way the bitstream can be filled up to reach some bitrate. So like the null TS packets, but at a MB level, probably meaning that the MB type is corrupt

Offline michaelni

  • Member
  • Posts: 28
  • Liked: 23
  • Likes Given: 0
Hi guys,

I've created a new feature that implements the above.

Simply put you can now do something like this:

15:14:57217:0:-40:0:0:0:20

This will keep the macroblock (so not nullify it) bit it will change the DC values. With this you can really fix the lum/chrom issues in the current I-frames. Should have a big effect. I hope.

[edit] Forgot: it now also logs the 6 DC values for each macroblock. Which can come in handy in combination with this new feature.

Also you can do this now:

15:14:57217:0:0:0:0:0:0:0
15:14:57217:0:0:0:0:0:0:63

What this does is change direction from where a DC prediction are coming/inherited from: left or top. For each 1-bit in this number it tells it to get the DC-prediction from the top for a specific DC (4 x lum, 2 x chrom). A 0-bit means left. The number consists of 6 bit (hence max is 63). So in effect a 0 is all left, a 63 is all top. I don't know yet whether this feature is going to be very useful but it can't hurt.

I've attached the 3 source files that were changed. If somebody can check if it doesn't conflict with the existing branch (and maybe test it) and then push it to github, that would be great. Its these files btw:

libavcodec/mpegvideo.h
libavcodec/mpeg4video.h
libavcodec/h263dec.c

pushed changes  into github  (except what was commented out)

thanks

Offline michaelni

  • Member
  • Posts: 28
  • Liked: 23
  • Likes Given: 0
My thought was to deal with what I presume is low-hanging fruit: blocks with no or virtually no change from one iframe to the next.

Do P-frame blocks within a given frame propagate like I-frame blocks? Or is it strictly a diff from the same MB?

If we can create fake P-frames with no change, then fill in the data changes one at a time, we might make faster progress. But if they are interdependent you'd need to guess C/L data for each which could get annoying fast (and give people creative license to make the video into whatever)

P- frames can contain both intra MBs (like I frames) and inter MBs, each inter MB has 1(common) or 4(not so common) motion vector(s) that points to some location in the previous frame from where data is copied, such MB then stores the difference to that previous area. MVs are predicted somewhat similar to DC values of intra MBs, allthough MVs use the left, top and top right MBs for prediction. You can visualize the motion vectors with -vismv 7
MVs are in half pixel units

Offline arnezami

  • Full Member
  • **
  • Posts: 282
  • Liked: 262
  • Likes Given: 341
PS. I was also trying to make a reverse-macroblock finder of sorts. So instead of telling its starting bitposition you would tell it its ending bitposition (which would usually be a starting bitposition of a mb you already have). But I ran into a lot of issues. Even when you try all possible DC-directions it still won't find the right starting position. Even when I fake the right DC values left to the block. I'm not sure why yet. Probably something I don't understand yet. This part of the code is in there but its commented out. It was also extremely error-log-heavy...
Good news: I finally got the reverse searching of macroblocks to work!  8)

It's still quite hacky right now but hopefully I can release some working code within a day or so.

Offline Shanuson

  • Full Member
  • **
  • Posts: 258
  • Liked: 171
  • Likes Given: 412
Hi Guys,

Here is my by-hand-aligned raw.ts, and all iframes after piping it through tsfix (tsalign still complains about one region but that's an misreport. Compare that part to raw.ts and you will see that all 47's are there and at the right position in that part. so don't use tsalign my that ts.)
I will update http://spacexlanding.wikispaces.com/Progress+on+edit5.ts after this post.
But i have to go back to do my original work, So this will probably be my last contribution. 
I used the continuity bit and my best judgement to edit raw.ts to get that outcome.
There was on 56byte missing part where i am not 100% sure I add the 56 FF at the right position, I was a gap of 5 188 blocks with one missing 56 bytes. I added the 56 byte to the last one and marked it by 12 34 56 78 for the first 4 of those 56 Bytes.

Have fun with it :D

Cheers Shanuson

Offline Shanuson

  • Full Member
  • **
  • Posts: 258
  • Liked: 171
  • Likes Given: 412
And here a Zip with all img-files and the raw_edit8.ts
« Last Edit: 05/15/2014 10:19 AM by Shanuson »

Offline Shanuson

  • Full Member
  • **
  • Posts: 258
  • Liked: 171
  • Likes Given: 412
An here is the rest of the frames.

Offline moralec

Amazing job! The wiki page with these net iframes is up and working :)
Looking forward to see your edits

Offline mhenderson

  • Member
  • Posts: 69
  • USA
  • Liked: 101
  • Likes Given: 18
Progress on old iFrame 10 / frame 209 in edit5.ts.

X:14630:01,X:14708:01,X:15737:01,X:15817:1,X:15843:1,X:17180:1,43:2:8818,2:3:
8916,5:5:-2:16:25:25:16,6:5:14708,18:5:-1:-1:1:1:
-1:0:0,21:5:-1:-4:1:-5:-5,23:5:-1:-2:3:-4:2:0:0,25:5:16467,31:5:-1:-5:0:0:-5:
0:0,32:5:16740,37:5:-2:0:0:-5:-5:0:0,0:6:-1,0:7:-1,21:7:21000,0:15:-2,7:17:55313

This is basically back to where it was before the switch to edit5.ts. Some improvements in row 5.

I use the online v2 editor. Thanks so much Iain.  :)
« Last Edit: 05/15/2014 02:56 PM by Chris Bergin »

Offline Chris Bergin

Remember to break up your code lines or the width of the thread goes haywire.

And a welcome to mhenderson! :)

Offline SwissCheese

  • Full Member
  • *
  • Posts: 164
  • Liked: 249
  • Likes Given: 80
And here a Zip with all img-files and the raw_edit8.ts

Thank you for your work!

Two questions:

How can I get the "fixed_edit8.ts" version? I read about the "tsfix.c" and "tsalign.c" and the command line "cat raw.ts | tsfix | tsalign > fixed.ts", do I have to compile the files and how? For now the command line does not work. I found the files in the "FFmpeg-spacexdebug1/tools" folder.

When directly extracting the frames from raw_edit8.ts, I get only 241 frames, is it normal?

« Last Edit: 05/15/2014 03:28 PM by SwissCheese »

Offline Shanuson

  • Full Member
  • **
  • Posts: 258
  • Liked: 171
  • Likes Given: 412
And here a Zip with all img-files and the raw_edit8.ts

Thank you for your work!

Two questions:

How can I get the "fixed_edit8.ts" version? I read about the "tsfix.c" and "tsalign.c" and the command line "cat raw.ts | tsfix | tsalign > fixed.ts", do I have to compile the files and how? For now the command line does not work. I found the files in the "FFmpeg-spacexdebug1/tools" folder.

When directly extracting the frames from raw_edit8.ts, I get only 241 frames, is it normal?

yes raw_edit8.ts only gives 241 frames or so. that why you need to use tsfix too.

simply do gcc -o tsfix tsfix.c and likewise for tsalign. After that only do cat raw_edit8.ts | tsfix > fixed_edit8.ts
and dont use tsalign on raw_edit8.ts

Cheers
Shanuson

Offline SwissCheese

  • Full Member
  • *
  • Posts: 164
  • Liked: 249
  • Likes Given: 80
And here a Zip with all img-files and the raw_edit8.ts

Thank you for your work!

Two questions:

How can I get the "fixed_edit8.ts" version? I read about the "tsfix.c" and "tsalign.c" and the command line "cat raw.ts | tsfix | tsalign > fixed.ts", do I have to compile the files and how? For now the command line does not work. I found the files in the "FFmpeg-spacexdebug1/tools" folder.

When directly extracting the frames from raw_edit8.ts, I get only 241 frames, is it normal?

yes raw_edit8.ts only gives 241 frames or so. that why you need to use tsfix too.

simply do gcc -o tsfix tsfix.c and likewise for tsalign. After that only do cat raw_edit8.ts | tsfix > fixed_edit8.ts
and dont use tsalign on raw_edit8.ts

Cheers
Shanuson

Now I can run it, but it only creates a 32 bytes file... I made a print screen of the command prompt output. Is it possible to post your fixed_edit8.ts file?

Offline theshadow27

  • Member
  • Posts: 28
  • Liked: 27
  • Likes Given: 7
Now I can run it, but it only creates a 32 bytes file... I made a print screen of the command prompt output. Is it possible to post your fixed_edit8.ts file?

Are you on windows? The 'cat' command is *nix, IIRC the equivalent on windows is 'type'. So type raw_edit8.ts | tsfix > fixed_edit8.ts

Also, tsfix < raw_edit8.ts > fixed_edit8.ts might work better.

 (disclaimer: I don't have Windows)

Offline Shanuson

  • Full Member
  • **
  • Posts: 258
  • Liked: 171
  • Likes Given: 412

yes raw_edit8.ts only gives 241 frames or so. that why you need to use tsfix too.

simply do gcc -o tsfix tsfix.c and likewise for tsalign. After that only do cat raw_edit8.ts | tsfix > fixed_edit8.ts
and dont use tsalign on raw_edit8.ts

Cheers
Shanuson

Now I can run it, but it only creates a 32 bytes file... I made a print screen of the command prompt output. Is it possible to post your fixed_edit8.ts file?

I can do when i am back at home.

Offline SwissCheese

  • Full Member
  • *
  • Posts: 164
  • Liked: 249
  • Likes Given: 80
Yes I am on windows (using MinGW).

So I tried again your propositions and got the same as before, I compiled tsfix.c with Visual Studio and also got the same, and finally logged to a Unix machine and managed to do it there.

So I finally got all the frames, thank you for the help! :)

edit: I put the file in attachment
« Last Edit: 05/15/2014 05:32 PM by SwissCheese »

Offline Untribium

  • Member
  • Posts: 32
  • Switzerland
  • Liked: 32
  • Likes Given: 78
Some quick work on frame 52/old iframe 2. The bit flips are pretty much random...
X:25254:1,X:25299:1,X:53423:1,40:3:-1,6:4:9364,4:5:-1,6:5:11443,7:5:11487,0:7:-1,28:11:25250
« Last Edit: 05/15/2014 04:44 PM by Untribium »

Offline SwissCheese

  • Full Member
  • *
  • Posts: 164
  • Liked: 249
  • Likes Given: 80
So I adapted iframe32 using the new options with:

X:57182:4,
40:0:-1,
17:1:5444,13:2:-1,
5:4:14914,43:4:-1,
7:5:19298,14:06:24261:0:0:0:0:0:0:0,23:11:45354:0:0:0:0:0:0:0,26:12:-1,
7:13:52167,7:14:-1,
17:15:62855,28:15:-1,
27:16:68962,21:17:72509:0:0:0:0:0:0:0,21:18:76689:0:0:0:0:0:0:0,24:18:76921:0:0:0:0:0:0:0,7:21:-1,
10:21:-1:-5:10:0,
11:21:-1,
20:21:90326:10:0:0:0,22:27:-1,
27:27:112406,0:28:-1,
3:28:115143,9:29:-1,
33:29:135545

Offline SwissCheese

  • Full Member
  • *
  • Posts: 164
  • Liked: 249
  • Likes Given: 80
So back to the P-frames...

So this is an example of a P-frame (frame192). I ploted the motion vectors to see if they are also correctly modified. I used the following command lines for both images:

ffmpeg -debug mb_pos_size -err_detect ignore_err -vismv 7 -s:0 704:480 -i frame192.mpg4-img -f image2 frame_192_mv.png
ffmpeg -mmb 2:0:-1,19:0:1092 -debug mb_pos_size -err_detect ignore_err -vismv 7 -s:0 704:480 -i frame192.mpg4-img -f image2 frame_192_mv_mod.png

Now instead of creating a png, is it possible to directly store the modified one as a P-frame? If yes, how? Or does something have to be implemented?

When using:
ffmpeg -mmb 2:0:-1,19:0:1092 -debug mb_pos_size -err_detect ignore_err -s:0 704:480 -i frame192.mpg4-img -f image2 frame192_mod.mpg4-img
it stores an I-frame (we can check the frame type with option -vf 'showinfo')

When using:
ffmpeg -mmb 2:0:-1,19:0:1092 -debug mb_pos_size -err_detect ignore_err -s:0 704:480 -i frame192.mpg4-img -vodec copy -an -f image2 frame192_mod.mpg4-img
it just copies the P-frame without modifying it.

Tags: