Changeset 222:1f518d82d0d9


Ignore:
Timestamp:
10/10/2012 03:25:50 PM (8 years ago)
Author:
Dmitry Fedorov <fedorov@…>
Branch:
default
Phase:
public
Message:

better support for mpeg2 ts files

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • libsrc/libbioimg/formats/mpeg/dim_ffmpeg_format.cpp

    r220 r222  
    7373//----------------------------------------------------------------------------
    7474
    75 #define BIM_FORMAT_FFMPEG_MAGIC_SIZE 40
     75//#define BIM_FORMAT_FFMPEG_MAGIC_SIZE 40
     76#define BIM_FORMAT_FFMPEG_MAGIC_SIZE 200
    7677
    7778
     
    8081
    8182static const HeaderClass header_vob = { 0, 3, "\x00\x00\x01" };
    82 static const HeaderClass header_m2t = { 0, 1, "G" };
     83
     84static const HeaderClass header_m2t_1a = { 0, 1, "\x47" };
     85static const HeaderClass header_m2t_1b = { 188, 1, "\x47" };
     86
     87static const HeaderClass header_m2t_2a = { 4, 1, "\x47" };
     88static const HeaderClass header_m2t_2b = { 196, 1, "\x47" };
    8389
    8490static const HeaderClass header_avi_1 = { 0, 4, "RIFF" };
     
    186192
    187193  // mpeg2 stream M2T
    188   if (headcmp(header_m2t, mag_num)) return BIM_FORMAT_FFMPEG_MPEG2;
     194  if (headcmp(header_m2t_1a, mag_num) && headcmp(header_m2t_1b, mag_num)) return BIM_FORMAT_FFMPEG_MPEG2;
     195  if (headcmp(header_m2t_2a, mag_num) && headcmp(header_m2t_2b, mag_num)) return BIM_FORMAT_FFMPEG_MPEG2;
    189196
    190197  return -1;
  • msvc2010/imgcnv.rc

    r220 r222  
    5252
    5353VS_VERSION_INFO VERSIONINFO
    54  FILEVERSION 1,52,0,52
    55  PRODUCTVERSION 1,52,0,52
     54 FILEVERSION 1,53,0,53
     55 PRODUCTVERSION 1,53,0,53
    5656 FILEFLAGSMASK 0x17L
    5757#ifdef _DEBUG
     
    7070            VALUE "CompanyName", "Center for BioImage Informatics, UCSB"
    7171            VALUE "FileDescription", "imgcnv - BioImage Converter"
    72             VALUE "FileVersion", "1.52.0.52"
     72            VALUE "FileVersion", "1.53.0.53"
    7373            VALUE "InternalName", "imgcnv"
    74             VALUE "LegalCopyright", "Copyright (C) 2011, Center for BioImage Informatics "
     74            VALUE "LegalCopyright", "Copyright (C) 2004-2012, Dmtiry Fedorov, Center for BioImage Informatics"
    7575            VALUE "OriginalFilename", "imgcnv.exe"
    7676            VALUE "ProductName", "imgcnv - BioImage Converter"
    77             VALUE "ProductVersion", "1.52.0.52"
     77            VALUE "ProductVersion", "1.53.0.53"
    7878        END
    7979    END
  • msvc2010/imgcnv.vcxproj

    r220 r222  
    260260  </ItemGroup>
    261261  <ItemGroup>
     262    <ClCompile Include="..\libsrc\libbioimg\formats\tiff\bim_tiny_tiff.cpp" />
    262263    <ClCompile Include="..\src\main.cpp">
    263264      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
  • msvc2010/imgcnv.vcxproj.filters

    r220 r222  
    163163      <Filter>POLE</Filter>
    164164    </ClCompile>
     165    <ClCompile Include="..\libsrc\libbioimg\formats\tiff\bim_tiny_tiff.cpp">
     166      <Filter>libbioimg\Formats\Tiff</Filter>
     167    </ClCompile>
    165168  </ItemGroup>
    166169  <ItemGroup>
  • testing/runtest.py

    r220 r222  
    418418    test_image_read( "PSIA", "040130Topography001.tif" )
    419419    test_image_read( "BigTIFF", "test16bit.btf" )
    420     #test_image_read( "OME-BigTIFF", "bigtiff.ome.btf" )
     420    test_image_read( "OME-BigTIFF", "bigtiff.ome.btf" )
    421421    test_image_read( "QuickTime", "3Dstack.tif.3D.mov" )
    422422    test_image_read( "AVI", "radiolaria.avi" )
     
    845845    meta_test['video_frames_per_second'] = '29.970030'
    846846    meta_test['video_codec_name'] = 'mpeg2video'
    847     test_image_video( "MPEG2 TS", "B01C0201.M2T", meta_test )
     847    test_image_video( "MPEG2 TS (1)", "B01C0201.M2T", meta_test )
     848   
     849    meta_test = {}
     850    meta_test['image_num_z'] = '1'
     851    meta_test['image_num_t'] = '17127'
     852    meta_test['image_num_p'] = '17127'
     853    meta_test['image_num_x'] = '1440'
     854    meta_test['image_num_y'] = '1080'
     855    meta_test['video_frames_per_second'] = '59.940060'
     856    meta_test['video_codec_name'] = 'h264'
     857    test_image_video( "MPEG2 TS (2)", "Girsh_path3.m2ts", meta_test )   
    848858
    849859    meta_test = {}
Note: See TracChangeset for help on using the changeset viewer.