JP2014075730A - Image processor, image processing method, and program - Google Patents

Image processor, image processing method, and program Download PDF

Info

Publication number
JP2014075730A
JP2014075730A JP2012222905A JP2012222905A JP2014075730A JP 2014075730 A JP2014075730 A JP 2014075730A JP 2012222905 A JP2012222905 A JP 2012222905A JP 2012222905 A JP2012222905 A JP 2012222905A JP 2014075730 A JP2014075730 A JP 2014075730A
Authority
JP
Japan
Prior art keywords
moving image
file
image data
chapter
recording medium
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012222905A
Other languages
Japanese (ja)
Other versions
JP2014075730A5 (en
JP6071399B2 (en
Inventor
Tetsuya Haneda
徹也 羽田
Hideyuki Watanabe
英行 渡邊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2012222905A priority Critical patent/JP6071399B2/en
Publication of JP2014075730A publication Critical patent/JP2014075730A/en
Publication of JP2014075730A5 publication Critical patent/JP2014075730A5/en
Application granted granted Critical
Publication of JP6071399B2 publication Critical patent/JP6071399B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an image processor capable of performing moving image editing processing at a high speed.SOLUTION: An image processor comprises: reproduction means for reproducing a moving image file recorded in a recording medium in a file format for managing a file by using a file allocation table; and editing means for performing editing for deleting moving image belonging to a chapter of a deletion object of the moving image file reproduced by the reproduction means, and the reproduction means specifies a recording position on a recording medium of the moving image data corresponding to the chapter of the deletion object, and edits a file allocation table so as not to read at least a portion of the moving image data corresponding to a prescribed chapter.

Description

本発明は、画像処理装置、画像処理方法、プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a program.

従来、動画記録装置として、動画の記録や再生、編集等が可能な撮像装置が知られている。これらの撮像装置には、たとえば特許文献1のように、動画の任意のシーンを削除するなどの編集を行う場合、動画の全フレームを一度デコードし、編集結果を反映したフレームの順番になるように再エンコードして記録する方式が一般的であった。   2. Description of the Related Art Conventionally, imaging devices capable of recording, playing back, editing, and the like of moving images are known as moving image recording devices. In these imaging apparatuses, for example, as in Patent Document 1, when editing such as deleting an arbitrary scene of a moving image, all the frames of the moving image are decoded once so that the order of the frames reflecting the editing result is obtained. In general, the re-encoding method is used for recording.

特開2000−165802号公報JP 2000-165802 A

しかし、特許文献1のように、再エンコードを行うと、長い処理時間が発生したり、あるいは高性能のマイコンを用いなければならなくなったりすることがあった。   However, as in Patent Document 1, if re-encoding is performed, a long processing time may occur or a high-performance microcomputer may have to be used.

そこで、本発明は、動画編集処理を高速に行うことができる画像処理装置を提供することを目的とする。   SUMMARY An advantage of some aspects of the invention is that it provides an image processing apparatus capable of performing moving image editing processing at high speed.

このような目的を達成するために、本発明の画像処理装置は、ファイルアロケーションテーブルを使用してファイルを管理するファイルフォーマットで記録媒体に記録された動画ファイルを再生する再生手段と、前記再生手段によって再生された動画ファイルの削除対象のチャプタに属する動画データを削除する編集を行う編集手段とを有し、前記編集手段は、前記削除対象のチャプタに対応する動画データの記録媒体上での記録位置を特定し、前記所定のチャプタに対応する動画データの少なくとも一部を読まないようにファイルアロケーションテーブルを編集することを特徴とする。   In order to achieve such an object, the image processing apparatus of the present invention reproduces a moving image file recorded on a recording medium in a file format for managing the file using a file allocation table, and the reproducing unit. Editing means for deleting moving picture data belonging to the chapter to be deleted of the moving picture file reproduced by the recording means, wherein the editing means records the moving picture data corresponding to the chapter to be deleted on a recording medium. A position is specified, and a file allocation table is edited so that at least a part of moving image data corresponding to the predetermined chapter is not read.

本発明によれば、動画編集処理を高速に行うことができる。   According to the present invention, moving image editing processing can be performed at high speed.

本実施例の撮像装置の構成を示す図である。It is a figure which shows the structure of the imaging device of a present Example. ダイジェストムービーモードの撮像装置の制御を示すフロー図である。It is a flowchart which shows control of the imaging device of digest movie mode. ダイジェストムービーモードで記録される静止画ファイル、動画ファイルの状態を説明するための図である。It is a figure for demonstrating the state of the still image file recorded by digest movie mode, and a moving image file. 動画データを連結(追記)する処理の制御を示すフロー図である。It is a flowchart which shows control of the process which connects moving image data (additional writing). 動画データの連結(追記)による動画ファイルの状態変化を示す図である。It is a figure which shows the state change of the moving image file by connection (additional writing) of moving image data. 本実施例の動画のファイルフォーマットを説明するための図である。It is a figure for demonstrating the file format of the moving image of a present Example. 本実施例の編集処理の動作を説明するためのフロー図である。It is a flowchart for demonstrating the operation | movement of the edit process of a present Example. 動画ファイルの状態を示すものである。It shows the status of the video file.

以下、図面を参照して本発明の実施例を詳細に説明するが、この発明は以下の実施の形態に限定されない。なお、以下の実施の形態は特許請求の範囲に係る発明を限定するものでなく、また実施の形態で説明されている特徴の組み合わせの全てが発明の解決手段に必須のものとは限らない。   Hereinafter, examples of the present invention will be described in detail with reference to the drawings. However, the present invention is not limited to the following embodiments. The following embodiments do not limit the invention according to the claims, and all combinations of features described in the embodiments are not necessarily essential to the solution means of the invention.

なお、本実施例において説明される各機能ブロックは必ずしも個別のハードウェアである必要はない。すなわち、例えばいくつかの機能ブロックの機能は、1つのハードウェアにより実行されても良い。また、いくつかのハードウェアの連係動作により1つの機能ブロックの機能または、複数の機能ブロックの機能が実行されても良い。   Note that each functional block described in the present embodiment is not necessarily separate hardware. That is, for example, the functions of some functional blocks may be executed by one piece of hardware. In addition, the function of one functional block or the functions of a plurality of functional blocks may be executed by some hardware linked operations.

本実施例では、画像処理装置として撮像装置を例にとって説明する。   In this embodiment, an image pickup apparatus will be described as an example of the image processing apparatus.

本実施例の撮像装置100は、通常の「動画撮影モード」においては、1回の動画撮影の開始から終了までに撮影された動画データを1つのファイルとして記録媒体に記録することができる。また、通常の「静止画撮影モード」においては、1回の撮影指示に応じて撮影された静止画データを1つのファイルとして記録媒体に記録することができる。さらに、本実施例の撮像装置は、「ダイジェストムービーモード」を有する。この「ダイジェストムービーモード」では、静止画撮影の指示に応じて、撮影された静止画データを記録媒体に記録するだけでなく、静止画撮影の指示が入力されるまでに撮影された所定時間分の動画データを動画ファイルとして記録媒体に記録することができる。動画データについては、撮像装置に備えられたメモリに、エンコードした状態で一時的に記憶しておく。   In the normal “moving image shooting mode”, the image pickup apparatus 100 of the present embodiment can record moving image data shot from the start to the end of one moving image shooting as a single file on a recording medium. In the normal “still image shooting mode”, still image data shot in response to one shooting instruction can be recorded on a recording medium as one file. Furthermore, the imaging apparatus of the present embodiment has a “digest movie mode”. In this “digest movie mode”, not only the recorded still image data is recorded on the recording medium in response to the still image shooting instruction, but also for a predetermined time period until the still image shooting instruction is input. The moving image data can be recorded on a recording medium as a moving image file. The moving image data is temporarily stored in an encoded state in a memory provided in the imaging apparatus.

また、「ダイジェストムービーモード」においては、たとえば、同一日付に撮影された動画データをすべて連結した一つの動画データを作成し、記録媒体に記録することができる。この場合には、記録媒体に既に記録されている動画ファイルの動画データに対して、新規に撮影された動画データを静止画撮影の指示のあるごとに連結(追記)していく。また、連結されるたびに、各静止画撮影に対応する動画データを一つのチャプタに対応するものとして取り扱う。そのために、動画ファイルにはチャプタを示すためのチャプタデータが記録されることになる。   Further, in the “digest movie mode”, for example, one moving image data obtained by connecting all moving image data shot on the same date can be created and recorded on a recording medium. In this case, the newly captured moving image data is connected (added) to the moving image data of the moving image file already recorded on the recording medium every time a still image shooting instruction is given. In addition, each time they are connected, moving image data corresponding to each still image shooting is handled as corresponding to one chapter. Therefore, chapter data for indicating a chapter is recorded in the moving image file.

撮像装置100は、「ダイジェストムービーモード」にモードが遷移すると、撮像部により得られた複数の画像を動画の各フレーム画像とした符号化動画データを作成し、メモリに順次記憶していく。所定時間以上過去の動画データについては、メモリ上で破棄または、上書きする。そして、静止画撮影の指示が入力されると、撮像部により得られた画像信号に基づいて、静止画データを作成し、記録媒体に記録する。このとき、それまでメモリに記憶していた所定時間分の動画データを動画ファイルとして記録媒体に記録するのである。記録媒体に既に記録されている動画ファイル(既存動画ファイル)の動画データに、この所定時間分の動画データを連結する場合には、メモリに一時的に記憶されている所定時間分の動画データを記録媒体に先に記録する。そして、その後、既存動画ファイルの動画データを解析し、連結位置を特定してから動画データの連結編集を行う。なお、本実施例の撮像装置100は、静止画撮影の指示に対応する動画をそれぞれ別々のチャプタとして区別するために、チャプタ情報を動画ファイルに格納する。このとき、チャプタのタイトルとしては、静止画の撮影された撮影時刻をテキストデータとして記載するものとする。   When the mode transitions to the “digest movie mode”, the imaging apparatus 100 creates encoded moving image data in which a plurality of images obtained by the imaging unit are frame images of a moving image, and sequentially stores them in the memory. The past moving image data for a predetermined time or more is discarded or overwritten on the memory. When a still image shooting instruction is input, still image data is created based on the image signal obtained by the imaging unit and recorded on a recording medium. At this time, the moving image data for a predetermined time stored in the memory until then is recorded on the recording medium as a moving image file. When the video data for the predetermined time is connected to the video data of the video file (existing video file) already recorded on the recording medium, the video data for the predetermined time temporarily stored in the memory is stored. First record on the recording medium. After that, the moving image data of the existing moving image file is analyzed, and the connection position is specified, and then the moving image data is linked and edited. Note that the imaging apparatus 100 according to the present embodiment stores chapter information in a moving image file in order to distinguish moving images corresponding to still image shooting instructions as separate chapters. At this time, as the chapter title, the shooting time when the still image was shot is described as text data.

チャプタに対応する任意のシーンを削除する際には、削除対象のチャプタの記録媒体上での記録位置を特定し、削除対象のチャプタの動画データの少なくとも一部を読まないようにファイルアロケーションテーブルのクラスタチェーン書換える。具体的には、削除対象のチャプタの動画データの記録されているクラスタを読まないように、ファイルアロケーションテーブルのクラスタチェーンを書き換える。そして、動画ファイルのヘッダ情報を書き換えることで、削除対象のチャプタのデータを無効化すると共にデータの削減を行う。   When deleting an arbitrary scene corresponding to a chapter, the recording position of the chapter to be deleted on the recording medium is specified, and at least part of the moving image data of the chapter to be deleted is not read in the file allocation table. Rewrite cluster chain. Specifically, the cluster chain of the file allocation table is rewritten so as not to read the cluster in which the moving image data of the chapter to be deleted is recorded. Then, by rewriting the header information of the moving image file, the data of the chapter to be deleted is invalidated and the data is reduced.

このようにすることにより、動画の各シーンをデコードしてから削除シーンを含まないように再エンコードする必要がなくなるため高速に任意のシーンを削除する編集を行うことができるのである。   In this way, it is not necessary to re-encode each scene of the moving image after decoding it so as not to include the deleted scene, so that editing for deleting an arbitrary scene can be performed at high speed.

本実施例においては、ファイルアロケーションテーブルを用いた記録を行うファイルシステムに対応したフォーマット(本実施例ではファイルシステムとしてFAT32等を例とする)がなされた記録媒体を使用する。そして、前述した動画データの連結を行う際は、ファイルアロケーションテーブル(FAT)を編集している。従って、動画の追記や分離が容易に行えるのである。   In this embodiment, a recording medium having a format corresponding to a file system for recording using a file allocation table (in this embodiment, FAT32 or the like is taken as an example of the file system) is used. Then, when connecting the moving image data described above, the file allocation table (FAT) is edited. Therefore, it is possible to easily add and separate moving images.

以下、このような撮像装置について、説明する。   Hereinafter, such an imaging apparatus will be described.

まず、図1を用いて本実施例の撮像装置100の全体構成を説明する。   First, the overall configuration of the imaging apparatus 100 of the present embodiment will be described with reference to FIG.

本実施例の撮像装置100は、図1に示すように、CPU101と、RAM102と、ROM103と、操作部104とを有する。また、撮像装置100は、撮像部110と、画像処理部111と、マイクユニット120と、音声処理部121と、スピーカユニット122とを有する。また、撮像装置100は、符号化復号化処理部130と、表示部140と、表示制御部141と、記録再生部150と、記録媒体151と、通信部160とを有する。   As illustrated in FIG. 1, the imaging apparatus 100 according to the present exemplary embodiment includes a CPU 101, a RAM 102, a ROM 103, and an operation unit 104. The imaging apparatus 100 includes an imaging unit 110, an image processing unit 111, a microphone unit 120, an audio processing unit 121, and a speaker unit 122. In addition, the imaging apparatus 100 includes an encoding / decoding processing unit 130, a display unit 140, a display control unit 141, a recording / playback unit 150, a recording medium 151, and a communication unit 160.

なお、CPUは、Central Processing Unitの略称である。RAMは、Random Access Memoryの略称である。   CPU is an abbreviation for Central Processing Unit. RAM is an abbreviation for Random Access Memory.

本実施例の撮像装置100において、CPU101は、RAM102をワークメモリとしてROM103に記録された各種プログラムをRAM102に展開し、プログラムに応じて撮像装置100の各ブロックを制御する。操作部104は、例えば、電源ボタン、記録ボタン、ズーム調整ボタン、オートフォーカスボタン、メニュー表示ボタン、モード切替スイッチ、決定ボタン等の各種操作を入力するスイッチ類を有する。また、カーソルキー、ポインティングデバイス、タッチパネル、ダイヤル等のどのようなタイプの操作子であってもよい。操作部104は、ユーザによりこれらのキーやボタン、タッチパネルが操作されるとCPU101に操作信号を送信する。操作部104の各操作部材は、表示部に表示される種々の機能アイコンを選択操作することなどにより、場面ごとに適宜機能が割り当てられ、各種機能ボタンとして作用する。機能ボタンとしては、例えば終了ボタン、戻るボタン、画像送りボタン、ジャンプボタン、絞込みボタン、属性変更ボタン等がある。例えば、メニューボタンが押されると各種の設定可能なメニュー画面が表示部に表示される。利用者は、表示部に表示されたメニュー画面と、上下左右の4方向ボタンやSETボタンとを用いて直感的に各種設定を行うことができる。なお、操作部104は、表示部に対する接触を検知可能なタッチパネルであってもよい。タッチパネルは、抵抗膜方式や静電容量方式、表面弾性波方式、赤外線方式、電磁誘導方式、画像認識方式、光センサ方式等、様々な方式のタッチパネルのうちいずれの方式のものを用いても良い。   In the imaging apparatus 100 according to the present exemplary embodiment, the CPU 101 develops various programs recorded in the ROM 103 using the RAM 102 as a work memory, and controls each block of the imaging apparatus 100 according to the program. The operation unit 104 includes switches for inputting various operations such as a power button, a record button, a zoom adjustment button, an autofocus button, a menu display button, a mode switch, and a determination button. Further, any type of operation element such as a cursor key, a pointing device, a touch panel, and a dial may be used. The operation unit 104 transmits an operation signal to the CPU 101 when these keys, buttons, and touch panel are operated by the user. Each operation member of the operation unit 104 is appropriately assigned a function for each scene by selecting and operating various function icons displayed on the display unit, and functions as various function buttons. Examples of the function buttons include an end button, a return button, an image advance button, a jump button, a narrowing button, and an attribute change button. For example, when a menu button is pressed, various setting menu screens are displayed on the display unit. The user can make various settings intuitively using the menu screen displayed on the display unit, and the four-way buttons and the SET button. Note that the operation unit 104 may be a touch panel that can detect contact with the display unit. The touch panel may be any of various types of touch panels such as a resistive film method, a capacitance method, a surface acoustic wave method, an infrared method, an electromagnetic induction method, an image recognition method, and an optical sensor method. .

撮像部110は、レンズにより取り込まれた被写体の光学像を、絞りにより光量を制御して、CCDセンサやCMOSセンサ等の撮像素子により画像信号に変換し、得られたアナログ画像信号をデジタル画像信号に変換して一時的にRAM102に記憶する。RAM102に記憶されたデジタル画像信号は、その後、画像処理部111に送信される。画像処理部111は、デジタル画像信号のホワイトバランスや色、明るさなどをユーザに設定された設定値や画像の特性から自動的に判定した設定値に基づいて調整する画質調整処理を行い、処理をしたデジタル画像信号を再びRAM102に記憶する。また、画質調整処理済みまたは未処理のデジタル画像信号を、後述の表示制御部141に送信し、表示部140に撮像中の画像として表示することもできる。また、再生時においては、画像処理部111は、記録媒体151から記録再生部150によって読出され、符号化復号化処理部130において復号化された静止画ファイルや動画ファイルに含まれる画像データの画質調整等を行う。そして、画質調整済みまたは未処理のデジタル画像信号を、後述の表示制御部141に送信し、表示部140に画像として表示することもできる。   The imaging unit 110 converts an optical image of a subject captured by a lens into an image signal using an imaging element such as a CCD sensor or a CMOS sensor by controlling a light amount by a diaphragm, and converts the obtained analog image signal into a digital image signal. And temporarily stored in the RAM 102. The digital image signal stored in the RAM 102 is then transmitted to the image processing unit 111. The image processing unit 111 performs an image quality adjustment process for adjusting the white balance, color, brightness, and the like of the digital image signal based on a setting value set by the user or a setting value automatically determined from the characteristics of the image. The digital image signal that has been processed is stored in the RAM 102 again. In addition, a digital image signal that has undergone image quality adjustment processing or an unprocessed digital image signal can be transmitted to a display control unit 141 described later and displayed on the display unit 140 as an image being captured. At the time of reproduction, the image processing unit 111 reads the image quality of the image data included in the still image file or the moving image file read from the recording medium 151 by the recording / reproducing unit 150 and decoded by the encoding / decoding processing unit 130. Make adjustments. Then, an image quality adjusted or unprocessed digital image signal can be transmitted to a display control unit 141 described later and displayed on the display unit 140 as an image.

符号化復号化処理部130では、記録時においては、画像処理部111により処理されRAM102に記憶されたデジタル画像信号に対して、画像圧縮処理を行い、圧縮された動画データや静止画データを生成し、RAM102に一時的に記憶する処理を行う。また、再生時においては、記録媒体151から読出された画像ファイルの圧縮された動画データや静止画データを復号してデジタル画像信号を抽出し、RAM102に記憶していく処理を行う。   At the time of recording, the encoding / decoding processing unit 130 performs image compression processing on the digital image signal processed by the image processing unit 111 and stored in the RAM 102 to generate compressed moving image data and still image data. Then, a process of temporarily storing in the RAM 102 is performed. Further, at the time of reproduction, a process is performed in which the compressed moving image data and still image data of the image file read from the recording medium 151 is decoded to extract a digital image signal and stored in the RAM 102.

たとえば、動画データを生成する際は、動画データの各フレームをフレーム内符号化して圧縮符号化された動画データを生成する。また、動画データの複数のフレーム間での差分や動き予測などを利用して圧縮符号化された動画データを生成してもよい。たとえばMotionJPEG、MPEG、H.264(MPEG4−Part10 AVC)、等の様々な公知の圧縮符号化方式の動画データを生成することができる。一般に、フレーム内符号化されたフレーム画像データをIピクチャと呼び、前方のフレームとの差分を用いてフレーム間符号化された画像データをPピクチャと呼び、前方後方のフレームとの差分を用いてフレーム間符号化された画像データをBピクチャと呼ぶ。これらの圧縮方式は、公知の方式を用いており、本発明の特徴とは関係ないので説明を省略する。また、静止画データを生成する際には、JPEG等の一般的な圧縮符号化方式を用いるが、これらの圧縮符号化方式は、公知の方式を用いており、本発明の特徴とは関係ないので説明を省略する。なお、静止画データについては、撮像部110により得られたデジタル画像信号をそのまま記録する、いわゆるRAW画像データとしてもよい。   For example, when generating moving image data, each frame of the moving image data is intra-frame encoded to generate compression-encoded moving image data. Moreover, you may produce | generate the moving image data compression-coded using the difference between several flame | frames of moving image data, a motion estimation, etc. For example, Motion JPEG, MPEG, H.264. H.264 (MPEG4-Part10 AVC) and other known compression and encoding video data can be generated. In general, intra-frame encoded frame image data is referred to as an I picture, and inter-frame encoded image data using a difference from the front frame is referred to as a P picture, and the difference from the front and rear frames is used. The inter-frame encoded image data is called a B picture. These compression methods use well-known methods and are not related to the features of the present invention, so the description is omitted. Further, when generating still image data, a general compression encoding method such as JPEG is used, but these compression encoding methods use known methods and are not related to the features of the present invention. Therefore, explanation is omitted. The still image data may be so-called RAW image data in which the digital image signal obtained by the imaging unit 110 is recorded as it is.

マイクユニット120は、たとえば、撮像装置100のハウジング内に内蔵された無指向性のマイクとAD変換部を有する。マイクユニット120では、マイクにより周囲の音声を集音(収音)し、取得したアナログ音声信号をAD変換部で、デジタル信号に変換してRAM102に一時的に記憶させる。RAM102に記憶されたデジタル音声信号は、その後、音声処理部121に送信される。音声処理部121では、記録時においては、RAM102に記憶されたデジタル音声信号の、レベルの適正化処理や雑音低減処理等の処理を行い、処理をしたデジタル音声信号を再びRAM102に記憶する。また、必要に応じて、音声信号を圧縮する処理を行う。音声圧縮方式については、AC3、AAC等の公知の一般的な音声圧縮方式を用いているため説明を省略する。また、再生時においては、記録媒体151から記録再生部150によって読出された音声ファイルや動画ファイルに含まれる圧縮音声データ復号する処理や音声レベルの適正化処理、なども行い、順次RAM102に記憶する処理も行う。スピーカユニット122は、スピーカとDA変換部とを有する。スピーカユニット122では、音声処理部121によりRAM102に記憶されたデジタル音声信号を読出してアナログ音声信号に変換し、アナログ音声信号によりスピーカから音声を出力する。   The microphone unit 120 includes, for example, an omnidirectional microphone built in the housing of the imaging apparatus 100 and an AD conversion unit. In the microphone unit 120, ambient sound is collected (collected) by the microphone, and the acquired analog sound signal is converted into a digital signal by the AD converter and temporarily stored in the RAM 102. The digital audio signal stored in the RAM 102 is then transmitted to the audio processing unit 121. At the time of recording, the audio processing unit 121 performs processing such as level optimization processing and noise reduction processing on the digital audio signal stored in the RAM 102, and stores the processed digital audio signal in the RAM 102 again. Moreover, the process which compresses an audio | voice signal is performed as needed. As for the audio compression method, since a known general audio compression method such as AC3 or AAC is used, description thereof is omitted. Further, at the time of reproduction, a process for decoding the compressed audio data included in the audio file or the moving image file read from the recording medium 151 by the recording / reproducing unit 150, a process for optimizing the audio level, and the like are performed and sequentially stored in the RAM 102. Processing is also performed. The speaker unit 122 includes a speaker and a DA converter. In the speaker unit 122, the digital audio signal stored in the RAM 102 is read out by the audio processing unit 121 and converted into an analog audio signal, and audio is output from the speaker using the analog audio signal.

表示部140は、例えば、液晶パネルとバックライトとからなり、表示制御部141の制御により画像を表示する。表示部140は液晶表示装置に限られず、例えば有機ELディスプレイ、LEDディスプレイなど、ユーザに画像を提供することができればどのようなものであっても良い。表示制御部141では、画像処理部111により処理され、RAM102に記憶されたデジタル画像信号に基づいて、表示部140に画像を表示する。   The display unit 140 includes, for example, a liquid crystal panel and a backlight, and displays an image under the control of the display control unit 141. The display unit 140 is not limited to a liquid crystal display device, and may be any device that can provide an image to a user, such as an organic EL display or an LED display. The display control unit 141 displays an image on the display unit 140 based on the digital image signal processed by the image processing unit 111 and stored in the RAM 102.

記録再生部150では、動画記録時においては、RAM102に記憶されている、符号化復号化処理部130により生成された圧縮動画データ及び、音声処理部121で生成された音声データ、撮影日等の各種情報とともに、動画ファイルとして記録媒体151に書き込む。また静止画記録時においては、RAM102に記憶されている静止画データを撮影日等の各種情報とともに静止画ファイルとして記録媒体151に記録する。動画ファイルを記録媒体151に記録する際は、圧縮動画データと音声データとからなるデータストリームを形成し、順次記録媒体151に記録していき、ファイルヘッダ等を付加してFATやexFAT等のファイルフォーマットに適合した形で動画ファイルを記録媒体に記録する。また、再生時においては、記録媒体151に記録された動画ファイルや静止画ファイルを前述のファイルフォーマットに従って読出す。読出された動画ファイルや静止画ファイルは、CPU101によりヘッダが解析され、圧縮された動画データ、静止画データが抽出される。抽出された圧縮動画データ、静止画データは、RAM102に記憶されて、符号化復号化処理部130により復号される。   In the recording / reproducing unit 150, when recording a moving image, the compressed moving image data generated by the encoding / decoding processing unit 130, the audio data generated by the audio processing unit 121, the shooting date, and the like stored in the RAM 102 are stored. Along with various information, it is written in the recording medium 151 as a moving image file. At the time of recording a still image, the still image data stored in the RAM 102 is recorded on the recording medium 151 as a still image file together with various information such as the shooting date. When recording a moving image file on the recording medium 151, a data stream composed of compressed moving image data and audio data is formed and sequentially recorded on the recording medium 151, and a file header or the like is added to a file such as FAT or exFAT. Record a video file on a recording medium in a form that conforms to the format. Further, at the time of reproduction, a moving image file or a still image file recorded on the recording medium 151 is read according to the aforementioned file format. The read moving image file and still image file are analyzed for headers by the CPU 101, and compressed moving image data and still image data are extracted. The extracted compressed moving image data and still image data are stored in the RAM 102 and decoded by the encoding / decoding processing unit 130.

また、記録媒体151は、撮像装置に内蔵された記録媒体でも、取外し可能な記録媒体でもよい。例えば、ハードディスク、光ディスク、光磁気ディスク、CD−R、DVD−R、磁気テープ、不揮発性の半導体メモリ、フラッシュメモリ、などのあらゆる方式の記録媒体を含む。取り外し可能な記録媒体を用いる場合には、記録再生部150は、それらの取り外し可能な記録媒体を装着、排出するための機構を含む。   Further, the recording medium 151 may be a recording medium built in the imaging apparatus or a removable recording medium. For example, the recording medium includes all types of recording media such as a hard disk, an optical disk, a magneto-optical disk, a CD-R, a DVD-R, a magnetic tape, a nonvolatile semiconductor memory, and a flash memory. When using removable recording media, the recording / reproducing unit 150 includes a mechanism for loading and unloading the removable recording media.

また、通信部160は、撮像装置100とは異なる外部装置との間で、制御信号や動画ファイル、静止画ファイル、各種データ等を送受信するものであり、有線接続、無線接続を問わず接続可能である。なお、通信方式はどのような方式であっても良い。   The communication unit 160 transmits and receives control signals, moving image files, still image files, various data, and the like to and from an external device different from the imaging device 100, and can be connected regardless of wired connection or wireless connection. It is. Note that any communication method may be used.

ここで、前述の画像処理部111、音声処理部121、符号化復号化処理部130、表示し制御部141、記録再生部150は、それぞれ、前述の各機能を実行するプログラムを搭載したマイクロコンピュータであってもよい。また、CPU101がROM103に記録された前述の処理を実行する為のプログラムをRAM102に展開して実行するようにしてもよい。   Here, each of the image processing unit 111, the audio processing unit 121, the encoding / decoding processing unit 130, the display control unit 141, and the recording / reproducing unit 150 described above is a microcomputer in which a program for executing each of the functions described above is installed. It may be. Further, the program for executing the above-described processing recorded in the ROM 103 by the CPU 101 may be loaded into the RAM 102 and executed.

なお、本実施例の撮像装置100は、一例として、「QuickTime(登録商標)フォーマット」で動画ファイルを記録するものとするが、どのようなフォーマットであっても良い。   Note that the imaging apparatus 100 according to the present exemplary embodiment records a moving image file in the “QuickTime (registered trademark) format” as an example, but any format may be used.

なお、本実施例では記録媒体151のファイル管理システムは組み込み機器で一般的に使用されているFATファイルシステムを使用するものとして説明をする。FATファイルシステムの技術自体は広く公知であるので、本実施例の特徴的な動作でのみその説明をする。また、FATファイルフォーマットであるNTFSフォーマットやexFATフォーマットなどを用いても良い。   In this embodiment, the file management system of the recording medium 151 will be described as using a FAT file system generally used in embedded devices. Since the technology of the FAT file system itself is widely known, only the characteristic operation of this embodiment will be described. Further, the NTFS format or the exFAT format which is a FAT file format may be used.

次に、本実施例の撮像装置100の動作について説明する。   Next, the operation of the imaging apparatus 100 according to the present embodiment will be described.

本実施例の撮像装置100は、ユーザによって操作部104を操作して電源を投入する指示が出されたことに応じて、不図示の電源供給部から、撮像装置の各ブロックに電源を供給する。   The imaging apparatus 100 according to the present exemplary embodiment supplies power to each block of the imaging apparatus from a power supply unit (not illustrated) in response to an instruction to turn on the power by operating the operation unit 104 by the user. .

電源が供給されると、CPU101は、操作部104により設定されたカメラのモードが、再生モードであるか、「ダイジェストムービーモード」、静止画記録モード、動画記録モードであるかを判定する。なお、本実施例において、静止画記録モード、動画記録モードは、特徴的な構成に関わらないので説明を割愛する。   When power is supplied, the CPU 101 determines whether the camera mode set by the operation unit 104 is a playback mode, a “digest movie mode”, a still image recording mode, or a moving image recording mode. In the present embodiment, the still image recording mode and the moving image recording mode are not related to the characteristic configuration, and thus description thereof is omitted.

次に、再生モードについて、説明する。   Next, the playback mode will be described.

操作部104により再生モードが設定されると、CPU101は、再生状態に移行させるように制御信号を撮像装置100の各ブロックに送信し、以下のような動作をさせる。   When the playback mode is set by the operation unit 104, the CPU 101 transmits a control signal to each block of the imaging apparatus 100 so as to shift to the playback state, and performs the following operation.

記録再生部150は、記録媒体151に記録された、符号化された動画データと符号化された音声データとからなる動画ファイルを読み出す。CPU101は読み出された符号化された動画データと符号化された音声データとを、RAM102にバッファする。そして、CPU101は、符号化された動画データを復号するように符号化復号化処理部130を制御する。また、CPU101は、符号化された音声データを復号するように音声処理部121を制御する。   The recording / playback unit 150 reads a moving image file that is recorded on the recording medium 151 and includes encoded moving image data and encoded audio data. The CPU 101 buffers the read encoded moving image data and encoded audio data in the RAM 102. Then, the CPU 101 controls the encoding / decoding processing unit 130 so as to decode the encoded moving image data. In addition, the CPU 101 controls the audio processing unit 121 to decode the encoded audio data.

そして、CPU101は、符号化復号化処理部130によって復号された動画データの各フレームデータを表示制御部141に送り、表示部140に各フレームの画像を表示させる。また、音声処理部121で、復号された音声データをスピーカユニット122に送信し、音声データに対応する音声を出力させる。   Then, the CPU 101 sends each frame data of the moving image data decoded by the encoding / decoding processing unit 130 to the display control unit 141 and causes the display unit 140 to display an image of each frame. In addition, the audio processing unit 121 transmits the decoded audio data to the speaker unit 122, and outputs audio corresponding to the audio data.

また、再生モードにおいては、指定されたチャプタにジャンプして、そのチャプタの先頭のシーンから再生を開始させたり、指定されたチャプタの動画を削除したりする処理を実行することもできる。削除処理については後述する。   In the playback mode, it is also possible to execute a process of jumping to a specified chapter and starting playback from the first scene of the chapter or deleting a moving image of the specified chapter. The deletion process will be described later.

次に、「ダイジェストムービーモード」について、図2のフロー図を用いて説明する。図2のフロー図は、ダイジェストムービーモードに設定されたときをスタートとするフロー図であり、CPU101がRAM102に展開したプログラムに基づいて、撮像装置100の各部を制御することにより、実行される処理である。なお、本実施形態において、動画データを順次追記していくか否かは、静止画記録の指示があった後で、動画データを記録媒体151に記録する前に行うものとする。すなわち、CPU101が、記録再生部150より、最後にダイジェストムービーモードで撮影された動画ファイルを読み出して撮影された日付の情報を確認する。そして、読み出された動画ファイルが当日に撮影されたものであれば、追記するものとし、異なる日に撮影されたものであれば、追記しないものとする。ダイジェストムービーモードにおいて撮影された動画は、たとえばダイジェストムービーモードで撮影された動画であることを示すための識別子「MDG」に4桁の整数を順次数字をインクリメントしたファイル名とする。このようにすることで、記録媒体151に記録されている識別子MDGを含む数字のもっとも大きい動画が最後に撮影されたものであることが容易に識別可能である。追記するか否かの条件については後述するが、追記するか否かの確認は、撮像装置100の起動時または、ダイジェストムービーモードへの切り替え時等に行ってもよい。   Next, the “digest movie mode” will be described with reference to the flowchart of FIG. The flowchart in FIG. 2 is a flowchart that starts when the digest movie mode is set, and is executed by the CPU 101 controlling each unit of the imaging apparatus 100 based on a program developed in the RAM 102. It is. In the present embodiment, whether or not to add the moving image data sequentially is determined after recording the still image and before recording the moving image data on the recording medium 151. That is, the CPU 101 reads out the moving image file that was last shot in the digest movie mode from the recording / playback unit 150 and confirms the information on the date when the movie was shot. If the read moving image file is taken on the same day, it is added. If it is taken on a different day, it is not added. The moving image shot in the digest movie mode is, for example, a file name obtained by sequentially incrementing a 4-digit integer in an identifier “MDG” for indicating that the moving image was shot in the digest movie mode. By doing in this way, it can be easily identified that the moving image having the largest number including the identifier MDG recorded on the recording medium 151 was taken last. The conditions for whether or not to add data will be described later, but confirmation of whether or not to add data may be performed when the imaging apparatus 100 is activated or when the mode is switched to the digest movie mode.

また、本実施形態においては、サムネイル画像の生成は、静止画撮影の指示が入力される毎に生成されるものとして説明する。この場合、追記した動画ファイルには複数のサムネイル画像が関連づけられることになる。しかし、追記する場合にはサムネイル画像を生成せずに、新規に動画ファイルを生成する場合にのみ、サムネイル画像を生成するようにしても良い。   In the present embodiment, the description will be made assuming that the thumbnail image is generated every time a still image shooting instruction is input. In this case, a plurality of thumbnail images are associated with the added moving image file. However, in the case of additional recording, a thumbnail image may be generated only when a moving image file is newly generated without generating a thumbnail image.

操作部104によりダイジェストムービーモードが設定されると、CPU101は、撮像装置100の各ブロックを制御し、以下の動作を実行させる。   When the digest movie mode is set by the operation unit 104, the CPU 101 controls each block of the imaging apparatus 100 and causes the following operations to be executed.

まず、撮像部110は、得られたデジタル画像信号をRAM102に送信し、一時的に記憶させる。そうすると、表示制御部141は、RAM102に記憶されたデジタル画像信号を読み出して表示部140に表示させる。また、画像処理部111は、RAM102に記憶されたデジタル画像信号を順次読み出して、前述の各種画質調整処理を行い、処理をしたデジタル画像信号を再びRAM102に記憶する。画像処理部111は、撮像部110で画像が撮像される度にこの処理を繰り返す。   First, the imaging unit 110 transmits the obtained digital image signal to the RAM 102 and temporarily stores it. Then, the display control unit 141 reads the digital image signal stored in the RAM 102 and causes the display unit 140 to display the digital image signal. The image processing unit 111 sequentially reads out the digital image signals stored in the RAM 102, performs the above-described various image quality adjustment processes, and stores the processed digital image signals in the RAM 102 again. The image processing unit 111 repeats this process every time an image is captured by the imaging unit 110.

また、符号化復号化処理部130は、画像処理部111によって処理されたデジタル画像信号を動画データとして符号化するための符号化処理を行う(S201)。例えば、符号化処理としては、MotionJPEG、MPEG、H.264(MPEG4−Part10 AVC)、等の様々な公知の圧縮符号化方式処理がある。本実施例においては、例えば、H.264におけるフレーム内予測符号化画像を含む動画データとなるように符号化処理を行うものとする。なお、フレーム内予測符号化画像は、IDRフレームと呼ばれるフレーム間予測符号化画像の飛び越し参照を禁止するフレームとして符号化する。各IDRフレームには、idr_pic_idが付加されている。   The encoding / decoding processing unit 130 performs an encoding process for encoding the digital image signal processed by the image processing unit 111 as moving image data (S201). For example, the encoding process includes Motion JPEG, MPEG, H.264, and so on. There are various well-known compression encoding system processes such as H.264 (MPEG4-Part10 AVC). In the present embodiment, for example, H.264. It is assumed that the encoding process is performed so that the moving image data includes an intra-frame predictive encoded image in H.264. Note that the intraframe predictive encoded image is encoded as a frame that prohibits interlaced reference of interframe predictive encoded images called IDR frames. Idr_pic_id is added to each IDR frame.

また、このときCPU101は音声処理部121に、マイクユニット入力されたデジタル音声信号に対して種々の調整処理を適用した後、予め設定された音声用の符号化方式に従って符号化処理を実行し、得られた符号化された音声信号をRAM102に記憶させる。   At this time, the CPU 101 applies various adjustment processes to the digital audio signal input to the microphone unit in the audio processing unit 121, and then executes the encoding process according to a preset audio encoding method. The encoded audio signal obtained is stored in the RAM 102.

そして、符号化復号化処理部130、音声処理部121は、符号化された動画データと音声データをRAM102記憶していく(S202)。以後の説明では、音声データについては説明を省略するが、動画データとともに処理されるものとする。   Then, the encoding / decoding processing unit 130 and the audio processing unit 121 store the encoded moving image data and audio data in the RAM 102 (S202). In the following description, although explanation of audio data is omitted, it is assumed that it is processed together with moving image data.

本実施形態の撮像装置100においては、RAM102には、常に直前の予め定められた時間分の動画データが記憶されるようにRAM102に記憶されている動画データのうち、予め定められた時間より前に撮像された動画データを削除するようにしている。そのため、CPU101は、所定時間分以上の動画データがRAM102に記憶されたか否かを判定し(S203)、所定時間以上記憶されている場合(S203で、Yes)、所定時間よりも過去の時点で撮影された画像を示す動画データを破棄するようにしている。削除するデータのサイズは符号化単位で規定されるため、符号化方式によっては当該削除するデータのサイズをフレームまたは再生時間として決定することもできる。また、所定時間以上記憶されていない場合(S203で、No)、動画データの破棄を行わない。本実施例では所定時間は任意の時間であってよいが、例えば4秒、6秒、8秒など、ユーザが選択できるようにしても良い。そして、CPU101は、静止画撮影の指示が操作入力部112から入力されたか否かを判定し(S205)、静止画撮影の指示が入力されていない場合(S205でNo)、再びS201に戻り、動画データの生成処理、一時記憶を継続する。   In the imaging apparatus 100 according to the present embodiment, the RAM 102 always stores the moving image data for the predetermined time immediately before the predetermined time among the moving image data stored in the RAM 102 so that the moving image data for the predetermined time is stored. The moving image data picked up at the time is deleted. For this reason, the CPU 101 determines whether or not moving image data for a predetermined time or more has been stored in the RAM 102 (S203), and if it has been stored for a predetermined time or longer (Yes in S203), at a point in time that is earlier than the predetermined time. The moving image data indicating the photographed image is discarded. Since the size of the data to be deleted is defined in encoding units, the size of the data to be deleted can be determined as a frame or a reproduction time depending on the encoding method. In addition, when it is not stored for a predetermined time or longer (No in S203), the moving image data is not discarded. In the present embodiment, the predetermined time may be any time, but may be selected by the user, for example, 4 seconds, 6 seconds, 8 seconds, or the like. Then, the CPU 101 determines whether or not a still image shooting instruction is input from the operation input unit 112 (S205). If a still image shooting instruction is not input (No in S205), the process returns to S201 again. The generation processing and temporary storage of moving image data are continued.

なお、本実施形態では常に直前の予め定められた時間分の動画データがRAM102には記憶されるものとして説明するが、本発明の実施はこれに限らない。即ち、RAM102に記憶される動画データのサイズは定量可能なものであればよく、例えばフレーム数、GOP数(Group Of Pictures)、データサイズ等で規定される、予め定められた量であってよい。つまり、RAM102に記憶されている動画データは、当該動画データのサイズが予め定められたサイズ以上となった場合に、当該予め定められたサイズ未満のサイズとなるまで、動画データのフレームのうちの撮影時刻が古いフレームから順に削除されるようにしてもよい。   In the present embodiment, it is assumed that moving image data for a predetermined time immediately before is always stored in the RAM 102, but the present invention is not limited to this. That is, the size of the moving image data stored in the RAM 102 may be anything that can be quantified, and may be a predetermined amount defined by, for example, the number of frames, the number of GOPs (Group Of Pictures), the data size, and the like. . In other words, when the moving image data stored in the RAM 102 is larger than the predetermined size, the moving image data is stored in the frames of the moving image data until the size becomes less than the predetermined size. The shooting time may be deleted in order from the oldest frame.

ここで、静止画撮影の指示が入力された場合(S205でYes)、CPU101は、記録媒体151の記録可能容量をチェックするように記録再生部150を制御し、RAM102に一時的に記憶されている動画データの記録が可能であるか否かを判定しても良い。この判定は、RAM102に一時的に記憶されている動画データのサイズと、記録する静止画データの見込みサイズとの和が、記録媒体151の記録可能容量よりも小さいか否かを比較することにより判定される。静止画データの見込みサイズはたとえば4MBとしても良いし、記録サイズや画質等に応じて変更してもよい。   When a still image shooting instruction is input (Yes in S205), the CPU 101 controls the recording / playback unit 150 to check the recordable capacity of the recording medium 151, and is temporarily stored in the RAM 102. It may be determined whether or not the moving image data can be recorded. This determination is made by comparing whether the sum of the size of the moving image data temporarily stored in the RAM 102 and the expected size of the still image data to be recorded is smaller than the recordable capacity of the recording medium 151. Determined. The expected size of the still image data may be 4 MB, for example, or may be changed according to the recording size, image quality, or the like.

この判定により、動画データと、静止画データとを記録媒体151に記録できない場合には、静止画撮影のみを行い、動画データを記録しないようにしても良い。   If it is determined that the moving image data and the still image data cannot be recorded on the recording medium 151, only the still image shooting may be performed and the moving image data may not be recorded.

また、S205で静止画撮影の指示が入力されたときに、RAM102に例えば1秒未満や2秒未満等の短い時間分の動画データしか記憶されていない場合には、静止画撮影の指示を無効とするようにしても良い。この時間もユーザ画設定できるようにしても良い。   Also, when a still image shooting instruction is input in S205, if only a short amount of moving image data such as less than 1 second or less than 2 seconds is stored in the RAM 102, the still image shooting instruction is invalidated. You may make it. You may enable it to set a user image also during this time.

次に、静止画撮影の指示が入力された場合(S205でYes)、CPU101は、撮像部110に静止画データ用の撮影を実行させる(S210)。CPU101は、このとき並行して符号化復号化処理部130に、RAM102に記憶されている動画データの先頭フレームの画像を復号させ、サムネイル画像生成処理を実行させる(S211)。なお、本実施形態では記録される動画データのサムネイル画像は先頭フレームの画像から生成されるものとして説明するが、本発明の実施はこれに限らず、記録される動画データのフレームのうちのいずれかのフレームの画像から生成されればよい。すなわち、静止画撮影の指示があったときに、RAM102に記憶されている動画データのいずれかのフレームを用いたサムネイル画像が生成されればよい。このようにすることで、一度動画データの記録媒体へのファイル記録が終了してから、記録媒体から動画ファイルを読み出したりすることなく、動画データのサムネイルを生成することができるので、処理が早くなる。なお、静止画の撮影指示がなされたと判断した場合、CPU101は更なる静止画の撮影指示がなされても、指示を受け付けないよう制御する。   Next, when a still image shooting instruction is input (Yes in S205), the CPU 101 causes the imaging unit 110 to perform shooting for still image data (S210). At this time, the CPU 101 causes the encoding / decoding processing unit 130 to decode the image of the first frame of the moving image data stored in the RAM 102 and execute the thumbnail image generation processing (S211). In this embodiment, the thumbnail image of the moving image data to be recorded is described as being generated from the image of the first frame. However, the present invention is not limited to this, and any of the frames of the moving image data to be recorded is used. It may be generated from an image of such a frame. That is, a thumbnail image using any frame of the moving image data stored in the RAM 102 may be generated when a still image shooting instruction is given. In this way, it is possible to generate a thumbnail of the moving image data without reading the moving image file from the recording medium after the file recording of the moving image data to the recording medium is finished once, so that the processing is quick. Become. If it is determined that a still image shooting instruction has been issued, the CPU 101 performs control so that the instruction is not accepted even if a still image shooting instruction is issued.

次に、CPU101は、符号化復号化処理部130によるサムネイル画像生成処理が完了したか否かを判定し(S212)、処理が完了している場合には、次に、S210で撮影されたデジタル画像信号を静止画データとするべく、画像処理部111に現像処理を、符号化復号化処理部130に符号化処理を順次実行させる(S220)。このとき、CPU101は並行して、サムネイル生成処理で生成されたサムネイル画像をRAM102に一時記憶されている符号化済みの動画データのヘッダ情報に含めて、記録媒体151に記録するように記録再生宇150を制御する(S221)。ここで、静止画の現像処理(S220)とは、撮影時に各画素に対してその周辺画素から足りない色情報を集め与えることで色情報を補完し、フルカラー画像を作り出す「デモザイク」処理等を含む処理で、このほかに、ガンマ補正、ホワイトバランス調整などの処理を含んでも良い。   Next, the CPU 101 determines whether or not the thumbnail image generation processing by the encoding / decoding processing unit 130 has been completed (S212). If the processing has been completed, next, the digital image captured in S210 is determined. In order to convert the image signal into still image data, the image processing unit 111 sequentially executes development processing and the encoding / decoding processing unit 130 sequentially executes encoding processing (S220). At this time, in parallel, the CPU 101 includes the thumbnail image generated by the thumbnail generation process in the header information of the encoded moving image data temporarily stored in the RAM 102 and records it on the recording medium 151. 150 is controlled (S221). Here, the still image development process (S220) is a “demosaic” process for creating a full-color image by complementing color information by collecting and giving missing color information from its surrounding pixels to each pixel during shooting. In addition to this, processing such as gamma correction and white balance adjustment may be included.

CPU101は、前述した現像処理が終了すると、現像したデジタル画像データを再びRAM102に記憶させ、表示制御部141に読み出させて、表示部140に表示させる。これは、一般にデジタルカメラで撮影を行った直後に表示部140に、撮影画像を表示させる、所謂「レックレビュー」表示である。ちなみに、静止画撮影の指示がなされてから静止画の現像処理が終了するまでの間、表示部140には、何の画像も表示されておらず、黒画像が表示されている。また、代わりに「処理中」などの状態をユーザに提示するための表示をさせても良い。   When the above-described development processing is completed, the CPU 101 stores the developed digital image data in the RAM 102 again, causes the display control unit 141 to read it, and causes the display unit 140 to display it. This is a so-called “rec review” display in which a photographed image is displayed on the display unit 140 immediately after photographing with a digital camera. Incidentally, no image is displayed on the display unit 140 and a black image is displayed until the still image development process is completed after an instruction to shoot a still image is given. Alternatively, a display for presenting a status such as “processing” to the user may be displayed.

また、現像処理が終了すると、CPU101は、予め設定された静止画記録用の符号化方式に従って符号化復号化処理部130に符号化処理を実行させる。次にCPU101は、静止画の現像処理、符号化処理が終了したか否かを判定する(S222)。静止画の符号化処理が終了したと判定すると、(S222でYes)、CPU101は、生成された静止画データを記録再生部150に送り、記録媒体151に記録させる(S223)。そして、ユーザが操作入力部102を操作してダイジェストムービーモードを抜ける指示をしていないかぎり(S224でNo)、CPU101は、静止画の記録と並行して、動画の撮影、符号化処理(S201)を開始する。このとき、CPU101は、表示制御部141に、RAM102に記憶されたデジタル画像信号を読み出させ、再びスルー画像を表示部140に表示させる。   When the development process is completed, the CPU 101 causes the encoding / decoding processing unit 130 to execute the encoding process according to a preset encoding method for still image recording. Next, the CPU 101 determines whether or not the still image development process and the encoding process have been completed (S222). If it is determined that the still image encoding process has been completed (Yes in S222), the CPU 101 sends the generated still image data to the recording / playback unit 150 to be recorded on the recording medium 151 (S223). Then, unless the user operates the operation input unit 102 to give an instruction to exit the digest movie mode (No in S224), the CPU 101 captures and encodes a moving image in parallel with recording a still image (S201). ). At this time, the CPU 101 causes the display control unit 141 to read out the digital image signal stored in the RAM 102 and displays the through image on the display unit 140 again.

以上のように、本実施例の撮像装置100は、「ダイジェストムービーモード」において、動画ファイルと、静止画ファイルを記録する。   As described above, the imaging apparatus 100 according to the present exemplary embodiment records a moving image file and a still image file in the “digest movie mode”.

ここで、本実施例の「ダイジェストムービーモード」において、記録媒体151に既に記録されている動画ファイル(既存動画ファイル)の動画データに対して、新たに撮影された動画データ(新規動画データ)を連結(追記)する場合の例について説明する。たとえば、既存動画ファイルの記録された日付と、新規動画データの取得した日付(撮影時点でのカメラの日付設定でも良い)とが同じ場合には、動画データを連結するものとすると、図3に示すように記録される。図3は、撮影タイミングと、動画ファイル、静止画ファイルの記録状態を示すものである。   Here, in the “digest movie mode” of the present embodiment, the newly captured video data (new video data) is added to the video data of the video file (existing video file) already recorded on the recording medium 151. An example of connection (additional writing) will be described. For example, if the date when the existing video file was recorded and the date when the new video data was acquired (the camera date setting at the time of shooting may be the same), the video data should be concatenated as shown in FIG. Recorded as shown. FIG. 3 shows the shooting timing and the recording state of the moving image file and the still image file.

同一の撮影日を有する静止画ファイルP1、P2、及びP3は記録媒体151の1つのフォルダ(同一フォルダ内)に記録され、各静止画の撮影直前にRAM102に記憶された動画データは同じフォルダに1つの連結された動画ファイルとして記録される。また、静止画ファイルP1からP3とは異なる撮影日を有するP4及びP5は、静止画ファイルP1が記録されたフォルダとは異なるフォルダに記録されるものとする。このとき、静止画ファイルP4の撮影直前にRAM102に記憶された動画データが、当該動画データの途中で撮影日が変更された場合であっても、静止画ファイルP4の撮影日と同一のフォルダに記録されるように制御するものとする。すなわち、撮影指示の入力されたタイミングの日付情報によって、動画データを連結するか新規に保存するかのいずれかを決定することにもなる。   Still image files P1, P2, and P3 having the same shooting date are recorded in one folder (in the same folder) of the recording medium 151, and the moving image data stored in the RAM 102 immediately before shooting each still image is stored in the same folder. It is recorded as one linked moving image file. Further, P4 and P5 having shooting dates different from those of the still image files P1 to P3 are recorded in a folder different from the folder in which the still image file P1 is recorded. At this time, the moving image data stored in the RAM 102 immediately before shooting the still image file P4 is stored in the same folder as the shooting date of the still image file P4 even if the shooting date is changed in the middle of the moving image data. It shall be controlled to be recorded. That is, it is determined whether to link the moving image data or to newly save the moving image data, based on the date information at the timing when the shooting instruction is input.

また、本実施形態では、静止画撮影の指示が入力される毎に、動画データに対応するサムネイル画像を生成するものとして説明したが、たとえばP1の静止画データの撮影時に生成される動画データM1に対応するサムネイルは生成し、追記されるM2、M3の動画データのサムネイル画像を生成しないようにしても良い。このようにすると、動画ファイル1つについて、サムネイル画像を1つとすることができる。   Further, in the present embodiment, it has been described that a thumbnail image corresponding to moving image data is generated every time a still image shooting instruction is input. However, for example, moving image data M1 generated at the time of shooting P1 still image data. The thumbnails corresponding to may be generated, and the thumbnail images of the M2 and M3 moving image data to be added may not be generated. In this way, it is possible to have one thumbnail image for each moving image file.

次に、「ダイジェストムービーモード」において、記録媒体151に既に記録されている動画ファイル(既存動画ファイル)の動画データに対して、新たに撮影された動画データ(新規動画データ)を連結(追記)する編集を行う場合の動作について詳しく説明する。前述したように、連結(追記)するか否かの判定は、撮像装置100の起動時または、ダイジェストムービーモード選択時、または、静止画記録の指示が入力された後に行う。   Next, in the “digest movie mode”, the newly captured video data (new video data) is linked (added) to the video data of the video file (existing video file) already recorded on the recording medium 151. The operation when editing is performed will be described in detail. As described above, whether to link (add) is determined when the imaging apparatus 100 is activated, when the digest movie mode is selected, or after a still image recording instruction is input.

この動画データの連結処理は、図2のS221において実行される処理であるが、後述するように、一部の処理は、S222、S223、S201からS204と並行に処理されても良い。   The moving image data concatenation process is a process executed in S221 of FIG. 2, but as described later, some processes may be performed in parallel with S222, S223, and S201 to S204.

図4は、動画データの連結(追記)をする編集を行う場合の撮像装置の制御動作を示す図であり、図5は、図4の各ステップに対応し、記録媒体151内の動画ファイルの状態を示す図である。図4の動作は、CPU101が、撮像装置100の各ブロックを制御することにより実行される処理である。   FIG. 4 is a diagram showing a control operation of the imaging apparatus when editing for connecting (adding) moving image data, and FIG. 5 corresponds to each step of FIG. 4 and shows a moving image file in the recording medium 151. It is a figure which shows a state. The operation in FIG. 4 is a process executed by the CPU 101 controlling each block of the imaging apparatus 100.

まず、CPU101は、S202で、RAM102に記憶させた所定時間分の動画データを記録媒体151の空き領域に記録するように記録再生部150を制御する(S410)。このとき、ファイルシステムとしては、FATを用いているため、基本的なルールに則り、空いているクラスタに動画データを記録する。   First, in step S202, the CPU 101 controls the recording / playback unit 150 so as to record moving image data for a predetermined time stored in the RAM 102 in a free area of the recording medium 151 (S410). At this time, since the FAT is used as the file system, the moving image data is recorded in an empty cluster in accordance with basic rules.

図5(a)は、RAM102の動画データを記録媒体151に記録する前の特定の動画ファイルの記録状態を示す図である。図5(a)においては、クラスタ1から2にかけて、特定の動画ファイルの動画データが記録されており、クラスタ3に特定の動画ファイルのヘッダが記録されている。動画ファイルは、このように、クラスタ1から3に記録されている。そして、FAT領域には、クラスタ番号3→1→2の順でファイルが記録されていることを示すようにFATエントリーにクラスタ番号が記録されている。すなわち、クラスタ番号3のFATエントリーには「1」が記録されており、クラスタ番号1のFATエントリーには「2」が記録されており、クラスタ番号2のFATエントリーには、ファイル終端を示す「FF」が記録されている。そのため、特定の動画ファイルは、クラスタ番号3→1→2の順で記録媒体からデータを読み出せばよいのである。   FIG. 5A is a diagram illustrating a recording state of a specific moving image file before the moving image data in the RAM 102 is recorded on the recording medium 151. In FIG. 5A, moving image data of a specific moving image file is recorded from cluster 1 to cluster 2, and a header of the specific moving image file is recorded in cluster 3. The moving image file is recorded in the clusters 1 to 3 as described above. In the FAT area, the cluster number is recorded in the FAT entry so as to indicate that the file is recorded in the order of cluster number 3 → 1 → 2. That is, “1” is recorded in the FAT entry with the cluster number 3, “2” is recorded in the FAT entry with the cluster number 1, and the FAT entry with the cluster number 2 indicates “ FF "is recorded. Therefore, a specific moving image file may be read from the recording medium in the order of cluster number 3 → 1 → 2.

そして、S410で、RAM102に記憶された所定時間分の動画データを記録媒体151に記録した状態を示す図が、図5(b)である。図5(b)では、クラスタ4、5に、所定時間分の動画データが記録された状態を示している。この状態では、FAT領域のFATエントリーを確認してもわかるように、所定時間分の動画データは、クラスタ1から3に記録された特定の動画ファイルとは、別のクラスタ4、5に記録されたデータとなっている。   FIG. 5B shows a state in which moving image data for a predetermined time stored in the RAM 102 is recorded on the recording medium 151 in S410. FIG. 5B shows a state in which moving image data for a predetermined time is recorded in the clusters 4 and 5. In this state, as can be understood by checking the FAT entry in the FAT area, the moving image data for a predetermined time is recorded in the clusters 4 and 5 different from the specific moving image file recorded in the clusters 1 to 3. It has become the data.

次に、S420の処理を説明する。ここで、S410の処理が開始していれば、S410の処理が終了していなくても、S420の処理を開始しても良い。   Next, the process of S420 will be described. Here, if the process of S410 has started, the process of S420 may be started even if the process of S410 has not ended.

CPU101は、RAM102に記憶された所定時間分の動画データの記録が開始した後に、記録媒体151に記録された特定の動画ファイルの動画データを解析し、連結位置を特定する。連結位置は、本実施例では、特定の動画ファイルの動画データの後とする。この処理は、特定の動画ファイルのサイズが大きいほど、ファイルの読み出しや解析に時間がかかるので、連結位置の特定までにも時間がかかることがある。   The CPU 101 analyzes moving image data of a specific moving image file recorded on the recording medium 151 after the recording of moving image data for a predetermined time stored in the RAM 102 is started, and specifies a connection position. In this embodiment, the connection position is after the moving image data of a specific moving image file. In this process, the larger the size of a specific moving image file, the longer it takes to read and analyze the file, so it may take longer to specify the connection position.

次に、CPU101は、記録媒体151に記録された、所定時間分の動画データを特定の動画ファイルに連結(追記)するために、FATエントリーを書き換えるように、記録再生部150を制御する(S430)。すなわち、図5(c)に示す要に、特定の動画ファイルの終端がクラスタ番号2である状態を変更し、クラスタ2の後、続けて、クラスタ4、5を読むように修正する。具体的には、FATのクラスタ番号2のFATエントリーをファイル終端を示す「FF」から、新規動画データの記録されているクラスタの先頭であるクラスタ4を読むように、「4」に書き換えるのである。   Next, the CPU 101 controls the recording / reproducing unit 150 so as to rewrite the FAT entry in order to link (append) a predetermined time period of moving image data recorded on the recording medium 151 to a specific moving image file (S430). ). That is, as shown in FIG. 5C, the state where the end of the specific moving image file is the cluster number 2 is changed, and after the cluster 2, the modification is made so that the clusters 4 and 5 are read continuously. Specifically, the FAT entry of the FAT cluster number 2 is rewritten to “4” so that the cluster 4 which is the head of the cluster in which the new moving image data is recorded is read from “FF” indicating the end of the file. .

そして、CPU101は、特定の動画ファイルのファイルヘッダを読み出して、新規動画データのデータを管理する情報を追記するように、ファイルヘッダを編集し、記録媒体151に記録する(S440)。ファイルヘッダにはたとえば、動画の特定のフレーム、または特定のGOPの開始位置が動画ファイルのどの位置のデータであるかを示すような管理情報が記録されることになる。このような処理により、図5(c)に示すように、連結編集後の動画ファイルは、クラスタ1から5からなり、クラスタ番号3→1→2→4→5の順で記録された状態になる。   Then, the CPU 101 reads the file header of the specific moving image file, edits the file header so as to add information for managing the data of the new moving image data, and records the file header on the recording medium 151 (S440). In the file header, for example, management information indicating which position in the moving image file the data of the specific frame of the moving image or the start position of the specific GOP is recorded. As a result of such processing, as shown in FIG. 5C, the movie file after concatenation editing is composed of clusters 1 to 5 and is recorded in the order of cluster numbers 3 → 1 → 2 → 4 → 5. Become.

そして、CPU101は、処理をS222へ移す。   Then, the CPU 101 moves the process to S222.

なお、S420からS440の処理は、S222、S223の処理と並行して実行されてもよく、さらには、次の撮影による動画データの一時記憶S201からS204の処理と並行して実行されても良い。なぜなら、S410の処理により、RAM102に記憶されていた動画データは、記録媒体151に既に記録されているため、動画データを一時的に記憶するためのRAM102の領域は開放されるからである。RAM102の動画データを一時記憶するための記憶領域が開放されれば、S201により得られた動画データをRAM102に記憶しはじめても良いのである。   Note that the processing from S420 to S440 may be executed in parallel with the processing in S222 and S223, and may further be executed in parallel to the processing from temporary storage S201 to S204 of moving image data by the next shooting. . This is because the moving image data stored in the RAM 102 has already been recorded in the recording medium 151 by the processing of S410, and therefore the area of the RAM 102 for temporarily storing the moving image data is released. If the storage area for temporarily storing the moving image data in the RAM 102 is released, the moving image data obtained in S201 may be stored in the RAM 102.

このように、本実施例の撮像装置100のCPU101は、撮影の指示が入力されると、撮影の指示が入力されるまでに、RAM102に記憶された所定時間分の動画データを記録媒体151に記録するように記録再生部150を制御する(S410)。そして、RAM102に記憶された所定時間分の動画データの記録が開始した後に、CPU101は、記録媒体151に記録された特定の動画ファイルの動画データを解析し、連結位置を特定する(S420)。その後、連結位置に続けて前記所定時間分の動画データが再生されるように前記特定の動画ファイルを編集するようにFATやヘッダを編集している。   As described above, when the imaging instruction is input, the CPU 101 of the imaging apparatus 100 according to the present exemplary embodiment stores the moving image data for the predetermined time stored in the RAM 102 in the recording medium 151 until the imaging instruction is input. The recording / reproducing unit 150 is controlled to record (S410). Then, after the recording of the moving image data for a predetermined time stored in the RAM 102 starts, the CPU 101 analyzes the moving image data of the specific moving image file recorded on the recording medium 151 and specifies the connection position (S420). Thereafter, the FAT and header are edited so that the specific moving image file is edited so that the moving image data for the predetermined time is reproduced following the connection position.

これにより、本実施例の撮像装置は、記録媒体151に記録された既存の動画ファイルの動画データに新規に撮影された動画データを連結する場合。既存動画ファイルの連結位置を解析する前に、RAMに一時的に記憶されている新規動画データを記録媒体に記録するようにし、RAM102の動画データ記憶領域を解放することができるようにしている。そのため、既存動画ファイルの連結位置を特定する前に、RAM102の動画データ記憶領域に、次の動画データを記憶できるようにすることができ、次に動画データを撮影するまでの時間が長くならないようにすることができる。   Thereby, the imaging apparatus of a present Example connects the newly imaged moving image data to the moving image data of the existing moving image file recorded on the recording medium 151. Before analyzing the connection position of the existing moving image file, the new moving image data temporarily stored in the RAM is recorded on the recording medium so that the moving image data storage area of the RAM 102 can be released. Therefore, it is possible to store the next moving image data in the moving image data storage area of the RAM 102 before specifying the connection position of the existing moving image file, so that the time until the next moving image data is shot is not increased. Can be.

次に、記録媒体151に記録される動画ファイルのファイルフォーマットについて説明する。図6は、本実施例の動画のファイルフォーマットを説明するための図である。   Next, the file format of the moving image file recorded on the recording medium 151 will be described. FIG. 6 is a diagram for explaining the file format of the moving image according to the present embodiment.

本実施例において、動画ファイルはMOVフォーマットで記録されている。なおMOVフォーマットでは、ファイルに記録されるデータは「アトム」と呼ばれるデータ構造の内部に記述され、アトムを単位としてファイルに記録される。各アトムはそれぞれ、「Sizeフィールド」、「Typeフィールド」を有する。「Sizeフィールド」は、Sizeフィールドを含む、アトム全体のデータサイズを表す4バイトのフィールドである。「Typeフィールド」は、アトムの種類を表す4バイトのタイプ識別子のフィールドである。なお、各アトムにおいて「Typeフィールド」以降のフィールドはアトムによってはオプションであるため、ここでは説明を省略する。また、アトム内に他のアトムを包含することが可能であり、それにより入れ子構造を実現している。MOVフォーマットで記録された動画ファイルは、図6に示すような構造で各アトムを格納している。   In this embodiment, the moving image file is recorded in the MOV format. In the MOV format, data recorded in a file is described in a data structure called “Atom” and recorded in the file in units of atoms. Each atom has a “Size field” and a “Type field”. The “Size field” is a 4-byte field that represents the data size of the entire atom including the Size field. The “Type field” is a 4-byte type identifier field indicating the kind of atom. In each atom, the fields after the “Type field” are optional depending on the atom, and the description thereof is omitted here. Further, it is possible to include other atoms in the atom, thereby realizing a nested structure. The moving image file recorded in the MOV format stores each atom in a structure as shown in FIG.

図6に示すように、MOVフォーマットの動画ファイルは、以下のアトムを有する。   As shown in FIG. 6, the moving image file in the MOV format has the following atoms.

ファイルの種別を表す、ftyp(ファイルタイプアトム)701。後述のmvhd(ムービーヘッダアトム)706やtrak(トラックアトム)707、708、709などを含む、音声や映像に関する情報を格納した、moov(ムービーアトム)702。音声や映像、テキストなどの実データが格納した、mdat(ムービーデータアトム)703。   Ftyp (file type atom) 701 representing the type of file. A moov (movie atom) 702 that stores information about audio and video, including mvhd (movie header atom) 706 and trak (track atom) 707, 708, 709, which will be described later. Mdat (movie data atom) 703 that stores actual data such as voice, video, and text.

また、moov(ムービーアトム)702には、以下のアトムが格納される。   The moov (movie atom) 702 stores the following atoms.

任意のデータが格納された、udta(ユーザーデータアトム)704。撮像装置100のモデル名や通信部152で受信した撮像装置100の位置情報やUTC時刻などのメタデータが格納された、meta(メタデータアトム)705。動画の作成日時や修正日時、タイムスケール、Duraionなどが格納された、mvhd(ムービーヘッダアトム)706。映像用のtrak(トラックアトム)707。音声用のtrak(トラックアトム)708。テキスト用のtrak(トラックアトム)709。   Udta (user data atom) 704 in which arbitrary data is stored. A meta (metadata atom) 705 in which metadata such as the model name of the image capturing apparatus 100, position information of the image capturing apparatus 100 received by the communication unit 152, and UTC time are stored. An mvhd (movie header atom) 706 that stores the creation date / time, modification date / time, time scale, duration, etc. of the movie. Trak (track atom) 707 for video. An audio trak (track atom) 708. A trak (track atom) 709 for text.

さらに、各trak(トラックアトム)707〜709には、以下のアトムが格納される。   Further, the following atoms are stored in each trak (track atom) 707 to 709.

そのトラックの作成日時やDuration(後述のチャンク内の各サンプルの間の時間的間隔)、そしてIDなどが格納した、tkhd(トラックヘッダアトム)710。なお、本実施例では、映像トラックのIDは1、音声トラックのIDは2、テキストトラックのIDは3、とする。トラック間の参照情報を格納したtref711。本実施例では、映像トラックがテキストトラックをチャプタとして参照するため、映像用のtref711には、テキストトラックのIDである3が記載され、それをチャプタとして参照するため、識別子として‘chap’と記載されている。音声トラックにおいても、も同様である。本実施例では、テキストトラックにはtrefは存在しなくて良い。   A tkhd (track header atom) 710 in which the creation date and time of the track, Duration (time interval between samples in a chunk to be described later), ID, and the like are stored. In this embodiment, the video track ID is 1, the audio track ID is 2, and the text track ID is 3. Tref 711 storing reference information between tracks. In the present embodiment, since the video track refers to the text track as a chapter, the video tref 711 describes 3 as the ID of the text track, and in order to refer to it as a chapter, describes “chap” as an identifier. Has been. The same applies to the audio track. In this embodiment, tref does not have to exist in the text track.

また、各trak(トラックアトム)707〜709には、以下のアトムも格納される。   Further, the following atoms are also stored in each trak (track atom) 707 to 709.

1チャンクがいくつのサンプル(映像の場合はフレーム)数で構成されているかを示すstsc(サンプルチャンクアトム)712。本実施例では全ての映像チャンクが1チャンク=1サンプル(フレーム)から構成されるものとする。   A stsc (sample chunk atom) 712 that indicates how many samples (frames in the case of video) each chunk is composed of. In this embodiment, it is assumed that all video chunks are composed of 1 chunk = 1 sample (frame).

各サンプル間の時間的間隔(Duration)を格納した、stts(同期サンプルアトム)713。なお、映像用のトラックの場合は、1つの動画ファイル内でフレーム間隔が変わらないので、たとえば、30フレーム毎秒であれば、「0.033秒」に対応するデータが記載される。また、テキスト用のトラックの場合は、各チャプタが異なる時間間隔を持つため、先頭から順に、例えば「4秒」、「3秒」、「4秒」、「2秒」と、各チャプタの長さに対応するデータが記載される。1サンプルあたり各サンプルのデータサイズを格納した、stsz(サンプルサイズアトム)714。各チャンクのファイルオフセットを格納したstco(チャンクオフセット)715。   A stts (synchronous sample atom) 713 storing a time interval (Duration) between samples. In the case of a video track, since the frame interval does not change in one moving image file, for example, in the case of 30 frames per second, data corresponding to “0.033 seconds” is described. In the case of a text track, since each chapter has a different time interval, the length of each chapter is, for example, “4 seconds”, “3 seconds”, “4 seconds”, “2 seconds” in order from the top. The corresponding data is described. A stsz (sample size atom) 714 that stores the data size of each sample per sample. Stco (chunk offset) 715 storing the file offset of each chunk.

音声や映像、テキストなどの実データが格納した、mdat(ムービーデータアトム)703には、以下のアトムが格納される。   The following atoms are stored in mdat (movie data atom) 703 in which actual data such as audio, video, and text is stored.

各チャプタのタイトルをテキストデータとして格納したテキストチャンク716、717。テキストチャンク716、717は、最初の領域には、後に続くテキストデータのデータサイズ(16進数)を示すデータが格納される。テキストデータ領域にはテキストデータがASCIIコードで格納される。本実施例では、「ダイジェストムービーモード」において静止画の撮影された撮影時刻をテキストデータとして記載するものとする。すなわち、「ダイジェストムービーモード」で、12時34分56秒に静止画撮影の指示があった場合、記録媒体に記録される動画は、12時34分52秒〜12時34分56秒に対応する動画である。しかし、この動画のチャプタのタイトルとしては、静止画撮影の指示があった12時34分56秒に対応するテキストデータが書き込まれる。   Text chunks 716 and 717 storing the title of each chapter as text data. In the text chunks 716 and 717, data indicating the data size (hexadecimal number) of the text data that follows is stored in the first area. Text data is stored in the text data area in ASCII code. In this embodiment, it is assumed that the shooting time when a still image was shot in the “digest movie mode” is described as text data. In other words, in the “digest movie mode”, when there is an instruction to shoot a still image at 12:34:56, the moving image recorded on the recording medium corresponds to 12:34:52 to 12:34:56. It is a video to be. However, text data corresponding to 12:34:56 when a still image shooting instruction is given is written as the chapter title of this moving image.

また、音声や映像、テキストなどの実データが格納した、mdat(ムービーデータアトム)703には、以下のアトムも格納される。   In addition, the following atoms are also stored in mdat (movie data atom) 703 in which actual data such as voice, video, and text is stored.

音声データチャンク718、719。映像データチャンク720、721、722等。図7において、アルファベットはピクチャの種類を示す。すなわち、フレーム内予測符号化されたIピクチャであるか、前方予測のフレーム間予測符号化されたPピクチャ、双方向予測のフレーム間予測符号化されたBピクチャのいずれかを示す。本実施例では、フレーム内予測符号化されたIピクチャであるためIが付されている。さらに、アルファベットの添え字の数字は先頭からのフレーム番号を表している。つまり、映像データチャンク720は、1番目のフレームがIピクチャ(フレーム内予測符号化ピクチャ)であることを表している。   Audio data chunks 718, 719. Video data chunks 720, 721, 722, etc. In FIG. 7, alphabets indicate the types of pictures. That is, it indicates either an I picture that has been subjected to intraframe prediction encoding, a P picture that has been subjected to interframe prediction encoding for forward prediction, or a B picture that has been subjected to interframe prediction encoding for bidirectional prediction. In the present embodiment, I is added because it is an I picture that has been intra-frame prediction encoded. Further, the alphabetic subscript number represents the frame number from the beginning. That is, the video data chunk 720 indicates that the first frame is an I picture (intra-frame predictive coded picture).

ここで、mdatアトム703のデータの格納状態について説明する。   Here, the data storage state of the mdat atom 703 will be described.

前述したようにmdatアトム703には、テキストチャンク、音声チャンク、映像チャンクが格納されている。なお、本実施例においては、音声チャンク1個と、映像チャンクを15個とを組として格納している。これは、音声データ0.5秒と、映像の15フレームが対応するようにするためにこのように記録している。しかし、格納方法この方式に限られない。さらに、本実施例のようにチャプタごとに、テキストチャンク716、717が格納される。これは、チャプタ1つにつき一つのテキストチャンクが対応する。すなわち、本実施例のように「ダイジェストムービーモード」で撮影を繰り返すと、撮影される度にテキストチャンクがmdatアトムに格納されることになる。テキストチャンクは、チャプタ一つに対応するものとなる。なお、前述したように、テキスト用のtrakアトムのテキスト用のsttsアトムにも、テキストチャンクのサンプルの再生間隔(Duration)が格納されている。   As described above, the mdat atom 703 stores text chunks, audio chunks, and video chunks. In the present embodiment, one audio chunk and 15 video chunks are stored as a set. This is recorded in this way so that 0.5 seconds of audio data corresponds to 15 frames of video. However, the storage method is not limited to this method. Furthermore, text chunks 716 and 717 are stored for each chapter as in this embodiment. This corresponds to one text chunk per chapter. That is, when shooting is repeated in the “digest movie mode” as in this embodiment, a text chunk is stored in the mdat atom every time shooting is performed. A text chunk corresponds to one chapter. As described above, the text chunk sample playback interval (Duration) is also stored in the text stts atom of the text trak atom.

動画ファイルはこのようなフォーマットで記録されている。   Movie files are recorded in this format.

そのため、たとえば、mdat内の任意の映像フレームや音声データ、またはチャプタにアクセスする場合には、moov702のstsz714およびstco715に格納されている情報を用いればよい。   Therefore, for example, when accessing an arbitrary video frame, audio data, or chapter in mdat, information stored in stsz 714 and stco 715 of moov 702 may be used.

ここで、本実施例の撮像装置100の特徴的な動作である、記録媒体151に記録された動画ファイルの指定されたチャプタに対応する動画データを削除する編集処理について説明する。   Here, an editing process for deleting moving image data corresponding to a specified chapter of a moving image file recorded on the recording medium 151, which is a characteristic operation of the imaging apparatus 100 of the present embodiment, will be described.

削除対象のチャプタを選択する方法としては、動画ファイルのmoovアトムのたとえばテキスト用のtrakアトムを解析することで、チャプタの一覧画面を表示して、対象となるチャプタを選択させる方法がある。また、再生モードにおいて表示部140に表示しているフレームの含まれるチャプタを削除対象のチャプタとして選択しても良い。   As a method of selecting a chapter to be deleted, there is a method of displaying a chapter list screen by analyzing a trak atom for text, for example, a moov atom of a moving image file and selecting a target chapter. Further, a chapter including a frame displayed on the display unit 140 in the reproduction mode may be selected as a chapter to be deleted.

本実施例においては、指定されたフレームの属するチャプタの動画データを削除するものとして説明を行う。   In this embodiment, the description will be made assuming that the moving image data of the chapter to which the designated frame belongs is deleted.

図7は、本実施例の編集処理の動作を説明するためのフロー図であって、CPU101がRAM102に展開したプログラムに基づいて、撮像装置100の各部を制御することにより、実行される処理である。また、図8は、動画ファイルの状態を示すものであって、図8(a)が編集前の動画ファイル、図8(b)が編集後の動画ファイルそれぞれの状態を示している。   FIG. 7 is a flowchart for explaining the operation of the editing process according to the present embodiment. The process is executed by the CPU 101 controlling each unit of the imaging apparatus 100 based on the program developed in the RAM 102. is there. FIG. 8 shows the state of the moving image file. FIG. 8A shows the state of the moving image file before editing, and FIG. 8B shows the state of the moving image file after editing.

CPU101は、表示中のフレーム等の指定されたフレームの属するチャプタの動画データを削除する指示が、操作部104より入力されたことに応じて図7のフロー図で示される処理を開始する。   The CPU 101 starts the process shown in the flowchart of FIG. 7 in response to an instruction to delete the moving image data of the chapter to which the specified frame belongs, such as the frame being displayed, from the operation unit 104.

まずCPU101は、指定されたフレームの番号(n)を取得する(S801)。次に、CPU101は、映像用のstts713を解析し、映像サンプルあたりの再生時間(前述のDuraitaion)Dvを取得する(S802)。そして、CPU101は、フレームの番号(n)と、映像サンプルあたりの再生時間Duration(Dv)とから、フレーム番号(n)までの時間(D)を算出する(S803)。   First, the CPU 101 obtains the designated frame number (n) (S801). Next, the CPU 101 analyzes the video stts 713 and obtains the playback time (the aforementioned Duraitaion) Dv per video sample (S802). Then, the CPU 101 calculates the time (D) to the frame number (n) from the frame number (n) and the reproduction time Duration (Dv) per video sample (S803).

次にCPU101は、テキスト用sttsを解析し、動画ファイルの各チャプタに対応する各テキストチャンクの再生時間を取得し(S804)、指定されたフレーム番号(n)のフレームの再生時間(D)と比較する(S805)。   Next, the CPU 101 analyzes the text stts, acquires the playback time of each text chunk corresponding to each chapter of the moving image file (S804), and the playback time (D) of the frame with the designated frame number (n). Compare (S805).

ここで、再生時間(D)が、c−1番目のテキストチャンクの再生時間と、c番目のテキストチャンクの再生時間の間である場合、指定されたフレーム番号(n)のフレームは、c番目のチャプタに属することになる。たとえば、フレーム番号(n)までの時間(D)が19秒であったとする。c−1番目のテキストチャンクの再生時間が18秒である場合、c−1番目のテキストチャンクに対応するチャプタは、18秒までで終了し、その後はc番目のテキストチャンクに対応するチャプタとなる。次にc番目のテキストチャンクの再生時間を加えると22秒になったとすると、フレーム番号(n)までの時間(D)は22秒より小さいので、指定されたフレーム番号(n)のフレームは、c番目のチャプタに属することになる。CPU101は、このように、再生時間(D)が、c−1番目のテキストチャンクの再生時間と、c番目のテキストチャンクの再生時間の間であるかを判定する。この判定により、指定されたフレームの属するチャプタがc番目のチャプタであることを特定する(S806)。   Here, when the playback time (D) is between the playback time of the c-1st text chunk and the playback time of the cth text chunk, the frame of the designated frame number (n) is the cth Belongs to this chapter. For example, it is assumed that the time (D) to frame number (n) is 19 seconds. When the playback time of the c-1st text chunk is 18 seconds, the chapter corresponding to the c-1st text chunk ends up to 18 seconds and thereafter becomes the chapter corresponding to the cth text chunk. . Next, if the playback time of the c-th text chunk is added to be 22 seconds, the time (D) to frame number (n) is smaller than 22 seconds, so the frame of the designated frame number (n) is It belongs to the c-th chapter. In this way, the CPU 101 determines whether or not the reproduction time (D) is between the reproduction time of the c−1th text chunk and the reproduction time of the cth text chunk. This determination specifies that the chapter to which the designated frame belongs is the c-th chapter (S806).

次に、CPU101は、指定されたフレームの属するc番目チャプタの再生時間を、映像サンプルあたりのDuraitaion(Dv)で除算する。これにより、c番目のチャプタの最後のフレーム番号を特定することができる(S807)。   Next, the CPU 101 divides the reproduction time of the c-th chapter to which the designated frame belongs by the Duraitaion (Dv) per video sample. Thereby, the last frame number of the c-th chapter can be specified (S807).

次に、CPU101は、以下の処理によりc番目のチャプタの動画データの動画ファイル上における終端CutoffsetEを特定する(S808)。CPU101は、映像用のstszアトムより、c番目のチャプタの最後のフレームのデータサイズを、そして、映像用のstcoアトムより、c番目のチャプタの最後のフレームのファイルオフセットを取得する。そして、c番目のチャプタの最後のフレームのファイルオフセットにc番目のチャプタの最後のフレームのデータサイズを加算して、c番目のチャプタの最後のフレームのデータ上の終端を算出し、これを終端CutoffsetEとして特定する。   Next, the CPU 101 specifies a terminal CutoffsetE on the moving image file of the moving image data of the c-th chapter by the following process (S808). The CPU 101 obtains the data size of the last frame of the c-th chapter from the video stsz atom and the file offset of the last frame of the c-th chapter from the video stco atom. Then, the end of the data of the last frame of the c-th chapter is calculated by adding the data size of the last frame of the c-th chapter to the file offset of the last frame of the c-th chapter. Specified as CutoffsetE.

次に、CPU101は、以下の処理によりc番目のチャプタの動画データの動画ファイル上における先頭CutoffsetSを特定する(S809)。CPU101は、テキスト用のstcoアトムよりテキストチャンクのファイルオフセットを読み出して、指定されたフレームの属するc番目のチャプタのデータ上の先頭CutoffsetSとして特定する。   Next, the CPU 101 specifies the first CutoffsetS on the moving image file of the moving image data of the c-th chapter by the following processing (S809). The CPU 101 reads the file offset of the text chunk from the text stco atom and specifies it as the first CutoffsetS on the data of the c-th chapter to which the designated frame belongs.

図6で説明したように、mdatアトムには、各チャプタごとにテキストチャンクが生成され、テキストチャンクは、各チャプタに属する音声チャンク、映像チャンクの先頭に配置され、また、音声チャンクは、対応する映像チャンクよりも前に配置される。そのため、S808、S809の処理により、c番目のチャプタの先頭と終端を特定することができる。なお、S808とS809の処理はどちらの処理を先に行っても良い。   As described in FIG. 6, in the mdat atom, a text chunk is generated for each chapter, the text chunk is arranged at the head of the audio chunk and video chunk belonging to each chapter, and the audio chunk corresponds. Arranged before the video chunk. Therefore, the beginning and end of the c-th chapter can be specified by the processing of S808 and S809. Note that either of the processes of S808 and S809 may be performed first.

ここで、図8(a)に示すように動画ファイルが記録されているものとして説明をする。   Here, a description will be given assuming that a moving image file is recorded as shown in FIG.

次に、CPU101は、CutoffsetSをクラスタサイズのサイズで切り上げた計算を行い、クラスタ境界CutoffsetS’を特定する(S811)。また、CPU101は、CutoffsetEをクラスタサイズのサイズで切り下げた計算を行い、クラスタ境界CutoffsetE’を特定する(S812)。   Next, the CPU 101 performs calculation by rounding up CutoffsetS by the size of the cluster size, and specifies the cluster boundary CutoffsetS '(S811). Further, the CPU 101 performs calculation by cutting down CutoffsetE by the size of the cluster size, and specifies the cluster boundary CutoffsetE ′ (S812).

ここで、動画ファイルにおけるc番目のチャプタの動画データの先頭と終端のファイルオフセットがわかると、CPU101は、記録媒体上での動画ファイルにおけるc番目のチャプタの動画データの記録位置が特定する。これは、記録媒体151において、クラスタサイズが所定のサイズに決まっているため、ファイルの先頭から数えて何バイト目が何クラスタ目であるかをCPU101が算出する。そして、S811、S812の処理により、ファイルアロケーションテーブルを解析して、どのクラスタが、c番目のチャプタの動画データの記録先頭クラスタであるか、末尾クラスタであるかを特定する。   Here, when the file offsets at the beginning and the end of the moving image data of the c-th chapter in the moving image file are known, the CPU 101 specifies the recording position of the moving image data of the c-th chapter in the moving image file on the recording medium. This is because the cluster size is determined to be a predetermined size in the recording medium 151, and the CPU 101 calculates how many bytes are counted from the head of the file. Then, through the processing of S811 and S812, the file allocation table is analyzed to identify which cluster is the recording start cluster or the end cluster of the moving image data of the c-th chapter.

図8(a)に示すように、c番目のチャプタのデータは、クラスタ番号8からクラスタ番号11番に記録されている。すなわち、クラスタ境界CutoffsetS’は、c番目のチャプタのデータの先頭クラスタの先頭を示す。また、クラスタ境界CutoffsetE’は、c番目のチャプタのデータの末尾クラスタの先頭を示す。   As shown in FIG. 8A, the data of the c-th chapter is recorded from cluster number 8 to cluster number 11. That is, the cluster boundary CutoffsetS ′ indicates the head of the head cluster of the c-th chapter data. The cluster boundary Cutoffset E ′ indicates the head of the last cluster of the c-th chapter data.

次に、CPU101は、c番目チャプタの直前のチャプタであるc−1番目のチャプタの再生時間を、映像サンプルあたりのDuraitaion(Dv)で除算する。これにより、c−1番目のチャプタの最後のフレーム番号を特定する。そして、S808と同様に、CPU101は、映像用のstszアトムより、c−1番目のチャプタの最後のフレームのデータサイズを、そして、映像用のstcoアトムより、c−1番目のチャプタの最後のフレームのファイルオフセットを取得する。そして、c−1番目のチャプタの最後のフレームのファイルオフセットにc−1番目のチャプタの最後のフレームのデータサイズを加算して、c−1番目のチャプタの最後のフレームのデータ上の終端を算出する。そしてCPU101は、S812と同様にc−1番目のチャプタの最後のフレームのデータ上の終端をクラスタサイズのサイズで切り下げた計算を行い、c−1番目のチャプタの最後のフレームの最終クラスタを特定する(S813)。   Next, the CPU 101 divides the reproduction time of the c-1th chapter, which is the chapter immediately before the cth chapter, by Duraitaion (Dv) per video sample. As a result, the last frame number of the (c-1) th chapter is specified. Similarly to S808, the CPU 101 determines the data size of the last frame of the c-1th chapter from the video stsz atom, and the last data of the c-1 chapter from the video stco atom. Get the file offset of the frame. Then, the data size of the last frame of the c-1th chapter is added to the file offset of the last frame of the c-1th chapter, and the end of the data of the last frame of the c-1th chapter is determined. calculate. Then, the CPU 101 performs calculation by rounding down the end of the data of the last frame of the c-1 chapter by the size of the cluster size in the same manner as in S812, and specifies the final cluster of the last frame of the c-1 chapter. (S813).

図8(a)に示すように、c−1番目のチャプタのデータの最終クラスタは、クラスタ番号5である。   As shown in FIG. 8A, the final cluster of the data of the c-1 th chapter is cluster number 5.

次に、CPU101は、テキスト用のstcoアトムよりテキストチャンクのファイルオフセットを読み出して、c+1番目のチャプタのデータ上の先頭を特定する。そして、S811と同様に、CPU101は、c+1番目のチャプタのデータ上の先頭を、クラスタサイズのサイズで切り上げた計算を行い、c+1番目のチャプタのデータの先頭クラスタを特定する(S814)。   Next, the CPU 101 reads the file offset of the text chunk from the text stco atom, and specifies the top of the data of the c + 1th chapter. Similarly to S811, the CPU 101 performs calculation by rounding up the top of the data of the c + 1th chapter by the size of the cluster size, and specifies the top cluster of the data of the c + 1th chapter (S814).

図8(a)に示すように、c+1番目のチャプタのデータの先頭クラスタはクラスタ番号13である。   As shown in FIG. 8A, the first cluster of the data of the c + 1th chapter is the cluster number 13.

通常の動画ファイルであれば、チャプタ境界の動画データに着目すると、特定のクラスタに2つチャプタに対応する動画データがまたがって記録されていることがほとんどである。そのため、通常の動画ファイルであれば、c番目のチャプタのデータの先頭クラスタと末尾クラスタは、他のデータが記録されている可能性がある。しかし、本実施例の「ダイジェストムービーモード」では、同一クラスタ内に他のチャプタの動画データが含まれないように記録媒体に動画ファイルを記録することができる。そこで、本実施例では、c−1番目のチャプタに対応する動画データの最終クラスタの次に、c+1番目のチャプタの動画データの先頭のクラスタを読むようにファイルアロケーションテーブル(FAT)のクラスタチェーンを書き換える。   In the case of a normal moving image file, focusing on moving image data at chapter boundaries, most moving image data corresponding to two chapters is recorded across a specific cluster. Therefore, if it is a normal moving image file, there is a possibility that other data is recorded in the first cluster and the last cluster of the data of the c-th chapter. However, in the “digest movie mode” of this embodiment, a moving image file can be recorded on a recording medium so that moving image data of other chapters is not included in the same cluster. Therefore, in this embodiment, the cluster chain of the file allocation table (FAT) is read so that the first cluster of the moving image data of the c + 1th chapter is read after the final cluster of the moving image data corresponding to the c-1th chapter. rewrite.

なお、「ダイジェストムービーモード」に限らず、同一クラスタ内に他のチャプタの動画データが含まれないように記録媒体に記録された動画ファイルを編集する場合であれば、本実施例の削除処理を適用することができる。   In addition to the “digest movie mode”, when editing a moving image file recorded on a recording medium so that moving image data of other chapters is not included in the same cluster, the deletion processing of this embodiment is performed. Can be applied.

次に、CPU101は、c番目のチャプタのデータを無効とするために、moovアトム内の映像用、音声用、テキスト用の各trakアトム内のstcoアトム、stszアトム、sttsアトムを書き換える。すなわち、各サンプルのファイルオフセット、各サンプルのデータサイズ、再生時間(Duration)を書き換える(S815)。   Next, in order to invalidate the data of the c-th chapter, the CPU 101 rewrites the stco atom, the stsz atom, and the stts atom in the video, audio, and text trak atoms in the moov atom. That is, the file offset of each sample, the data size of each sample, and the reproduction time (Duration) are rewritten (S815).

次にCPU101は、動画ファイルのファイルアロケーションテーブル(FAT)を書き換える(S816)。すなわち、図8(b)に示すように、c番目のチャプタの先頭クラスタから最終クラスタについては、空きクラスタを示す「0」を書き込む。そして、c−1番目のチャプタに対応する動画データの最終クラスタの次にc+1番目のチャプタに対応する動画データの先頭のクラスタを読むようにファイルアロケーションテーブル(FAT)のクラスタチェーンを書き換える。また、削除を行った動画ファイルを示すディレクトリエントリのデータサイズや作成日時等の情報も書き換える。   Next, the CPU 101 rewrites the file allocation table (FAT) of the moving image file (S816). That is, as shown in FIG. 8B, “0” indicating an empty cluster is written from the first cluster to the last cluster of the c-th chapter. Then, the cluster chain of the file allocation table (FAT) is rewritten so that the first cluster of the moving image data corresponding to the c + 1 th chapter is read after the final cluster of the moving image data corresponding to the c−1 th chapter. Also, information such as the data size and creation date and time of the directory entry indicating the deleted moving image file is rewritten.

このように、S815の処理により、c番目のチャプタの動画データを無効とすると共に、S816の処理により動画ファイルのc番目のチャプタの動画データの削除によるファイルサイズの削減を行う。   As described above, the moving image data of the c-th chapter is invalidated by the processing of S815, and the file size is reduced by deleting the moving image data of the c-th chapter of the moving image file by the processing of S816.

本実施例の撮像装置100は、このような方法で、動画ファイルの所定のチャプタに属する動画データを削除するため、動画のデコード、再エンコード処理を実行することなく、動画の編集を実行することができる。そのため、動画編集処理を高速に行うことができる。   In this way, the imaging apparatus 100 according to the present embodiment performs editing of a moving image without performing decoding and re-encoding processing of the moving image in order to delete moving image data belonging to a predetermined chapter of the moving image file. Can do. Therefore, the moving image editing process can be performed at high speed.

なお、本実施例では、「ダイジェストムービーモード」のように、同一クラスタ内に他のチャプタの動画データが含まれないように記録媒体に動画ファイルが記録されている場合について説明した。しかし、通常の動画データのように、同一クラスタ内に他のチャプタの動画データが含まれる動画ファイルを編集する場合には、以下のように処理を行う。すなわち、c番目のチャプタのデータの先頭クラスタの次に終端クラスタを読むように、ファイルアロケーションテーブル(FAT)のクラスタチェーンを書き換えるようにする。   In the present embodiment, a case has been described in which a moving image file is recorded on a recording medium so that moving image data of other chapters is not included in the same cluster as in the “digest movie mode”. However, when editing a moving image file in which moving image data of another chapter is included in the same cluster as normal moving image data, the following processing is performed. That is, the cluster chain of the file allocation table (FAT) is rewritten so that the terminal cluster is read after the head cluster of the data of the c-th chapter.

本実施例では、撮像装置100を例にとって説明した。しかし、本実施例の削除処理を実行することができるものであれば、本発明を適用することができる。例えば、コンピュータ、タブレット型端末、スマートフォン、携帯電話、テレビ、等であっても良い。また、本実施例の削除処理をコンピュータに実行させる為のプログラムも本発明のしそうに含まれる。   In this embodiment, the imaging apparatus 100 has been described as an example. However, the present invention can be applied as long as the deletion process of this embodiment can be executed. For example, it may be a computer, a tablet terminal, a smartphone, a mobile phone, a television, or the like. Further, a program for causing a computer to execute the deletion process of this embodiment is also included in the present invention.

なお、本実施例の撮像装置100は、基本的に、既存動画ファイルの動画データに対して、新規動画データを追記するものとするが、以下のような条件を満たす場合には、追記しないようにしている。
・追記対象の既存動画ファイルがプロテクトされている場合
記録媒体151に記録されている特定の動画ファイル「MDG_000X.MOV」がプロテクトされている場合には、ユーザがファイルの改変を望まないファイルである可能性が高いので、追記不可能とする。
・追記撮影によりファイルサイズが所定のサイズを超える場合
記録媒体151は、前述したようにたとえばFATファイルシステムで管理されている。その場合、たとえば、FAT32では、1ファイルあたり4GB以上になると読み込めなくなってしまう。そのため、次の撮影により「追記動画ファイル」が4GBを超える場合には、追記不可能とする。
・追記対象の既存動画ファルの動画のGOP構造に異常がある場合
記録媒体151に記録されている追記対象である特定の動画ファイル「MDG_000X.MOV」のチェックの結果、GOP構造に異常がある場合には、追記する動画データにまで影響が出てしまう可能性があるので、追記不可能とする。
・追記対象のファイルが無い場合
ダイジェストムービーモードで撮影された動画には、ファイル名として、「MDG_000X.MOV」という、MDGという識別子と通し番号4桁が付加されるようになっている。しかし、ファイル名に「MDG」を含む識別子の動画がない場合には、ダイジェストムービーモードで撮影された動画ファイルが存在しないので、追記不可能とする。また、撮像装置100の不図示の不揮発性メモリに最後にダイジェストムービーモードで記録した動画ファイルのファイル名を記録させておき、そのファイルが存在しない場合にも、追記不可能とする。
・追記対象の動画ファイルの撮影日が撮像装置に設定された日と異なる場合
ダイジェストムービーモードで同一撮影日に撮影された動画データを順次追記する場合には、日付の変更に伴って、別の動画ファイルを記録することになるので、追記不可能とする。
・追記対象の動画ファイルに関連づけられた地域設定が撮像装置に設定された地域と異なる場合
ダイジェストムービーモードで同一地域で撮影された動画データを順次追記する場合には、地域の変更に伴って、別の動画ファイルを記録することになるので、追記不可能とする。たとえば地域情報は、GPSユニットを用いて、得られた位置情報を用いても良いし、撮像装置の時計の設定時に選択する、「国」の情報を用いても良い。
・追記対象の動画ファイルに関連づけられた撮像装置の情報が、新規動画データを撮影する撮像装置と異なる場合
同一の撮像装置で、ダイジェストムービーモードで撮影された動画データのみを追記する場合には、記録媒体に記録された追記対象の動画ファイルに関連づけられた撮像装置の識別情報が、撮影を行う撮像装置と一致するかを確認する。そして、異なる場合には追記不可とする。
Note that the imaging apparatus 100 according to the present embodiment basically adds new moving image data to the moving image data of the existing moving image file. I have to.
When an existing moving image file to be added is protected When a specific moving image file “MDG — 000X.MOV” recorded on the recording medium 151 is protected, the user does not want to modify the file. Since there is a high possibility, appending is impossible.
When the file size exceeds a predetermined size due to additional recording The recording medium 151 is managed by, for example, the FAT file system as described above. In that case, for example, in FAT32, when it becomes 4 GB or more per file, it cannot be read. For this reason, if the “additional video file” exceeds 4 GB in the next shooting, the additional recording is impossible.
・ When there is an abnormality in the GOP structure of the moving image of the existing video file to be additionally recorded When there is an abnormality in the GOP structure as a result of checking the specific moving image file “MDG — 000X.MOV” to be added to the recording medium Since there is a possibility that moving image data to be additionally recorded may be affected, it is assumed that additional recording is impossible.
When there is no file to be additionally recorded A moving image shot in the digest movie mode is added with an MDG identifier “MDG — 000X.MOV” and a 4-digit serial number as a file name. However, if there is no moving image with an identifier including “MDG” in the file name, there is no moving image file shot in the digest movie mode, so that additional writing is impossible. Further, the file name of the moving image file recorded last in the digest movie mode is recorded in the non-illustrated non-volatile memory of the imaging apparatus 100, and additional recording is impossible even if the file does not exist.
・ When the shooting date of the movie file to be added is different from the date set on the imaging device When adding movie data shot on the same shooting date sequentially in digest movie mode, a different date will be added as the date changes. Since a moving image file is recorded, it is impossible to append.
・ When the region setting associated with the video file to be added is different from the region set in the imaging device When adding video data shot in the same region in digest movie mode sequentially, Since another video file is to be recorded, it is not possible to append. For example, the location information obtained using the GPS unit may be used as the area information, or “country” information selected when setting the clock of the imaging apparatus may be used.
・ When the information of the imaging device associated with the video file to be added is different from the imaging device that captures the new video data When adding only the video data shot in the digest movie mode with the same imaging device, It is confirmed whether the identification information of the imaging device associated with the moving image file to be added recorded on the recording medium matches the imaging device that performs shooting. If they are different, additional writing is impossible.

・動画記録設定が追記元の既存動画ファイルと同一でない場合
本実施例のように、既存動画ファイルに新規動画データを追記する場合には、動画の途中で、フレームレートや画像サイズ、GOP構成、動画符号化方式が変更されてしまうと、シームレスに再生できなくなってしまう可能性がある。そのため、既存動画ファイルの動画データと、新規動画データの動画記録設定が同一でない場合には、追記不可能とする。フレームレートや画像サイズ、GOP構成、動画符号化方式等の情報は、既存動画ファイルのファイルヘッダ等に記録されている。
・音声記録設定が追記元の既存動画ファイルと同一でない場合
本実施例のように、既存動画ファイルに新規動画データを追記する場合には、動画の途中で、音声のサンプリングレート、チャンネル数、ビット深度や、音声符号化方式等が変更されてしまうと、再生できなくなってしまう可能性がある。そのため、既存動画ファイルの動画データと、新規動画データファイルの音声記録設定が同一でない場合には、追記不可能とする。音声のサンプリングレートや、音声符号化方式等の情報は、既存動画ファイルのファイルヘッダ等に記録されている。
・記録媒体151の挿抜履歴がある場合
撮像装置100の起動時に、CPU101は、最後に連続動画撮影モードにおいて撮影した後に、記録媒体151が挿抜された履歴が、不図示の不揮発性メモリに残っている場合には、追記不可能とする。これは、記録媒体151に記録されている「MDG_000X.MOV」がコンピュータなどにより編集されてしまい、画像サイズなどが変更され、追記により動画ファイル自体が壊れたりする可能性を低減するためである。そのためには、追記対象の「MDG_000X.MOV」のファイルヘッダに記録されている撮影日時情報と、不揮発性メモリに残っている挿抜履歴の時間情報とを比較する。追記動画ファイル「MDG_000X.MOV」は、その動画に記録されている複数のシーンの動画データのうち、最初に撮影された時間情報をファイルヘッダに記録されるようになっている。
・追記撮影により動画再生時間が所定時間を超える場合
撮像装置100においては、所定時間(たとえば、30分)を超える撮影を望まない場合を考慮し、連続動画撮影モードにおいて、新たな撮影をすることにより、「追記動画ファイル」の動画データの再生時間が30分を超える場合には、追記不可能とする。そのためには、たとえば、ファイルヘッダに記載されている「追記動画ファイル」の再生時間を読み出して、29分58秒等であれば、追記不可能とするのである。
・追記元の動画ファイルの記録されているフォルダ内のファイル数が所定数以上になる場合
撮像装置100においては、静止画ファイルや動画ファイルを記録媒体151に記録するファイル数をDCFという規格に基づいて記録している。このDCF規格では、1つのフォルダ内に最大9999個のファイルを記録可能としているが、本実施例のように撮影を行った際に、静止画ファイルが新たに生成されるため、静止画ファイルが追記元の動画ファイルの格納されているフォルダに記録できないことがある。その場合には、関連する静止画ファイルと、追記元の動画ファイルとが異なるフォルダに格納されてしまい、ユーザが後で閲覧するときに見づらくなってしまう。そこで、このような場合には、追記をせずに、動画を新規なファイルとして記録し、なおかつ新しいフォルダに格納するものとする。ここでは9999個のファイルを上限として説明したが、999個でも良いし、900個でも良いし、100個でも良い。
-When the video recording settings are not the same as the existing video file of the append source When adding new video data to the existing video file as in this embodiment, the frame rate, image size, GOP configuration, If the moving image encoding method is changed, there is a possibility that seamless playback cannot be performed. For this reason, when the moving image data of the existing moving image file and the moving image recording setting of the new moving image data are not the same, additional recording is impossible. Information such as a frame rate, an image size, a GOP configuration, and a moving image encoding method is recorded in a file header of an existing moving image file.
-When the audio recording settings are not the same as the existing video file of the append source When adding new video data to the existing video file as in this example, the audio sampling rate, number of channels, bit If the depth, the audio encoding method, or the like is changed, there is a possibility that playback cannot be performed. Therefore, when the moving image data of the existing moving image file and the audio recording setting of the new moving image data file are not the same, additional recording is impossible. Information such as an audio sampling rate and audio encoding method is recorded in a file header of an existing moving image file.
When there is an insertion / extraction history of the recording medium 151 When the imaging apparatus 100 is activated, the CPU 101 records the history of the insertion / extraction of the recording medium 151 in the non-illustrated non-volatile memory after the last shooting in the continuous movie shooting mode. If it is, appending is impossible. This is to reduce the possibility that “MDG — 000X.MOV” recorded on the recording medium 151 is edited by a computer or the like, the image size or the like is changed, and the moving image file itself is broken due to additional writing. For this purpose, the shooting date / time information recorded in the file header of “MDG — 000X.MOV” to be added is compared with the time information of the insertion / removal history remaining in the nonvolatile memory. In the additional recording moving image file “MDG — 000X.MOV”, time information first captured among moving image data of a plurality of scenes recorded in the moving image is recorded in a file header.
When the moving image playback time exceeds a predetermined time due to additional recording, the imaging apparatus 100 takes a new shooting in the continuous moving image shooting mode in consideration of the case where shooting exceeding a predetermined time (for example, 30 minutes) is not desired. Thus, when the reproduction time of the moving image data of the “additional recording moving image file” exceeds 30 minutes, the additional recording is impossible. For this purpose, for example, the playback time of the “additional video file” described in the file header is read out, and if it is 29 minutes 58 seconds or the like, additional recording is impossible.
-When the number of files in the folder in which the moving image file of the additional recording is recorded exceeds a predetermined number In the imaging apparatus 100, the number of files for recording still image files or moving image files on the recording medium 151 is based on a standard called DCF. Is recorded. In this DCF standard, a maximum of 9999 files can be recorded in one folder. However, since a still image file is newly generated when shooting is performed as in the present embodiment, Recording may not be possible in the folder in which the original video file is stored. In that case, the related still image file and the moving image file that is the additional recording source are stored in different folders, which makes it difficult for the user to view later. Therefore, in such a case, it is assumed that the moving image is recorded as a new file without additional writing and stored in a new folder. Here, 999 files are described as the upper limit, but 999 files, 900 files, 100 files, or 100 files may be used.

また、記録媒体151もしくは既存動画ファイルが壊れているなどの原因により、正常にチェックすることができなかった場合も、追記不可と判定する。   Further, even when the recording medium 151 or the existing moving image file cannot be normally checked due to a cause such as corruption, it is determined that additional writing is impossible.

本実施例では、撮像装置について説明した。撮像装置としては、一般的なコンパクトデジタルカメラ、デジタル一眼カメラ、ビデオカメラ、携帯電話が含まれる。また、本発明の技術を適用可能な装置は、撮像装置に限らず、たとえば、カメラを接続したパーソナルコンピュータであっても良い。   In this embodiment, the imaging apparatus has been described. Examples of the imaging device include a general compact digital camera, a digital single-lens camera, a video camera, and a mobile phone. An apparatus to which the technology of the present invention can be applied is not limited to an imaging apparatus, and may be, for example, a personal computer connected with a camera.

(他の実施形態)
上述の実施形態は、システム或は装置のコンピュータ(或いはCPU、MPU等)によりソフトウェア的に実現することも可能である。従って、上述の実施形態をコンピュータで実現するために、該コンピュータに供給されるコンピュータプログラム自体も本発明を実現するものである。つまり、上述の実施形態の機能を実現するためのコンピュータプログラム自体も本発明の一つである。
(Other embodiments)
The above-described embodiment can also be realized in software by a computer of a system or apparatus (or CPU, MPU, etc.). Therefore, the computer program itself supplied to the computer in order to implement the above-described embodiment by the computer also realizes the present invention. That is, the computer program itself for realizing the functions of the above-described embodiments is also one aspect of the present invention.

なお、上述の実施形態を実現するためのコンピュータプログラムは、コンピュータで読み取り可能であれば、どのような形態であってもよい。例えば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等で構成することができるが、これらに限るものではない。上述の実施形態を実現するためのコンピュータプログラムは、記憶媒体又は有線/無線通信によりコンピュータに供給される。プログラムを供給するための記憶媒体としては、例えば、フレキシブルディスク、ハードディスク、磁気テープ等の磁気記憶媒体、MO、CD、DVD等の光/光磁気記憶媒体、不揮発性の半導体メモリなどがある。   The computer program for realizing the above-described embodiment may be in any form as long as it can be read by a computer. For example, it can be composed of object code, a program executed by an interpreter, script data supplied to the OS, but is not limited thereto. A computer program for realizing the above-described embodiment is supplied to a computer via a storage medium or wired / wireless communication. Examples of the storage medium for supplying the program include a magnetic storage medium such as a flexible disk, a hard disk, and a magnetic tape, an optical / magneto-optical storage medium such as an MO, CD, and DVD, and a nonvolatile semiconductor memory.

有線/無線通信を用いたコンピュータプログラムの供給方法としては、コンピュータネットワーク上のサーバを利用する方法がある。この場合、本発明を形成するコンピュータプログラムとなりうるデータファイル(プログラムファイル)をサーバに記憶しておく。プログラムファイルとしては、実行形式のものであっても、ソースコードであっても良い。そして、このサーバにアクセスしたクライアントコンピュータに、プログラムファイルをダウンロードすることによって供給する。この場合、プログラムファイルを複数のセグメントファイルに分割し、セグメントファイルを異なるサーバに分散して配置することも可能である。つまり、上述の実施形態を実現するためのプログラムファイルをクライアントコンピュータに提供するサーバ装置も本発明の一つである。   As a computer program supply method using wired / wireless communication, there is a method of using a server on a computer network. In this case, a data file (program file) that can be a computer program forming the present invention is stored in the server. The program file may be an executable format or a source code. Then, the program file is supplied by downloading to a client computer that has accessed the server. In this case, the program file can be divided into a plurality of segment files, and the segment files can be distributed and arranged on different servers. That is, a server apparatus that provides a client computer with a program file for realizing the above-described embodiment is also one aspect of the present invention.

また、上述の実施形態を実現するためのコンピュータプログラムを暗号化して格納した記憶媒体を配布し、所定の条件を満たしたユーザに、暗号化を解く鍵情報を供給し、ユーザの有するコンピュータへのインストールを許可してもよい。鍵情報は、例えばインターネットを介してホームページからダウンロードさせることによって供給することができる。また、上述の実施形態を実現するためのコンピュータプログラムは、すでにコンピュータ上で稼働するOSの機能を利用するものであってもよい。さらに、上述の実施形態を実現するためのコンピュータプログラムは、その一部をコンピュータに装着される拡張ボード等のファームウェアで構成してもよいし、拡張ボード等が備えるCPUで実行するようにしてもよい。   In addition, a storage medium in which the computer program for realizing the above-described embodiment is encrypted and distributed is distributed, and key information for decrypting is supplied to a user who satisfies a predetermined condition, and the user's computer Installation may be allowed. The key information can be supplied by being downloaded from a homepage via the Internet, for example. Further, the computer program for realizing the above-described embodiment may use an OS function already running on the computer. Further, a part of the computer program for realizing the above-described embodiment may be configured by firmware such as an expansion board attached to the computer, or may be executed by a CPU provided in the expansion board. Good.

Claims (9)

ファイルアロケーションテーブルを使用してファイルを管理するファイルフォーマットで記録媒体に記録された動画ファイルを再生する再生手段と、
前記再生手段によって再生された動画ファイルの削除対象のチャプタに属する動画データを削除する編集を行う編集手段とを有し、
前記編集手段は、前記削除対象のチャプタに対応する動画データの記録媒体上での記録位置を特定し、前記所定のチャプタに対応する動画データの少なくとも一部を読まないようにファイルアロケーションテーブルを編集することを特徴とする画像処理装置。
Playback means for playing back a video file recorded on a recording medium in a file format for managing the file using a file allocation table;
Editing means for performing editing to delete the moving picture data belonging to the chapter to be deleted of the moving picture file reproduced by the reproducing means,
The editing means identifies a recording position on the recording medium of the moving image data corresponding to the chapter to be deleted, and edits the file allocation table so that at least a part of the moving image data corresponding to the predetermined chapter is not read. An image processing apparatus.
前記編集手段は、前記削除対象のチャプタに属する動画データの記録媒体上での記録されているクラスタを、前記記録媒体のクラスタサイズに基づいて特定することを特徴とする請求項1記載の画像処理装置。   2. The image processing according to claim 1, wherein the editing unit specifies a cluster in which moving image data belonging to the chapter to be deleted is recorded on a recording medium based on a cluster size of the recording medium. apparatus. 前記編集手段は、前記削除対象のチャプタに属する動画データの記録媒体上での記録されているクラスタを読まないようにファイルアロケーションテーブルを編集することを特徴とする請求項2記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the editing unit edits the file allocation table so as not to read a cluster recorded on a recording medium of moving image data belonging to the chapter to be deleted. 前記編集手段は、前記削除対象のチャプタに属する動画データの記録媒体上での記録位置を、前記動画ファイルのヘッダに記載された情報に基づいて、特定することを特徴とする請求項1から3のいずれか1項に記載の画像処理装置。   The editing means identifies a recording position on a recording medium of moving image data belonging to the chapter to be deleted based on information described in a header of the moving image file. The image processing apparatus according to any one of the above. ファイルアロケーションテーブルを使用してファイルを管理するファイルフォーマットで記録媒体に記録された動画ファイルを再生する再生手段を有する画像処理装置の制御方法であって、
前記再生手段によって再生された動画ファイルの削除対象のチャプタに属する動画データを削除する場合に、前記削除対象のチャプタに対応する動画データの記録媒体上での記録位置を特定し、前記所定のチャプタに対応する動画データの少なくとも一部を読まないようにファイルアロケーションテーブルを編集することを特徴とする画像処理装置の制御方法。
A control method for an image processing apparatus having a playback means for playing back a moving image file recorded on a recording medium in a file format for managing the file using a file allocation table,
When deleting moving image data belonging to the deletion target chapter of the moving image file reproduced by the reproducing means, the recording position of the moving image data corresponding to the deletion target chapter on the recording medium is specified, and the predetermined chapter A method of controlling an image processing apparatus, wherein a file allocation table is edited so as not to read at least a part of moving image data corresponding to.
前記削除対象のチャプタに属する動画データの記録媒体上での記録されているクラスタを、前記記録媒体のクラスタサイズに基づいて特定することを特徴とする請求項5記載の画像処理装置の制御方法。   6. The control method for an image processing apparatus according to claim 5, wherein a cluster recorded on a recording medium of moving image data belonging to the chapter to be deleted is specified based on a cluster size of the recording medium. 前記削除対象のチャプタに属する動画データの記録媒体上での記録されているクラスタを読まないようにファイルアロケーションテーブルを編集することを特徴とする請求項6記載の画像処理装置の制御方法。   7. The method of controlling an image processing apparatus according to claim 6, wherein a file allocation table is edited so as not to read a cluster recorded on a recording medium of moving image data belonging to the chapter to be deleted. 前記削除対象のチャプタに属する動画データの記録媒体上での記録位置を、前記動画ファイルのヘッダに記載された情報に基づいて、特定することを特徴とする請求項4から7のいずれか1項に記載の画像処理装置の制御方法。   8. The recording position on a recording medium of moving image data belonging to the chapter to be deleted is specified based on information described in a header of the moving image file. A control method for the image processing apparatus according to claim 1. 請求項1から8のいずれか1項に記載の画像処理装置の各手段としてコンピュータを機能させるプログラム。   A program that causes a computer to function as each unit of the image processing apparatus according to claim 1.
JP2012222905A 2012-10-05 2012-10-05 Image processing apparatus and image processing apparatus control method Active JP6071399B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012222905A JP6071399B2 (en) 2012-10-05 2012-10-05 Image processing apparatus and image processing apparatus control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012222905A JP6071399B2 (en) 2012-10-05 2012-10-05 Image processing apparatus and image processing apparatus control method

Publications (3)

Publication Number Publication Date
JP2014075730A true JP2014075730A (en) 2014-04-24
JP2014075730A5 JP2014075730A5 (en) 2015-11-19
JP6071399B2 JP6071399B2 (en) 2017-02-01

Family

ID=50749597

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012222905A Active JP6071399B2 (en) 2012-10-05 2012-10-05 Image processing apparatus and image processing apparatus control method

Country Status (1)

Country Link
JP (1) JP6071399B2 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000285653A (en) * 1999-03-29 2000-10-13 Sony Corp Information recording and reproducing device
JP2000298611A (en) * 1999-02-12 2000-10-24 Sony Corp Compiling device, compiling method and recording medium
JP2003052006A (en) * 2001-08-06 2003-02-21 Matsushita Electric Ind Co Ltd Information editing controller and method therefor, and disk device
JP2006060675A (en) * 2004-08-23 2006-03-02 Canon Inc Recording device
JP2012156587A (en) * 2011-01-21 2012-08-16 Canon Inc Video recording device
JP2012178814A (en) * 2011-02-02 2012-09-13 Canon Inc Moving image recording apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000298611A (en) * 1999-02-12 2000-10-24 Sony Corp Compiling device, compiling method and recording medium
JP2000285653A (en) * 1999-03-29 2000-10-13 Sony Corp Information recording and reproducing device
JP2003052006A (en) * 2001-08-06 2003-02-21 Matsushita Electric Ind Co Ltd Information editing controller and method therefor, and disk device
JP2006060675A (en) * 2004-08-23 2006-03-02 Canon Inc Recording device
JP2012156587A (en) * 2011-01-21 2012-08-16 Canon Inc Video recording device
JP2012178814A (en) * 2011-02-02 2012-09-13 Canon Inc Moving image recording apparatus

Also Published As

Publication number Publication date
JP6071399B2 (en) 2017-02-01

Similar Documents

Publication Publication Date Title
US9124860B2 (en) Storing a video summary as metadata
US8432965B2 (en) Efficient method for assembling key video snippets to form a video summary
US20110292245A1 (en) Video capture system producing a video summary
JP5783737B2 (en) Image pickup apparatus and moving image recording apparatus control method
JP2012161012A (en) Moving picture recorder
US9565360B2 (en) Image data recording apparatus capable of recording still and moving images simultaneously
JP5818599B2 (en) Movie recording device
JP2012156587A (en) Video recording device
JP5773855B2 (en) Image processing device
JP5769434B2 (en) Movie recording device, information processing device
JP5713701B2 (en) Movie recording device
JP6071358B2 (en) Image processing apparatus, image processing method, and program
JP6410483B2 (en) Image processing device
JP6071399B2 (en) Image processing apparatus and image processing apparatus control method
JP6049369B2 (en) Image processing apparatus and image processing apparatus control method
JP6071357B2 (en) Image processing apparatus, image processing method, and program
JP5889459B2 (en) Recording device
JP6218489B2 (en) Image processing device
JP2019075629A (en) Image processing system
JP2015035752A (en) Image processing device

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151005

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151005

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160908

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160913

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20161108

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: 20161206

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161227

R151 Written notification of patent or utility model registration

Ref document number: 6071399

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151