What viewer can read encode_video output?

Examples and samples for those who develop software with FFmpeg.
Post Reply
FrankNatoli
Posts: 6
Joined: Wed Nov 27, 2013 12:09 am

What viewer can read encode_video output?

Post by FrankNatoli » Tue Sep 26, 2017 4:34 pm

Have compiled encode_video for Windows 7 system. Troubles with LIB files provided with Zeranoe DEV distribution compelled me to access DLLs directly using Win32 LoadLibrary and GetProcAddress for each entry point. All functions called by encode_video appear to behave correctly. avcodec_receive_packet returns data after enough calls to avcodec_send_frame. Have called avcodec_find_encoder_by_name with argument "mpeg4" and am successful. But data returned by avcodec_receive_packet, written to file, does not appear to be an MP4 file. Windows Media doesn't like it. VLC Player doesn't like it. What viewer does like it?
The following is an extract of the beginning of the file written with avcodec_receive_packet data:

Code: Select all

00000000: 00 00 01 B0 F1 00 00 01 B5 A9 13 00 00 01 00 00 *                *
00000010: 00 01 20 08 D4 8D 08 00 CD 0B 04 24 14 18 3F 00 *           $  ? *
00000020: 00 01 B2 4C 61 76 63 35 37 2E 31 30 36 2E 31 30 *   Lavc57.106.10*
00000030: 31 00 00 01 B3 00 10 07 00 00 01 B6 10 60 AD 82 *1            `  *
00000040: 7E BD 6A F5 AB D6 AF 73 E0 92 F6 D6 AF 5E BD 7A *~ j    s     ^ z*
00000050: F5 AB F3 E7 BD B5 AB D7 AF 5E BD 6A FC F9 EF 6D *         ^ j   m*
00000060: 6A F5 AB D6 AF 5E BF 3E 7B DB 5E BD 6A F5 AB D7 *j    ^ >{ ^ j   *
00000070: AF CF 9E F6 D7 AF 5A BD 6A F5 AB F3 E3 0F 6D 6A *      Z j     mj*
00000080: F5 EB D7 AF 5A BF 3E 7B DB 5A BD 7A F5 EB D6 AF *    Z >{ Z z    *
00000090: CF 9E F6 D6 AF 5A BD 6A F5 EB F3 E7 BD B5 EB D6 *     Z j        *
000000A0: AF 5A BD 7A FC F9 EF 6D 7A F5 AB D6 AF 5A BF 3E * Z z   mz    Z >*
000000B0: 7B DB 5A BD 7A F5 EB D6 AF CF 9E F6 D6 AF 5E BD *{ Z z         ^ *
000000C0: 7A F5 AB F3 E7 BD B5 AB D6 AF 5A BD 7A FC F9 EF *z         Z z   *
000000D0: 6D 7A F5 AB D6 AF 5E BF 3E 30 F6 D7 AF 05 58 3C *mz    ^ >0    X<*
000000E0: 04 0E 20 F0 10 38 83 29 10 01 46 0A 36 01 E0 A0 *     8 )  F 6   *
000000F0: 19 59 B1 18 46 6E 03 C1 FF D2 87 C5 E5 FE A0 F0 * Y  Fn          *
And the following is an extract of a valid MP4 file, written by ffmpeg.exe:

Code: Select all

00000000: 00 00 00 20 66 74 79 70 69 73 6F 6D 00 00 02 00 *    ftypisom    *
00000010: 69 73 6F 6D 69 73 6F 32 61 76 63 31 6D 70 34 31 *isomiso2avc1mp41*
00000020: 00 00 00 08 66 72 65 65 00 01 B6 BF 6D 64 61 74 *    free    mdat*
00000030: 00 00 02 AE 06 05 FF FF AA DC 45 E9 BD E6 D9 48 *          E    H*
00000040: B7 96 2C D8 20 D9 23 EE EF 78 32 36 34 20 2D 20 *  ,   #  x264 - *
00000050: 63 6F 72 65 20 31 34 38 20 72 32 37 34 34 20 62 *core 148 r2744 b*
00000060: 39 37 61 65 30 36 20 2D 20 48 2E 32 36 34 2F 4D *97ae06 - H.264/M*
00000070: 50 45 47 2D 34 20 41 56 43 20 63 6F 64 65 63 20 *PEG-4 AVC codec *
00000080: 2D 20 43 6F 70 79 6C 65 66 74 20 32 30 30 33 2D *- Copyleft 2003-*
00000090: 32 30 31 36 20 2D 20 68 74 74 70 3A 2F 2F 77 77 *2016 - http://ww*
000000A0: 77 2E 76 69 64 65 6F 6C 61 6E 2E 6F 72 67 2F 78 *w.videolan.org/x*
000000B0: 32 36 34 2E 68 74 6D 6C 20 2D 20 6F 70 74 69 6F *264.html - optio*
000000C0: 6E 73 3A 20 63 61 62 61 63 3D 31 20 72 65 66 3D *ns: cabac=1 ref=*
000000D0: 33 20 64 65 62 6C 6F 63 6B 3D 31 3A 30 3A 30 20 *3 deblock=1:0:0 *
000000E0: 61 6E 61 6C 79 73 65 3D 30 78 33 3A 30 78 31 31 *analyse=0x3:0x11*
000000F0: 33 20 6D 65 3D 68 65 78 20 73 75 62 6D 65 3D 37 *3 me=hex subme=7*
Obviously, the formatting is very, very different.

Post Reply