• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

VAHF-master-access-recipe-steps

Page history last edited by janezhao@rice.edu 4 years, 9 months ago


 

Part I: VAHF master copy creation

 

Source file format

Is file wrapper changed?

Is video transcoded?

Is audio transcoded?

Master file format

Note

MPG

No

No

No

MPG

The original source file is used as the master.

MP4

No

No

No

MP4

The original source file is used as the master

MTS

Yes

No

Yes

Mov

Mov with original video codec of H264 and aac for audio codec

 

  • ffmbc command for creating master files from source MTS files: ffmbc -y -i /Volumes/Final/VAHF-in-progress/ vahf500houston_interviews/wrc02765/wrc02765_001intro.mts -vcodec copy -acodec libfaac -ar 48000 -ab 384k -vol 1024  /Volumes/scratch-space/jz-mts-mov-master-testing/wrc02765_001intro.mov 

 

  • Note

    • With this command/formula, the video codec is straightly copied, the audio codec is changed from ac3, which is a proprietary codec, to aac while keeping the same sample rate and bit rate, but audio volume is increased 1024. In a nut shell, the master files can be described as the following: Mov+H264+AAC+volume up 1024 (note: the normal default value is 256).

    • Parameters

      • – y: yes to override any existing file with the same name in the output directory

      • -i: input file

      • -vcodec copy: copy the video codec from the input file

      • -acodec libfaac: use libfaac for audio codec

      • -ar 48,000: audio sampling rate 48,000 Hz

      • -ab 384k: audio bit rate 384Kbps

      • -vol 1024: audio volume is increased to 1,024.

    • Since ffmpeg’s library doesn’t include libfaac and our staff, both Arnold and Jane, don’t know whether it is possible to make a customized ffmpeg build including libfaac. So we chose to use ffmbc, which is a pre-built customized ffmpeg for professional usage and contains libfaac.

    • Master wrapper decision: None of the following common video editing applications or media players plays MTS files: FCP 6, FCP X, Quicktime player, MPEG Streamclip. We have found VLC plays MTS files though. The VAHF team has decided not to support MTS file in a long run based on MTS’s incompatibility. That means no MTS files will be kept. Since the DMC is pretty much an Apple based lab, the team chose to support MOV instead of AVI.

    • Master audio codec decision: The original MTS file has ac3 audio codec, which is a lossy, proprietary compressed audio codec owned by Dolby. PCM16 (i.e. pulse code module), uncompressed audio codec, is an option for the master file’s audio codec. However, converting a compressed audio codec to an uncompressed audio codec adds file size without gaining any quality. AAC (i.e. advanced audio codec, designed to be the successor of the MP3 format, achieves better quality than MP3 at a similar bit rates) is a lossy format. However, it has been widely used and can be played on a range of devices including Apple and non-Apple devices. The VAHF team has decided to use AAC codec over PCM16.

    • Master video codec decision: the original MTS file has H264 video codec, which is very popular and widely used. The VAHF team has decided to support this video codec in a long run.

    •  Note updated on September 28, 2017 

 

Per Final Cut Pro X release notes at https://support.apple.com/en-us/HT201237, starting  Final Cut Pro X version 10.1, it does a "Native support for .MTS and .MT2S files from AVCHD". That means camera recordings in AVCHD format will be able to directly imported to FCP X. After testing, the "Native support for .MTS" means that during the importing process, the video codec is preserved, however, the audio codec is changed from AC3 to Linear PCM 16bits, and the file wrapper is changed from .MTS to .MOV. The DMC camcorders such as Sony HXR-NX3/1 NXCAM or Canon XA10/R700 all record AVCHD ( Advanced Video Codec High Definition) videos. While the file size has remained almost the same during the importing process, no change. 

 

  wrapper/file extension  video codec  audio codec  file size (a 00:38:39:29 video)
source on the memory card   .MTS   H.264   AC3  6.45 GB
after importing to FCP X 10.1.3-10.3.4   .MOV   H.264   Linear PCM 16 bit 6.53 GB

 

 

Part II: VAHF access copy creation

HandBrake - Version 0.9.8 x86_64 (2012071800)

 

 

1). Source files: MTS and MP4

Note: There is only 1 original MP4 file in the whole collection. A sample MTS file: 21minute video – about 65MB

 

Recipe – h264 for video codec; frame size: 480x272; frame rate: 15 fps; 2 pass encoding, aac for audio codec (libfaac); stereo; 24000khz, 128kb. File format: mp4. 

Preset name within HandBrake on MovingImagesStation – “Latest - VAHF - access copy - mp4- libfaac”

 

  1. Video settings

  1. Audio Settings

  2. Picture Settings - Size

    1. Anamorphic – Custom; Keep Aspect Ratio – checked
      Note: This is the exact settings we use to generate all the access mp4 files for the source MTS files.

      Note: Keep Aspect Ratio is only available to check when Anamorphic is chosen as None or custom. When Anamorphic is chosen as strict or loose, Keep Aspect Ratio is grayed out.

      1. Source MTS video stream described by ffmpeg: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps

      2. Access MP4 video stream described by ffmpeg: Video: h264 (avc1/0x31637661), yuv420p, 480x272 [SAR 1:1 DAR 30:17]. 277 kb/s, 15 fps
        Note: SAR is the same as the source, but the DAR is slightly different with 30/17=1.76 and 16/9=1.78. (SAR – sample/pixel aspect ratio, DAR – Display aspect ratio.) 

    1. A possible future alternative to the above 3.a. settings is Anamorphic – Loose. This alternative solution won’t apply for MPG files though. So in the future, MTS and MPG files have to use different Presets due to their different PAR or SAR (MTS: 1:1, MPG 32:27) although their DAR (i.e. 16:9) is the same.

      1. Access MP4 described by ffmpeg if using Anamorphic-Loose: Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 480x272 [SAR 136:135 DAR 16:9], 285 kb/s, 15 fps
        Note here: SAR is slightly different than the source, but the DAR is the same.

 

4. Picture Settings – Filters

5. Advanced Settings

 

 

2). Source files: MPG 
 

Recipe – h264 for video codec; frame size: 416x272 (with display size 480x272); frame rate: 15 fps; 2 pass encoding, aac for audio codec (libfaac); stereo; 24000khz, 128kb. File format: mp4. 

Preset name within HandBrake on MovingImagesStation– “Latest - VAHF – mpg access copy - mp4- libfaac”

All the settings are the same but Picture Settings – Size in the above step 3.

 

3. Picture Settings – Size

  • Source MPG file described by ffmpeg: Video: mpeg2video, 720x480 [SAR 32:27 DAR 16:9], 90000 kb/s, 29.97 fps

  • Access MP4 file described by ffmpeg: Video: h264, 416x272 [SAR: 136:117 DAR 16:9], 279 kb/s, 15fps.

  • Note about the above formula: QuickTime player displays letter boxing (i.e. black bars on the top and at the bottom)when playing the mp4s and the source MPG files. VLC displays letter boxing for the source MPG files, and letting boxing and pillar boxing (i.e. black bars on the left and right side) for the access mp4s. JWPlayer on the server has lettering boxing and pillar boxing for the access mp4s, however, the video aspect ratio looks correct.

 

 

 

3). Additional testing

 

anamorphic– none, keep aspect ratio checked/unchecked (whether checked or unchecked), width 480, height 272, QuickTime player will letter box the MP4, whereas the VLC will have letter box and pillar box. JWPlayer displays letter boxing for the mp4s on the production server and the video aspect ratio doesn’t look correct (i.e. looks like vertically squeezed).

*** Whereas the mp4s of the source MPGs generated by using the formula of MTS’s MP4s don’t display the black borders in JWPLayer and the aspect ratio looks right.

However, the downloaded mp4s clearly displays wrong aspect ratio of 2.08 instead of 16:9 (i.e. 1.78). Neither Quicktime Player nor VLC has black bars when playing this version of MP4s locally. QuickTime shows 663x272 (actual pixels) and (480 x 272 encoded pixel). And VLC shows 480x272. However, both look elongated horizontally. ***

  • Conclusion out of all testing cases: Our choice of settings of Width 416, height – 272, anamorphic – loose, source 720x480, output 416x272, anamorphic 483x272 is the best and correct decision in terms of keeping the right video aspect ratio and have the highest fidelity to the source files. For source MPG files with MPEG2 codec and 720x480 anamorphic video, this setting in HandBrake preserves the best and correct aspect ratio.

 

 

4). A Note about HandBrake

 

  1. Open a video file. HandBrake won’t allow you to select or edit presets otherwise.

  2. Tweak the settings until you are satisfied.

  3. Click on the + sign on the preset panel

    1. Name and describe the preset

    2. Note: Picture Settings:

      1. If you choose none, the picture size won’t be remembered.

      2. The Picture Size here on Preset Name screen has to match the width and height in the previous Picture Settings window. We use custom and 416x272
        (i.e. display size 483x272) for MPG files. If this setting (i.e. 416x272) is applied to MTS files, then the export size and aspect ratio are wrong.

      3. So the conclusion is that we can’t use one preset to both MPG files and MTS files. They have to have different Custom Presets.

 

References:

 

  1. Guide to Anamorphic Encoding in HandBrake https://trac.handbrake.fr/wiki/AnamorphicGuide

  2. Create Custom Presets in HandBrake http://www.macworld.com/article/1166383/create_custom_presets_in_handbrake.html

 

 

 

11

Comments (0)

You don't have permission to comment on this page.