




本発明は、音声付きの動画像データを記録する画像記録装置及びその制御方法に関する。 The present invention relates to an image recording apparatus for recording moving image data with sound and a control method therefor.
音声付きの動画像(以下、「動画」と呼ぶ)を記録する画像記録装置として、デジタルカメラが普及している。近年のデジタルカメラは、圧縮技術の向上、高画素化、撮像モードの多様化、記憶媒体のアクセス速度の高速化等により、ファイルサイズを小さく抑えつつ、高画質の動画を、高いフレームレートで長時間記録することが可能になっている。 Digital cameras are widely used as image recording apparatuses that record moving images with sound (hereinafter referred to as “moving images”). Recent digital cameras have improved the compression technology, increased the number of pixels, diversified imaging modes, increased the access speed of storage media, etc. Time recording is possible.
  動画を長時間記録する場合に問題となるのが、動画再生時に映像(「映像」は音声を含まない)と音声にずれが生じることである。例えば、映像信号と音声信号をサンプリングするクロックの元となる発振器が異なる場合は、各々の発振器のずれにより、撮影時間が経過すればするほど、映像と音声との間のずれが広がってしまう。この問題を解決するために、双方のクロックのずれを補正するデジタルカメラが提案されている(特許文献1参照)。
しかしながら、上述のデジタルカメラで動画を撮像しても、撮像した動画の記録方式に起因して、動画の再生時に、映像と音声がずれる場合があるという問題がある。この問題は、動画を記録する際のフレームレートが整数でないために生じるものであり、特許文献1に示すように映像信号用と音声信号用のクロックのずれを補正しても発生しうるものである。 However, even if a moving image is captured by the above-described digital camera, there is a problem in that the video and the sound may be shifted when the moving image is reproduced due to the recording method of the captured moving image. This problem occurs because the frame rate at the time of recording a moving image is not an integer, and can occur even if the clock signal and audio signal clocks are corrected as shown in Patent Document 1. is there.
例えば、ファイル形式がAVI、フレームレートが毎秒約60フレーム(60FPS)、サイズがQVGA(320x240)の動画を記録可能なデジタルカメラを考える。この種のデジタルカメラは、フレームレートが60FPSであるとユーザインタフェースに表示するが、実際には59.94FPSで動画を記録することが一般的である。これは、現在普及している動画の表示装置が対応するNTSC規格の表示レート(59.94FPS)に、記録時のフレームレートを一致させるためである。 For example, consider a digital camera capable of recording a moving image with a file format of AVI, a frame rate of about 60 frames per second (60 FPS), and a size of QVGA (320 × 240). This type of digital camera displays on the user interface that the frame rate is 60 FPS, but in practice it is common to record moving images at 59.94 FPS. This is because the frame rate at the time of recording is made to coincide with the display rate (59.94 FPS) of the NTSC standard supported by the currently popular moving image display devices.
AVI形式のファイルは、ある基本データブロックサイズ毎に映像と音声を交互に記録する形をとっており、例えば1秒分の映像データ・音声データが交互に繰り返し記録される。 The AVI format file has a form in which video and audio are alternately recorded for each basic data block size. For example, video data and audio data for one second are alternately and repeatedly recorded.
この場合、音声データは1つのデータブロックに1秒分記録されるが、映像データは、1つのデータブロックに59.94フレーム記録するということは物理的に不可能であるため、直近の整数である60フレームに切り上げて記録される。すなわち、映像データは、1つのデータブロックに1秒よりもやや長く記録されることになる。 In this case, audio data is recorded for one second in one data block, but it is physically impossible to record 59.94 frames in one data block. Recorded by rounding up to a certain 60 frames. That is, video data is recorded in one data block for a little longer than 1 second.
したがって、1つのデータブロックに記録されている映像データと音声データの長さが異なるため、動画の再生時に映像と音声にずれが生じることになる。 Accordingly, since the length of the video data and the audio data recorded in one data block is different, there is a difference between the video and the audio when the moving image is reproduced.
本発明はこのような状況に鑑みてなされたものであり、動画を記録する際のフレームレートが整数でない場合でも、記録した動画の再生時に映像と音声のずれを抑制する技術を提供することを目的とする。 The present invention has been made in view of such a situation, and provides a technique for suppressing a shift between video and audio during reproduction of a recorded moving image even when the frame rate at the time of recording the moving image is not an integer. Objective.
  上記課題を解決するために、本発明は、以下の特徴を備える画像処理装置を提供する。すなわち、
  映像及び音声を含む動画を動画ファイルとして記録する画像記録装置であって、前記動画ファイルは、映像データを格納する映像データ部と音声データを格納する音声データ部が交互に配置されている形式であり、前記画像記録装置は、
  前記動画を記録するフレームレートを取得する取得手段と、
  前記フレームレートに基づいて、1つあたりの前記映像データ部に格納される映像データのフレーム数を決定する第1の決定手段と、
  前記第1の決定手段により決定されたフレーム数の映像データを再生するのに要する映像再生時間を計算する計算手段と、
  前記動画ファイルを再生したときに生じうる音ずれを抑制するよう、1つあたりの前記音声データ部に格納される、サンプリングされた音声データのデータ数を前記映像再生時間に応じて決定する第2の決定手段と、
  を備え、
  前記第2の決定手段は、前記1つあたりの音声データ部に格納される音声データを再生するのに要する音声再生時間と前記映像再生時間との差の絶対値が、音ずれを低減するためにあらかじめ定められた値よりも小さくなるように、前記データ数を決定することを特徴とする画像記録装置。In order to solve the above problems, the present invention provides an image processing apparatus having the following features. That is,
 An image recording apparatus for recording a moving image including video and audio as a moving image file, wherein the moving image file has a format in which a video data portion storing video data and an audio data portion storing audio data are alternately arranged. And the image recording apparatus comprises:
 Obtaining means for obtaining a frame rate for recording the moving image;
 First determining means for determining the number of frames of video data stored in the video data portion per one based on the frame rate;
 Calculating means for calculating a video playback time required to play back video data of the number of frames determined by the first determining means;
 Secondly, the number of sampled audio data stored in one audio data portion is determined according to the video reproduction time so as to suppress a sound shift that may occur when the moving image file is reproduced. And means for determining
 Equipped witha,
The second deciding means is configured such that the absolute value of the difference between the audio reproduction time required for reproducing the audio data stored in the one audio data portion and the video reproduction time reduces the sound deviation. The image recording apparatus is characterizedin that thenumber of data is determined so as to be smaller than a predetermined value .
  また、本発明は、以下の特徴を備える制御方法を提供する。すなわち、
  映像及び音声を含む動画を動画ファイルとして記録する画像記録装置の制御方法であって、前記動画ファイルは、映像データを格納する映像データ部と音声データを格納する音声データ部が交互に配置されている形式であり、前記制御方法は、
  前記動画を記録するフレームレートを取得する取得工程と、
  前記フレームレートに基づいて、1つあたりの前記映像データ部に格納される映像データのフレーム数を決定する第1の決定工程と、
  前記第1の決定工程により決定されたフレーム数の映像データを再生するのに要する映像再生時間を計算する計算工程と、
  前記動画ファイルを再生したときに生じうる音ずれを抑制するよう、1つあたりの前記音声データ部に格納される、サンプリングされた音声データのデータ数を前記映像再生時間に応じて決定する第2の決定工程と、
  を備え、
  前記第2の決定工程では、前記1つあたりの音声データ部に格納される音声データを再生するのに要する音声再生時間と前記映像再生時間との差の絶対値が、音ずれを低減するためにあらかじめ定められた値よりも小さくなるように、前記データ数を決定することを特徴とする制御方法。The present invention also provides a control method having the following features. That is,
 A control method of an image recording apparatus for recording a moving image including video and audio as a moving image file, wherein the moving image file includes a video data portion storing video data and an audio data portion storing audio data alternately arranged. The control method is
 An acquisition step of acquiring a frame rate for recording the moving image;
 A first determination step of determining the number of frames of video data stored in the video data portion per one based on the frame rate;
 A calculation step of calculating a video playback time required to play back the video data of the number of frames determined in the first determination step;
 Secondly, the number of sampled audio data stored in one audio data portion is determined according to the video reproduction time so as to suppress a sound shift that may occur when the moving image file is reproduced. And the determination process of
 Equipped witha,
In the second determination step, the absolute value of the difference between the audio reproduction time required for reproducing the audio data stored in the audio data unit per unit and the video reproduction time is used to reduce sound deviation. And determining the number of data so as to be smaller than a predetermined value .
なお、その他の本発明の特徴は、添付図面及び以下の発明を実施するための最良の形態における記載によってさらに明らかになるものである。 Other features of the present invention will become more apparent from the accompanying drawings and the following description of the best mode for carrying out the invention.
以上の構成により、本発明によれば、動画を記録する際のフレームレートが整数でない場合でも、記録した動画の再生時に映像と音声のずれを抑制する技術を提供することが可能となる。 With the above configuration, according to the present invention, it is possible to provide a technique for suppressing a shift between video and audio during playback of a recorded moving image even when the frame rate at the time of recording the moving image is not an integer.
以下、添付図面を参照して、本発明の実施形態を説明する。以下で説明される個別の実施形態は、本発明の上位概念、中位概念および下位概念など種々の概念を理解するために役立つであろう。 Embodiments of the present invention will be described below with reference to the accompanying drawings. The individual embodiments described below will help to understand various concepts, such as the superordinate concept, intermediate concept and subordinate concept of the present invention.
なお、本発明の技術的範囲は、特許請求の範囲によって確定されるのであって、以下の個別の実施形態によって限定されるわけではない。また、実施形態の中で説明されている特徴の組み合わせすべてが発明の解決手段に必須のものとは限らない。 The technical scope of the present invention is determined by the claims, and is not limited by the following individual embodiments. In addition, not all combinations of features described in the embodiments are essential for the solution of the invention.
  [第1の実施形態]
    <デジタルカメラ100の構成>
  図1は、第1の実施形態における画像記録装置であるデジタルカメラ100の構成を示す機能ブロック図である。[First Embodiment]
 <Configuration of
 FIG. 1 is a functional block diagram illustrating a configuration of a
  10は光学レンズ、11はユーザが被写体像を確認するための光学ファインダーであり、ズーム制御部44による制御に従って、画角の変更が可能である。  10 is an optical lens, and 11 is an optical viewfinder for the user to check the subject image. The angle of view can be changed according to control by the
  12は絞り機能を備える絞り兼用シャッター、14は光学像を電気信号に変換する撮像素子(例えばCCD)であり、撮像素子14上には原色モザイクフィルタが配置されている。  
  15は撮像素子14の出力ノイズ除去のためのCDS(相関2重サンプリング)回路やAGC(自動利得制御)回路を含む前置処理回路である。16は前置処理回路15から出力されるアナログ信号をデジタル信号に変換するA/D変換器である。  Reference numeral 15 denotes a preprocessing circuit including a CDS (correlated double sampling) circuit and an AGC (automatic gain control) circuit for removing output noise of the image sensor 14.
  18は撮像素子14及びA/D変換器16にクロック信号や制御信号を供給するタイミング発生回路(TG)であり、クロック信号や制御信号を供給するタイミングは信号処理IC22により制御される。  
  信号処理IC22は、CPU50からの指示により、A/D変換器16又はDRAM30から入力されるデータに対して、画素補間処理や色変換処理、拡大・縮小、画像データ形式変換など、所定の画像処理を行う。信号処理IC22はまた、DMAコントローラ、画像表示部28に供給するアナログ信号を生成するためのD/A変換器、映像データを圧縮及び伸長する圧縮・伸長回路を備える。信号処理IC22はさらに、撮像した映像データを用いて所定の演算処理を行い、得られた演算結果をDRAM30に保存する。CPU50はこの演算結果に基づいてTTL方式のAWB(オートホワイトバランス)処理、AF(オートフォーカス)処理、AE(自動露出)処理、EF(ストロボプリ発光)処理を行う。  The
  28はTFT  LCDなどから構成される画像表示部であり、DRAM30に書き込まれた表示用の映像データを信号処理IC22内部のD/A変換器(不図示)を介して受け取り、映像を表示する。画像表示部28は映像の他、撮影モード設定情報などの各種情報の表示にも使用される。  
  画像表示部28に、撮像した映像を逐次表示すれば、画像表示部28を電子ビューファインダーとして機能させることもできる。また、画像表示部28は、CPU50の指示により任意に表示をON/OFFすることが可能であり、表示をOFFにした場合にはデジタルカメラ100の電力消費を大幅に低減することが出来る。  If the captured images are sequentially displayed on the
  さらに、画像表示部28は、回転可能なヒンジ部によってデジタルカメラ100本体に結合されていてもよい。この場合、ユーザは画像表示部28を自由な向き、角度を設定して、電子ビューファインダー機能や再生表示機能、各種表示機能を使用することが可能である。また、画像表示部28の表示部分をデジタルカメラ100本体側に向けることで表示部分を保護しつつ格納することが可能である。検知SW98は、画像表示部28が格納されたことを検知して、画像表示部28の表示動作を停止することが出来る。  Furthermore, the
  DRAM30は撮影した映像の非圧縮データを一時的に格納したり、AF/AE/AWB/EF演算結果を保持したり、画像表示部28に表示する映像データを保持したり、圧縮された映像データを保持したりするために使用されるメモリである。DRAM30は、所定枚数の静止画や所定時間の動画を格納するのに十分な記憶量を備えている。DRAM30はまた、CPU50を実行させるプログラムのワーク領域としても機能する。  The
  44は光学レンズ10及び光学ファインダー11のズーミングを制御するズーム制御部である。  A
  46はコネクタであり、アクセサリーシューとも呼ばれ、外部ストロボ装置400と、デジタルカメラ100本体との電気接点や機械的な固定部を併せて備える。  A
  48は内蔵ストロボであり、TTL調光機能を有している。  A built-in
  50はデジタルカメラ100全体を制御するCPUである。CPU50は、信号処理IC22によってDRAM30に格納されたAF/AE/AWB/EFの演算結果に基づき、AF/AE/AWB/EF制御を行う。CPU50はまた、信号処理IC22に対するデータフロー制御、各種キースキャン動作、ズーム制御、周辺モジュールとの通信等も行う。  A CPU 50 controls the entire
  52は電気的に消去・記録可能なフラッシュメモリであり、CPU50を動作させるために必要なプログラムやカメラ固有の調整データ等があらかじめ書き込まれている。  
  54はCPU50でのプログラムの実行に応じて、文字、画像、音声等を用いてデジタルカメラ100の動作状態やメッセージ等を表示する表示部である。表示部54は、スピーカー等の音声出力部を備え、音声によってデジタルカメラ100の動作状態やメッセージ等をユーザに通知してもよい。表示部54は、デジタルカメラ100の操作部70近辺の視認し易い位置に単数或いは複数個所設置され、例えばLCDやLED、発音素子等の組み合わせにより構成されている。  
  表示部54による表示には、例えば、シングルショット/連写撮影表示、セルフタイマー表示、圧縮率表示、記録画素数表示、記録枚数表示、残撮影可能枚数表示、シャッタースピード表示、絞り値表示、露出補正表示、ストロボ表示などがある。この他にも、赤目緩和表示、マクロ撮影表示、ブザー設定表示、時計用電池残量表示、電池残量表示、エラー表示、複数桁の数字による情報表示、記憶媒体150の着脱状態表示、通信I/F動作表示、日付・時刻表示などがある。  Examples of the display by the
  60は電源SWを兼ねたモードレバーであり、デジタルカメラ100を、電源オフ(OFF)、撮影モード、再生モードの3状態のいずれかに設定することができる。62は撮影時、目的・シーンに合わせてユーザが設定する各種撮影モードが割り当てられたモードダイアルである。モードダイアル62により、ユーザはデジタルカメラ100を、例えば全自動撮影モード(AUTO)、プログラム撮影モード、シャッター速度優先撮影モード、絞り優先撮影モード、マニュアル撮影モードなどに設定することができる。この他にも、ポートレートモード、風景モード、夜景モード、色効果モード、スティッチアシストモードなどの各モードに切り替え設定することが出来る。  
  64はシャッタースイッチであり、2段階のスイッチSW1及びSW2で構成されている。シャッターボタンの半押しでSW1がONとなり、AF(オートフォーカス)処理、AE(自動露出)処理、AWB(オートホワイトバランス)処理等の動作開始をCPU50に指示する。さらにシャッターボタンの全押しによりSW2がONとなり、撮像素子12から読み出した信号を、A/D変換器16、信号処理IC30を介してDRAM30に映像データとして書き込むことをCPU50に指示する。次いで、信号処理IC30はCPU50からの指示に従って、DRAM30から映像データを読み出し、色補正、画素補間、色変換等の画像処理を行った後、圧縮処理を行い、記憶媒体150に映像データを書き込む。  
  68はムービーSWであり、動画記録の開始・終了を指示するためのスイッチである。69は動画記録時のフレームレートを選択する、フレームレート選択部である。
72、74、76はそれぞれ、メニューキー、セットキー、十字キーであり、ユーザはこれらのキーを走査することにより、撮影時又は再生時の各種設定の変更や、各種機能の実行を、画像表示部28を見ながら行うことができる。このうち、十字キー76は上下左右の4つの方向キーから構成される複合キーである。
  メニューキー72が1回押されると、画像表示部28にメニュー画面が表示される。このメニュー画面は、モードレバー60及びモードダイアル62が指す現在のモードによって異なる。その後、表示されているメニュー項目をユーザが十字キー76を使って選択し、セットキー74を押すことにより、メニュー項目が決定される。  When the
例えば、撮影モードがプログラム撮影モードとなっている際のメニュー項目としては、記録画素サイズ、圧縮率、記録形式、感度、AFモード、撮影の確認の有無、画質チューニングパラメータ等がある。 For example, menu items when the shooting mode is the program shooting mode include a recording pixel size, a compression rate, a recording format, sensitivity, an AF mode, whether to check shooting, image quality tuning parameters, and the like.
また、モードレバーが再生モードに設定されている時のメニュー項目としては、例えば、画像の消去(一枚もしくは全部)、画像の保護(プロテクト)、画像の回転設定等が挙げられる。 The menu items when the mode lever is set to the playback mode include, for example, image deletion (one or all), image protection (protect), image rotation setting, and the like.
  また、十字キー76はメニュー設定時以外にも使用される。例えば、モードダイアル62でシャッター速度優先モードに設定されている場合には、ユーザは十字キー76の左右方向キーを使って、シャッター速度の変更を行うことができる。また、再生モードにおいては、画像送りを行うために十字キー76が使用される。  The cross key 76 is also used for other than menu setting. For example, when the shutter speed priority mode is set by the
  70は、メニューキー72、セットキー74、及び十字キー76以外の操作部をまとめたものである。操作部70は、ズームレバー、測光モード切替ボタン、マクロボタン、AEロックボタン、画像表示部28のON/OFFを設定する画像表示ON/OFFスイッチ等を備える。前述のメニューに含まれている項目のうち、比較的使用頻度の高いものが、操作部70に割り当てられている。  Reference numeral 70 denotes a group of operation units other than the
  80は電源制御手段であり、電池検出回路、DC−DCコンバータ、通電するブロックを切り替えるスイッチ回路等により構成される。電源制御手段80は、電池の装着の有無、電池の種類、電池残量の検出を行う。そして、検出結果及びCPU50の指示に基づいてDC−DCコンバータを制御し、必要な電圧を必要な期間、記録媒体を含む各部へ供給し、必要に応じて表示部54、画像表示部28に電池残量表示を行う。  
  82及び84はコネクタ、86はアルカリ電池やリチウム電池等の一次電池やNiCd電池やNiMH電池、Li電池等の二次電池、ACアダプター等からなる電源である。  
  150はメモリカードやハードディスク等の記憶媒体である。記憶媒体150は、半導体メモリや磁気ディスク等から構成される記録部152、デジタルカメラ100とのインタフェース154、デジタルカメラ100と接続を行うコネクタ156を備えている。  
  92はメモリカードやハードディスク等の記憶媒体150とデジタルカメラ100を接続するためのコネクタである。  
  なお、本実施形態では、デジタルカメラ100は、記憶媒体を取り付けるインタフェース及びコネクタを1系統持つものとして説明している。しかし、もちろん、記憶媒体を取り付けるインタフェース及びコネクタは、単数或いは複数、いずれの系統数を備える構成としても構わない。また、異なる規格のインタフェース及びコネクタを組み合わせて備える構成としても構わない。  In the present embodiment, the
インタフェース及びコネクタとしては、PCMCIAカードやCF(コンパクトフラッシュ(登録商標))カード等の規格に準拠したものを用いて構成して構わない。 The interface and the connector may be configured using a PCMCIA card, a CF (Compact Flash (registered trademark)) card, or the like based on a standard.
  94はデジタルカメラ100に音声を入力するためのマイクである。マイク94は主に、動画撮影時に音声データを取得するために使用される。  
  98は検知SWであり、画像表示部28の表示部分をデジタルカメラ100に向けて格納した格納状態にあるかどうかを検知したり、電池蓋が開けられたことを検知したり、外部ストロボ404の装着状態を検知したりすることができる。  
  400は外部ストロボ装置である。本実施形態では、デジタルカメラ100は、内蔵ストロボ48の他に外部ストロボを後から装着できる構成となっており、内蔵ストロボ同様、TTL調光撮影が可能となっている。402はデジタルカメラ100のアクセサリーシュー(コネクタ46)と接続するためのコネクタである。404は外部ストロボであり、AF補助光の投光機能、ストロボ調光機能も有する。  
    <動画撮影動作の概要>
  デジタルカメラ100を用いた動画撮影動作の概要について説明する。ムービーSW68が押下されると、デジタルカメラ100は、以下に説明する動画撮影のスタンバイ状態になる。<Overview of video shooting operation>
 An outline of a moving image shooting operation using the
  被写体像から入射した光は、光学レンズ10を通過し、絞り兼用シャッター12において露出制御されて、撮像素子14に結像する。動画撮影時には、絞り兼用シャッター12におけるメカ機構のシャッターは開いたままであり、絞りによって露出が制御される。  Light incident from the subject image passes through the
  撮像素子14で被写体像はアナログ映像データに光電変換され、A/D変換器16に送られる。A/D変換器16は、アナログ映像データをデジタル映像データに変換して、信号処理IC22に転送する。  The subject image is photoelectrically converted into analog video data by the image sensor 14 and sent to the A /
  動画撮影時には、撮像素子14から全画素が読み出されてA/D変換器16に送られるわけではなく、水平方向や垂直方向に間引かれた(あるいは加算されて重畳した)画素が、記録する映像のフレームレートに合わせて読み出される。  At the time of moving image shooting, not all pixels are read out from the image sensor 14 and sent to the A /
  なお、記録する映像のフレームレートは、前述のようにフレームレート選択部69によって選択される。本実施形態では、30FPS又は59.94FPSがフレームレートとして選択可能であるものとする。ただし、フレームレートが59.94FPSに設定されても、画像表示部28や表示部54では、60FPSとしてユーザに示されるものとする。  The frame rate of the video to be recorded is selected by the frame
  信号処理IC22は、入力されたデジタル映像データに対して、水平垂直のフィルタ処理やアパチャー補正処理やガンマ処理などの各種処理を行う。信号処理IC22は、次に、デジタル映像データを所定の画素サイズ、例えばVGA(水平640画素、垂直480ライン)サイズにリサイズして、DRAM30に転送する。DRAM30上の映像データは、画像表示部28に転送され、表示される。画像表示部28は、設定されたフレームレートでDRAM30に転送されてくる映像データを連続的に表示する。  The
次に、操作部70などに含まれる記録開始ボタンが押下されると、以下に説明するように、動画の記録が開始される。 Next, when a recording start button included in the operation unit 70 or the like is pressed, recording of a moving image is started as described below.
  信号処理IC22は、DRAM30に格納されている映像データを例えばJPEG形式のデータに変換(符号化)する。併せて、CPU50は、マイク94から入力された音声を例えばWAVE形式の音声データに変換する。  The
  CPU50は、符号化された映像データ及び音声データにヘッダー情報などの付加情報を付加して、例えばAVI形式の動画ファイルを生成する。CPU50は、コネクタ92を介して、記憶媒体150にAVI形式の動画ファイルを記録する。AVI形式の動画ファイルは、動画ファイルの先頭にあるヘッダー情報で映像データと音声データの配置を管理するデータ構造を持つ。  The CPU 50 adds additional information such as header information to the encoded video data and audio data to generate, for example, an AVI format moving image file. The CPU 50 records an AVI format moving image file on the
    <動画記録形式の詳細>
  以下、本実施形態において、フレームレートを30FPS及び60FPS(厳密には59.94FPS)に設定した場合に、デジタルカメラ100が動画データをAVI形式のファイルに格納する方法について説明する。ここでは、映像のサイズがQVGA(320x240)であり、音声のサンプリングレートが44.1KHz、16bitステレオであるものとする。<Details of video recording format>
 Hereinafter, in the present embodiment, a method in which the
    (1)30FPSの場合
  図2は、フレームレートが30FPSで記録されたAVI形式の動画ファイル200を示す図である。動画ファイル200は、ヘッダー部201及び複数の基本データブロック202を備える。基本データブロック202は、映像データ部203及び音声データ部204を備える。ヘッダー部201は、総フレーム数、フレーム間隔、映像サイズ、コーデックの種類、音声のサンプリング周波数等の情報を含む。(1) In the case of 30 FPS FIG. 2 is a diagram showing an AVI format moving
  各映像データ部203には、フレームレートが30FPSの場合、例えば再生時間1秒分に相当する30フレームの映像データが格納される。  In each
  各音声データ部204には、映像データ部203の再生時間と同じ、1秒分に相当する音声データが格納される。格納されるデータの数はサンプリングレートに一致する、44100個(44.1×1000)である。また、音声は16bit(2Byte)ステレオであるため、音声データの容量は、44100×2×2=176400(Byte)となる。以下、音声データのデータ数とは、サンプリングされた音声データのデータ数(サンプリング数)を意味するものとする。  Each
  このように、動画ファイル200は、動画1秒分を1単位とし、これを基本データブロック202とする。そして、映像データ部203と音声データ部204を1秒単位で交互に配置する。  In this way, the moving
  CPU50は、動画ファイル200を作成するために、符号化した映像データをバッファーするための映像バッファー領域と音声データをバッファーするための音声バッファー領域をDRAM30で確保する。そして、その領域にそれぞれ映像データと音声データを格納する。そして1秒単位で、映像データと音声データをAVI形式のデータにまとめて、DRAM30上に確保したAVIバッファー領域に格納する。  In order to create the moving
  ここで、本実施形態の場合、音声データはWAVE形式なので1秒間のデータサイズは固定であるが、映像データはJPEG形式なのでデータサイズが不定である。そこで、先の映像バッファーはAVIバッファーの映像データ領域と兼用にして、AVIバッファー上の音声データ領域を空けながらJPEGデータを書きこんでいく事が可能である。これにより、DRAM30の容量を削減することができる。CPU50は、AVIバッファーに格納したデータを、順次記憶媒体150へファイルとして書き込んでいく。  In this embodiment, since the audio data is in the WAVE format, the data size per second is fixed, but the video data is in the JPEG format, and the data size is indefinite. Therefore, the previous video buffer can also be used as the video data area of the AVI buffer, and JPEG data can be written while freeing the audio data area on the AVI buffer. Thereby, the capacity of the
この例では、動画記録時のフレームレートが整数であり、映像・音声とも基本データブロックに1秒分のデータが記録されているため、動画再生時に映像と音声にずれが生じることはない。 In this example, since the frame rate at the time of moving image recording is an integer and data for one second is recorded in the basic data block for both video and audio, there is no deviation between the video and audio during moving image reproduction.
    (2)60FPS(厳密には59.94FPS)の場合
  フレームレートがちょうど60FPSであれば、上述した30FPSの場合と同様、映像・音声とも動画ファイルの基本データブロックに1秒分のデータを記録できるため、動画再生時に映像と音声にずれが生じることはない。(2) In the case of 60 FPS (strictly 59.94 FPS) If the frame rate is exactly 60 FPS, one second of data can be recorded in the basic data block of the moving image file for both video and audio as in the case of 30 FPS described above. Therefore, there is no difference between video and audio during moving image playback.
  しかし、前述のように、デジタルカメラ100は、記録時のフレームレートをNTSCの表示レートに一致させるために、実際には59.94FPSで動画を記録する。この場合、前述のように、1つのデータブロックに映像データを59.94フレーム記録するということは物理的に不可能であるため、直近の整数である60フレームに切り上げて記録される。すなわち、映像データは、1つのデータブロックに1秒よりもやや長く記録されることになり、動画再生時に映像と音声がずれる原因となる。  However, as described above, the
そこで、本実施形態では、動画再生時に映像と音声にずれを生じさせないようにするため、基本データブロックの音声データ部のデータサイズを変更する。映像データ60フレームを59.94FPSで再生すると、60/59.94≒1.001(秒)かかる。そのため、基本データブロックの音声データ部のデータサイズを1秒から1.001秒に変更する。以下、図3を参照して具体的に説明する。 Therefore, in the present embodiment, the data size of the audio data portion of the basic data block is changed so as not to cause a shift between video and audio during moving image reproduction. If 60 frames of video data are reproduced at 59.94 FPS, it takes 60 / 59.94≈1.001 (seconds). Therefore, the data size of the audio data portion of the basic data block is changed from 1 second to 1.001 seconds. Hereinafter, a specific description will be given with reference to FIG.
  図3は、フレームレートが59.94FPSで記録されたAVI形式の動画ファイル300を示す図である。動画ファイル300は、ヘッダー部301及び複数の基本データブロック302を備える。基本データブロック302は、映像データ部303及び音声データ部304を備える。ヘッダー部301は、総フレーム数、フレーム間隔、映像サイズ、コーデックの種類、音声のサンプリング周波数等の情報を含む。映像データ部303は、前述のように、59.94ではなく、60フレーム分の映像データを含む。  FIG. 3 is a diagram showing an
  フレームレートが整数の場合は、図2に示すように、音声データ部203に格納されるデータ数はサンプリングレートに一致し、音声1秒分に相当する、44100個であった。しかし、フレームレートが59.94FPSの場合は、音声データ部303には、音声1.001秒分に相当する、44100×1.001=44144個のデータが格納される。この場合、音声データの容量は、44144×2×2=176576(Byte)となる。  When the frame rate is an integer, as shown in FIG. 2, the number of data stored in the
  すなわち、フレームレートが59.94FPSの場合、CPU50は、1秒ではなく1.001秒を基本データブロック302の1単位とする。そして、映像データと音声データを交互に1.001秒間毎に動画ファイル300に記録する。これにより、動画再生時に映像と音声がずれることを抑制できる。なお、60/59.94は厳密には1.001ではないため、丸め誤差に起因する映像と音声のずれは発生しうるが、従来の記録方式で発生するずれに比べれば、無視できるほど小さい。  That is, when the frame rate is 59.94 FPS, the CPU 50 sets 1.001 seconds as one unit of the basic data block 302 instead of 1 second. Then, video data and audio data are alternately recorded in the moving
  動画ファイルの記録に際しては、30FPSの場合と同様、AVIバッファーに格納したデータを、順次記憶媒体150へファイルとして書き込んでいけばよい。  When recording a moving image file, the data stored in the AVI buffer may be sequentially written to the
    <動画記録処理の詳細>
  図4は、デジタルカメラ100を使用した動画記録処理の詳細を示すフローチャートである。前述のように、CPU50がムービーSW64の押下を検知すると、デジタルカメラ100は動画撮影のスタンバイ状態になり、CPU50が操作部70などに含まれる記録開始ボタンの押下を検知すると、本フローチャートの処理が開始する。<Details of video recording process>
 FIG. 4 is a flowchart showing details of the moving image recording process using the
  ステップS401で、CPU50は、フレームレート選択部69によってあらかじめ設定されているフレームレートを判定する。フレームレートが30FPSに設定されている場合はステップS402に進み、60FPS(実際には59.94FPS)に設定されている場合はステップS404に進む。  In step S <b> 401, the CPU 50 determines the frame rate set in advance by the frame
  ステップS402では、CPU50は、映像データがQVGA・30FPSになるように撮像素子14を駆動するように、タイミング発生器18を制御する動作を開始する。次に、ステップS403で、CPU50は、動画ファイルに含まれる基本データブロックの音声データ部のデータ数を、音声1秒分に相当する、44100個に設定し、CPU50中のレジスタ(不図示)などに記憶する。  In step S <b> 402, the CPU 50 starts an operation of controlling the
  一方、ステップS404では、CPU50は、映像データがQVGA・59.94FPSになるように撮像素子14を駆動するように、タイミング発生器18を制御する動作を開始する。次に、ステップS405で、CPU50は、動画ファイルに含まれる基本データブロックの音声データ部のデータ数を、音声1.001秒分に相当する、44144個に設定し、CPU50中のレジスタ(不図示)などに記憶する。  On the other hand, in step S404, the CPU 50 starts an operation of controlling the
  ステップS406で、CPU50は、ステップS402及びS403、又は、ステップS404及びS405で設定した内容に従って、映像データ及び音声データを取得し、動画ファイルとして記憶媒体150に記録する。ただし、フレームレートが59.94FPSの場合は、基本データブロックの映像データ部に格納される映像のフレーム数は、60個である。この処理は、ステップS407においてCPU50が記録終了の指示を受けるまで継続される。  In step S406, the CPU 50 acquires video data and audio data according to the contents set in steps S402 and S403 or steps S404 and S405, and records them as a moving image file in the
図5は、図4をより一般化したフローチャートである。図5において、図4と同一の処理を行うステップには同一の符号を付し、説明を省略する。 FIG. 5 is a more generalized flowchart of FIG. In FIG. 5, steps that perform the same processing as in FIG. 4 are given the same reference numerals, and descriptions thereof are omitted.
ステップS501で、CPU50は、動画ファイルにおける基本データブロックの音声データ部のデータ数を、操作部70等を介して設定された値であるA個(例えば、44.1KHz1秒分の44100個)にする。 In step S501, the CPU 50 sets the number of data in the audio data portion of the basic data block in the moving image file to A (for example, 44100 for 44.1 KHz per second) which is a value set via the operation unit 70 or the like. To do.
ステップS502で、CPU50は、フレームレート選択部によって設定されているフレームレートFが整数であるか否かを判定する。整数である場合はステップS503に進み、整数でない場合はステップS504に進む。 In step S502, the CPU 50 determines whether or not the frame rate F set by the frame rate selection unit is an integer. If it is an integer, the process proceeds to step S503, and if it is not an integer, the process proceeds to step S504.
  ステップS503で、CPU50は、操作部70等を介して設定された条件(例えば映像サイズはQVGAである、など)に従って撮像素子を駆動するように、タイミング発生器18を制御する動作を開始する。  In step S503, the CPU 50 starts an operation of controlling the
ステップS504で、CPU50は、フレームレートFに最も近い整数Nを求める。例えば、F=59.94の場合や、F=60.49の場合は、N=60となる。なお、ステップS504において重要なことは、フレームレートFと相関の高い整数を求めることであり、整数Nは、必ずしもFに最も近い整数でなくても構わない。すなわち、例えば、NはFの少数以下を切り上げたり切り捨てたりして求まる整数でもよい。 In step S504, the CPU 50 obtains an integer N closest to the frame rate F. For example, when F = 59.94 or F = 60.49, N = 60. What is important in step S504 is to obtain an integer having a high correlation with the frame rate F. The integer N is not necessarily an integer closest to F. That is, for example, N may be an integer obtained by rounding up or down a decimal number of F.
ステップS505で、CPU50は、A=A×(N/F)とする。ただし、計算の結果、Aが整数にならない場合は、少数以下を例えば四捨五入することにより、Aを整数にする。 In step S505, the CPU 50 sets A = A × (N / F). However, if A does not become an integer as a result of the calculation, A is made an integer by rounding off the decimal number, for example.
  ステップS506で、CPU50は、ステップS503と同様にタイミング発生器18を制御する動作を開始する。  In step S506, the CPU 50 starts an operation for controlling the
  ステップS507で、CPU50は、ステップS406と同様に、映像データ及び音声データを取得し、動画ファイルとして記憶媒体150に記録する。ただし、フレームレートFが整数でない場合は、基本データブロックの映像データ部に格納される映像のフレーム数はN個である。  In step S507, the CPU 50 acquires video data and audio data and records them as a moving image file in the
以上、図5を参照して説明したように、本実施形態では、フレームレートは30又は59.94FPSに限られるものではないし、映像サイズはQVGAに限られるものではない。また、動画ファイルの形式は、映像データと音声データが所定の単位で交互に記録されるものであれば、AVI形式に限られるものではない。すなわち、本発明は、種々のフレームレート、基本データブロックサイズ、ファイル形式、映像サイズ、音声サンプリング周波数での動画記録に適用可能であり、動画の表示装置もNTSC規格以外の規格に準拠していてもよい。 As described above with reference to FIG. 5, in this embodiment, the frame rate is not limited to 30 or 59.94 FPS, and the video size is not limited to QVGA. The format of the moving image file is not limited to the AVI format as long as video data and audio data are alternately recorded in a predetermined unit. That is, the present invention can be applied to moving image recording at various frame rates, basic data block sizes, file formats, video sizes, and audio sampling frequencies, and the moving image display device also complies with standards other than the NTSC standard. Also good.
    <ずれ抑制の程度>
  図4のステップS405及び図5のステップS505では、次のことを目的とした処理が行われている。すなわち、基本データブロックの映像データ部に記録されている映像データを再生するのに要する時間を映像再生時間とする。音声データ部に記録されている音声データを再生するのに要する時間を音声再生時間とする。そして、映像再生時間と音声再生時間との差の絶対値(以下、「再生時間の差」と呼ぶ)が最小となるように、音声データ部に記録されるデータ数が決定される。もちろん、再生時間の差が0になるのが最も好ましいが、音声データ部に記録されるデータ数は整数でなければならないため、再生時間の差は必ずしも0にならない。<Degree of deviation suppression>
 In step S405 of FIG. 4 and step S505 of FIG. 5, processing for the following purpose is performed. That is, the time required to reproduce the video data recorded in the video data portion of the basic data block is defined as the video reproduction time. The time required to reproduce the audio data recorded in the audio data portion is defined as the audio reproduction time. Then, the number of data recorded in the audio data portion is determined so that the absolute value of the difference between the video reproduction time and the audio reproduction time (hereinafter referred to as “reproduction time difference”) is minimized. Of course, it is most preferable that the difference in the reproduction time is zero, but the difference in the reproduction time is not necessarily zero because the number of data recorded in the audio data portion must be an integer.
一方、再生時間の差は、必ずしも最小になる必要は無い。再生時間の差が小さくなればなるほど、動画再生時に、映像と音声のずれが目立たなくなるため、人間が映像と音声のずれを認識できない程度に再生時間の差を小さくすれば、「映像と音声のずれを抑制する」という目的に対して一定の効果が得られる。 On the other hand, the difference in reproduction time is not necessarily minimized. The smaller the difference in playback time, the less noticeable the difference between video and audio during video playback. Therefore, if the difference in playback time is reduced so that humans cannot recognize the difference between video and audio, the video and audio A certain effect can be obtained for the purpose of “suppressing deviation”.
  そこで、ステップS405及びS505において、再生時間の差があらかじめ定められた値よりも小さくなるように、音声データ部に記録されるデータ数が決定されるように、デジタルカメラ100を構成してもよい。  Therefore, in steps S405 and S505, the
    <第1の実施形態のまとめ>
  以上説明したように、本実施形態によれば、デジタルカメラ100は、動画の記録時に、基本データブロックの音声データ部に格納されるデータ数を、フレームレートに応じて変化させる。具体的には、基本データブロックの映像データ部及び音声データ部の再生時間の差を、あらかじめ定められた値よりも小さくする。<Summary of First Embodiment>
 As described above, according to the present embodiment, the
これにより、表示装置で動画を再生する際に、映像と音声がずれることを抑制できる。 Thereby, when a moving image is reproduced on the display device, it is possible to suppress a shift between video and audio.
  [その他の実施形態]
  上述した実施の形態の処理は、各機能を具現化したソフトウェアのプログラムコードを記録した記憶媒体をシステム或は装置に提供してもよい。そして、そのシステム或は装置のコンピュータ(又はCPUやMPU)が記憶媒体に格納されたプログラムコードを読み出し実行することによって、前述した実施形態の機能を実現することができる。この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本発明を構成することになる。このようなプログラムコードを供給するための記憶媒体としては、例えば、フロッピィ(登録商標)ディスク、ハードディスク、光ディスク、光磁気ディスクなどを用いることができる。或いは、CD−ROM、CD−R、磁気テープ、不揮発性のメモリカード、ROMなどを用いることもできる。[Other Embodiments]
 In the processing of the above-described embodiment, a storage medium in which a program code of software that embodies each function is recorded may be provided to the system or apparatus. The functions of the above-described embodiments can be realized by the computer (or CPU or MPU) of the system or apparatus reading and executing the program code stored in the storage medium. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the program code constitutes the present invention. As a storage medium for supplying such a program code, for example, a floppy (registered trademark) disk, a hard disk, an optical disk, a magneto-optical disk, or the like can be used. Alternatively, a CD-ROM, CD-R, magnetic tape, nonvolatile memory card, ROM, or the like can be used.
また、コンピュータが読み出したプログラムコードを実行することにより、前述した各実施の形態の機能が実現されるだけではない。そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOS(オペレーティングシステム)などが実際の処理の一部又は全部を行い、その処理によって前述した各実施の形態の機能が実現される場合も含まれている。 The functions of the above-described embodiments are not only realized by executing the program code read by the computer. In some cases, an OS (operating system) running on the computer performs part or all of the actual processing based on the instruction of the program code, and the functions of the above-described embodiments are realized by the processing. include.
さらに、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書きこまれてもよい。その後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部又は全部を行い、その処理によって前述した各実施の形態の機能が実現される場合も含むものである。 Further, the program code read from the storage medium may be written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer. After that, the CPU of the function expansion board or function expansion unit performs part or all of the actual processing based on the instruction of the program code, and the functions of the above-described embodiments are realized by the processing. Is also included.
| Application Number | Priority Date | Filing Date | Title | 
|---|---|---|---|
| JP2006037252AJP4637032B2 (en) | 2006-02-14 | 2006-02-14 | Image recording apparatus and control method thereof | 
| Application Number | Priority Date | Filing Date | Title | 
|---|---|---|---|
| JP2006037252AJP4637032B2 (en) | 2006-02-14 | 2006-02-14 | Image recording apparatus and control method thereof | 
| Publication Number | Publication Date | 
|---|---|
| JP2007221271A JP2007221271A (en) | 2007-08-30 | 
| JP4637032B2true JP4637032B2 (en) | 2011-02-23 | 
| Application Number | Title | Priority Date | Filing Date | 
|---|---|---|---|
| JP2006037252AExpired - Fee RelatedJP4637032B2 (en) | 2006-02-14 | 2006-02-14 | Image recording apparatus and control method thereof | 
| Country | Link | 
|---|---|
| JP (1) | JP4637032B2 (en) | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| CN102761724A (en)* | 2011-12-16 | 2012-10-31 | 新奥特(北京)视频技术有限公司 | Video/audio treating method | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| JP2624538B2 (en)* | 1989-03-02 | 1997-06-25 | 日本放送協会 | Audio synchronization method for television format conversion | 
| JPH09247625A (en)* | 1996-03-11 | 1997-09-19 | Sony Corp | Digital video tape recorder | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| CN102761724A (en)* | 2011-12-16 | 2012-10-31 | 新奥特(北京)视频技术有限公司 | Video/audio treating method | 
| Publication number | Publication date | 
|---|---|
| JP2007221271A (en) | 2007-08-30 | 
| Publication | Publication Date | Title | 
|---|---|---|
| JP4724577B2 (en) | Imaging apparatus and control method thereof | |
| JP4777180B2 (en) | Imaging apparatus and control method thereof | |
| KR20050090804A (en) | Composition camera and dsc lens control method using the same | |
| JP2007306224A (en) | Digital camera | |
| KR20040099874A (en) | Combination apparatus for photograping image and method thereof | |
| JP2008301475A (en) | Imaging apparatus and control method thereof | |
| JP2002084448A (en) | Image automatic transmission digital camera | |
| JP4574087B2 (en) | Imaging apparatus, control method thereof, control program thereof, and storage medium | |
| JP4637032B2 (en) | Image recording apparatus and control method thereof | |
| JP2002010188A (en) | Automatic image transmitting digital camera | |
| JP4810485B2 (en) | Image processing apparatus, image processing method, and computer program | |
| JP5836578B2 (en) | IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND PROGRAM | |
| JP4948011B2 (en) | Imaging apparatus, control method therefor, computer program, and storage medium | |
| JP2006310907A (en) | Imaging apparatus and control method thereof | |
| JP2004096227A (en) | Audio processing device, method, computer program, and computer-readable storage medium | |
| JP4161710B2 (en) | Camera with music playback function | |
| JP5300627B2 (en) | Imaging apparatus, control method thereof, and program | |
| JP2010074296A (en) | Image reproducing device and method, and program | |
| EP1575286A2 (en) | Combined camcorder and stills camera | |
| JP5207880B2 (en) | Imaging apparatus, control method thereof, and program | |
| JP2008011244A (en) | Imaging apparatus, control method thereof, and program | |
| JP3978522B2 (en) | Electronic camera | |
| JP2004032713A (en) | Imaging apparatus, imaging method, program, and storage medium | |
| KR100627070B1 (en) | Video and audio signal recording device and reproducing device | |
| JP5288962B2 (en) | Imaging apparatus and control method thereof | 
| Date | Code | Title | Description | 
|---|---|---|---|
| A621 | Written request for application examination | Free format text:JAPANESE INTERMEDIATE CODE: A621 Effective date:20090213 | |
| A977 | Report on retrieval | Free format text:JAPANESE INTERMEDIATE CODE: A971007 Effective date:20100902 | |
| A131 | Notification of reasons for refusal | Free format text:JAPANESE INTERMEDIATE CODE: A131 Effective date:20100906 | |
| A521 | Request for written amendment filed | Free format text:JAPANESE INTERMEDIATE CODE: A523 Effective date:20101022 | |
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) | Free format text:JAPANESE INTERMEDIATE CODE: A01 Effective date:20101115 | |
| A01 | Written decision to grant a patent or to grant a registration (utility model) | Free format text:JAPANESE INTERMEDIATE CODE: A01 | |
| A61 | First payment of annual fees (during grant procedure) | Free format text:JAPANESE INTERMEDIATE CODE: A61 Effective date:20101122 | |
| FPAY | Renewal fee payment (event date is renewal date of database) | Free format text:PAYMENT UNTIL: 20131203 Year of fee payment:3 | |
| R150 | Certificate of patent or registration of utility model | Free format text:JAPANESE INTERMEDIATE CODE: R150 | |
| LAPS | Cancellation because of no payment of annual fees |