-1

I encode an HD video (Beauty.yuv) by JM with IBBBPBBBPBBBP... pattern.

then to convert output.264 to out.mp4 by MP4Box do this:

MP4Box -profile high -hint -mtu 1024 -fps 30 -add output.264 out.mp4

then I make .st file:

./mp4trace -f -s 192.168.0.2 12346 out.mp4 > st_a01.st

but my st file look like:

1 I 142647 140 0.075

2 P 82493 81 0.202

3 P 24373 24 0.204

4 P 29224 29 0.204

5 P 23495 23 0.204

6 P 76393 75 0.331

7 P 22832 23 0.331

8 P 25367 25 0.336

9 P 22635 23 0.336

10 P 120039 118 0.469

11 P 24255 24 0.469

12 P 26783 27 0.469

13 P 23338 23 0.469

14 P 96223 94 0.596

15 P 22626 23 0.602

16 P 25306 25 0.602

17 P 26856 27 0.602

18 P 99348 98 0.729

19 P 25576 25 0.735

20 P 32550 32 0.736

21 P 28752 29 0.736

22 P 110795 109 0.869

23 P 23601 24 0.869

24 P 25118 25 0.869

25 P 24258 24 0.869

26 P 87966 86 0.991

27 P 21435 21 1.002

there is no B-frame or B-slice in packets ! why that happen ? what is wrong here ?

thanks for your attention

  • When you say _"st file"_ do you mean TS (`.ts`) file? Otherwise provide a link to info about `.st` video fomat... – VC.One Sep 27 '16 at 00:27
  • no I mean .st file. is a file cntain information about video file that we want to stream in network simulator. simulatores like ns2 take it and anothere file ".dat" , and simulate streaming on them. – Tayebe Ghanbari Oct 02 '16 at 07:28

2 Answers2

0

What happen to B-frames?... Why this happen? What is wrong here?

It's possible that MP4Box is encoding your H264 video by using the Baseline profile.

Check it with a tool like MediaInfo. Only Main and High profiles support B-frames (aka B-slices).

(image from : StreamingLearningCenter.com's article)

Community
  • 1
  • 1
VC.One
  • 14,790
  • 4
  • 25
  • 57
  • yes , mp4box used baseline profile and caused this problem thank you VC.One – Tayebe Ghanbari Sep 28 '16 at 13:00
  • Today I execute "MP4Box -info out.mp4", and I see that high profile is in use. problem is not about profile – Tayebe Ghanbari Oct 02 '16 at 07:23
  • Can you provide a link to short samples of both `mp4` file and `st` file? Why are you doing `-info out.mp4`? Why check some other MP4 file when your Questions **actually says** the P-frames happen when you do this : _**"..then I make .st file:"**_ and your result is _**"but my st file look like:"** (meaning all P frames). I'm not familiar with `.st` video format (only know `.TS`). Can you be sure that both your `mp4` and this `st` file have exact same encoding setup? Does the **mp4 file** itself have no B-frames? – VC.One Oct 02 '16 at 08:14
  • How can I check that what is the type of frames in mp4 file ? – Tayebe Ghanbari Oct 02 '16 at 09:38
  • This link contain information about evalvid and st file http://www2.tkn.tu-berlin.de/research/evalvid/EvalVid/docevalvid.html – Tayebe Ghanbari Oct 02 '16 at 09:43
  • _"How can I check that what is the type of frames in mp4 file?"_ right, I thought you were a programmer in charge of the input data. You have to parse the H.264 video inside that mp4 container. Extract it (not re-encode mp4 to h.264). Use FFmpeg like `ffmpeg -i video.mp4 -c:v copy video.h264`, then use a freeware h.264 analysis tool to check frames (web search for preferred tool). Type is in each h.264 frame header. Or, in mp4 file, check bytes via _hex editor_ tool. Go to section `stss` (it lists the keyframes) and see if every frame is a keyframe (check offsets, if key follows key in bytes). – VC.One Oct 02 '16 at 20:44
  • Anyways I gave you a correct answer. If there are only P-frames then your H264 is encoded as **Baseline**. That is how MPEG encoding works. An encoder must go for best compression, it would never deliberately make "expensive" P-frames for every frame unless forced to by the encoding **profile**. This fact remains regardless whether your M4Box tool is changing data between your `.st` and `.mp4` file. Are your `.st` output settings affecting this at all? (did/can you force each frame to be marked as keyframe within output bytes?). – VC.One Oct 02 '16 at 20:51
0

If you execute MP4Box -info out.mp4, you'll get some general information on the file.

If you execute MP4Box -info 1 out.mp4, you'll get some more specific information about the track 1 of the file.

If you execute MP4Box -diso out.mp4, you'll get a detailed XML (including the timings) of your MP4 file structure.

Maybe another precision about "I/P/B-frames". Since H264 (2003), there are only I/P/B slices, which makes your verification a little harder (since you need to check slices and not frames).

Also MP4Box is only a muxer, it won't modify the semantics of your encoded content.

R. Bouqueau
  • 451
  • 2
  • 5