Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st June 2012, 06:38   #1  |  Link
alvgarci
Registered User
 
Join Date: Dec 2010
Posts: 14
Verify that this ffpeg MP4 conversion is really lossless.

Hi all:

Because some limitations I found convert an MP4 footage into a new MP4 file the only way to change it's creation date tag.

(I'm creating the source MP4 with Adobe Premiere.. but I didn't found the way to do that.. any tip.. also welcomed).

My problem is that FFMPEG, that suppose to do a loosless convertion, doesn't seems to.

This is my code..

ffmpeg -i "funcion 2012 final.mp4" -acodec copy -vcodec copy -timestamp '1974-03-31 13:00:00' -f mp4 test.mov

where -acodec copy -vcodec copy basically force to copy the source video/audio.

This is what exiftool reports about first video:

ExifTool Version Number : 8.95
File Name : funcion 2012 final.mp4
Directory : .
File Size : 466 MB
File Modification Date/Time : 2012:06:15 02:31:38+02:00
File Permissions : rw-r--r--
File Type : MP4
MIME Type : video/mp4
Major Brand : MP4 v2 [ISO 14496-14]
Minor Version : 0.0.0
Compatible Brands : mp42, mp41
Movie Header Version : 0
Create Date : 2012:06:15 00:29:29
Modify Date : 2012:06:15 00:30:29
Time Scale : 90000
Duration : 0:03:57
Preferred Rate : 1
Preferred Volume : 100.00%
Preview Time : 0 s
Preview Duration : 0 s
Poster Time : 0 s
Selection Time : 0 s
Selection Duration : 0 s
Current Time : 0 s
Next Track ID : 3
Track Header Version : 0
Track Create Date : 2012:06:15 00:29:29
Track Modify Date : 2012:06:15 00:29:29
Track ID : 1
Track Duration : 0:03:57
Track Layer : 0
Track Volume : 0.00%
Image Width : 1920
Image Height : 1080
Graphics Mode : srcCopy
Op Color : 0 0 0
Compressor ID : avc1
Source Image Width : 1920
Source Image Height : 1080
X Resolution : 72
Y Resolution : 72
Compressor Name : AVC Coding
Bit Depth : 24
Matrix Structure : 1 0 0 0 1 0 0 0 1
Media Header Version : 0
Media Create Date : 2012:06:15 00:29:30
Media Modify Date : 2012:06:15 00:29:30
Media Time Scale : 48000
Media Duration : 0:03:57
Media Language Code : eng
Balance : 0
Handler Type : Audio Track
Handler Description : #Mainconcept MP4 Sound Media Handler
Audio Format : mp4a
Audio Channels : 6
Audio Bits Per Sample : 16
User Data TIM : 00:00:00:00
User Data TSC : 25
User Data TSZ : 1
XMP Toolkit : Adobe XMP Core 5.3-c011 66.146729, 2012/05/03-13:40:03
Metadata Date : 2012:06:15 02:30:29+02:00
Start Time Scale : 25
Start Time Sample Size : 1
Video Frame Rate : 25.000000
Video Field Order : Progressive
Video Pixel Aspect Ratio : 1
Audio Sample Rate : 48000
Audio Sample Type : 16-bit integer
Audio Channel Type : 5.1
Original Document ID : xmp.did:018011740720681188C6D92ECE8977C5
Instance ID : xmp.iid:0280117407206811808384462B783443
Document ID : xmp.did:0180117407206811808384462B783443
Format : H.264
Duration Value : 21335040
Duration Scale : 1.11111111111111e-05
Start Timecode Time Value : 00:00:00:00
Start Timecode Time Format : 25 fps
Alt Timecode Time Value : 00:00:00:00
Alt Timecode Time Format : 25 fps
Project Ref Type : Movie
Video Frame Size W : 1920
Video Frame Size H : 1080
Video Frame Size Unit : pixel
History Action : saved, saved, saved, saved
History Instance ID : xmp.iid:018011740720681188C6D92ECE8977C5, xmp.iid:058011740720681188C6C2B0B0F098B9, xmp.iid:078011740720681188C6C2B0B0F098B9, xmp.iid:0280117407206811808384462B783443
History When : 2012:06:15 00:46:47+02:00, 2012:06:15 00:48:04+02:00, 2012:06:15 00:48:04+02:00, 2012:06:15 02:30:29+02:00
History Software Agent : Adobe Premiere Pro CS6 (Macintosh), Adobe PProHeadless CS6 (Macintosh), Adobe PProHeadless CS6 (Macintosh), Adobe Adobe Media Encoder CS6 (Macintosh)
History Changed : /metadata/xmpDM/Tracks, /metadata, /, /
Ingredients Instance ID : xmp.iid:028011740720681188C6C2B0B0F098B9, xmp.iid:048011740720681188C6C2B0B0F098B9
Ingredients From Part : time:0d59024546380800f254016000000, time:0d53396703360000f254016000000
Ingredients To Part : time:1067934067200f254016000000d59024546380800f254016000000, time:1381533753600f254016000000d53396703360000f254016000000
Ingredients File Path : 00066.MTS, 00008.MTS
Ingredients Mask Markers : None, None
Derived From Instance ID : xmp.iid:058011740720681188C6C2B0B0F098B9
Derived From Document ID : xmp.did:018011740720681188C6D92ECE8977C5
Derived From Original Document ID: xmp.did:018011740720681188C6D92ECE8977C5
Pantry Instance ID : xmp.iid:048011740720681188C6C2B0B0F098B9
Windows Atom Extension : .prproj
Windows Atom Invocation Flags : /L
Mac Atom Application Code : 1347449455
Mac Atom Invocation Apple Event : 1129468018
Mac Atom Posix Project Path : /Users/Alvgarci/Documents/Adobe/Premiere Pro/6.0/Funcion Cole Marcos 2012.prproj
Movie Data Size : 488395942
Avg Bitrate : 16.5 Mbps
Image Size : 1920x1080
Rotation : 0

This is what the exiftool say about the second:

ExifTool Version Number : 8.95
File Name : test.mov
Directory : .
File Size : 466 MB
File Modification Date/Time : 2012:06:21 06:31:47+02:00
File Permissions : rw-r--r--
File Type : MP4
MIME Type : video/mp4
Major Brand : MP4 Base Media v1 [IS0 14496-12:2003]
Minor Version : 0.2.0
Compatible Brands : isom, iso2, avc1, mp41
Movie Data Size : 488395934
Movie Header Version : 0
Create Date : 1974:03:31 12:00:00
Modify Date : 1974:03:31 12:00:00
Time Scale : 1000
Duration : 0:03:57
Preferred Rate : 1
Preferred Volume : 100.00%
Preview Time : 0 s
Preview Duration : 0 s
Poster Time : 0 s
Selection Time : 0 s
Selection Duration : 0 s
Current Time : 0 s
Next Track ID : 3
Track Header Version : 0
Track Create Date : 1974:03:31 12:00:00
Track Modify Date : 1974:03:31 12:00:00
Track ID : 1
Track Duration : 0:03:57
Track Layer : 0
Track Volume : 0.00%
Image Width : 1920
Image Height : 1080
Graphics Mode : srcCopy
Op Color : 0 0 0
Compressor ID : avc1
Source Image Width : 1920
Source Image Height : 1080
X Resolution : 72
Y Resolution : 72
Bit Depth : 24
Video Frame Rate : 25
Matrix Structure : 1 0 0 0 1 0 0 0 1
Media Header Version : 0
Media Create Date : 1974:03:31 12:00:00
Media Modify Date : 1974:03:31 12:00:00
Media Time Scale : 48000
Media Duration : 0:03:57
Media Language Code : eng
Handler Description : SoundHandler
Balance : 0
Audio Format : mp4a
Audio Channels : 2
Audio Bits Per Sample : 16
Audio Sample Rate : 48000
Handler Type : Metadata
Handler Vendor ID : Apple
Encoder : Lavf54.6.100
Avg Bitrate : 16.5 Mbps
Image Size : 1920x1080
Rotation : 0


Despite of the fact of many headers that are loose on the second (I don't care about many of them), I see that Audio Channels has been modify to 2 (instead of 6 of the source one)


Other video info tools doesn't seems to find any difference other than the creation date.

I notice that the first is MP4 v2 encoded and the second is MP4 v1 encoded...


Can anyone confirm that really my second video loose audio definition or not?

Is there any way to not change anything on the source video on FFMPEG or use MP4v2 on FFMPEG?

Thanks
alvgarci is offline   Reply With Quote
Old 21st June 2012, 11:00   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,255
about 'MP4 v2 vs. MP4 v1':
you probably need to add '-vbsf h264_mp4toannexb' (see: http://ffmpeg.org/ffmpeg.html), no clue why the audio channel count changed,..
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 22nd June 2012, 23:26   #3  |  Link
alvgarci
Registered User
 
Join Date: Dec 2010
Posts: 14
Thanks for your response. Indeed... I've done another test:

Running this:

./ffmpeg -i "marcos haciendo un dibujo.MTS" -acodec copy -vcodec copy -timestamp '1974-03-31 13:00:00' -f mp4 1.mp4

This is what MediaInfo said about the source file "marcos haciendo un dibujo.MTS":


General
ID : 0 (0x0)
Complete name : marcos haciendo un dibujo.MTS
Format : BDAV
Format/Info : Blu-ray Video
File size : 168 MiB
Duration : 1mn 21s
Overall bit rate mode : Variable
Overall bit rate : 17.2 Mbps
Maximum Overall bit rate : 18.0 Mbps

Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Format settings, GOP : M=2, N=15
Codec ID : 27
Duration : 1mn 21s
Bit rate mode : Variable
Bit rate : 16.0 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.257
Stream size : 155 MiB (92%)

Audio
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : 129
Duration : 1mn 21s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 4.33 MiB (3%)

Text
ID : 4608 (0x1200)
Menu ID : 1 (0x1)
Format : PGS
Codec ID : 144
Duration : 1mn 20s


Here you have what MediaInfo said about the 1.MP4.. the converted file:


General
Complete name : 1.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 159 MiB
Duration : 1mn 21s
Overall bit rate mode : Variable
Overall bit rate : 16.5 Mbps
Encoded date : UTC 1974-03-31 12:00:00
Tagged date : UTC 1974-03-31 12:00:00
Writing application : Lavf54.6.100

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Format settings, GOP : M=2, N=15
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1mn 21s
Bit rate mode : Variable
Bit rate : 16.0 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 59.940 fps
Original frame rate : 29.970 fps
Minimum frame rate : 59.920 fps
Maximum frame rate : 59.960 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.129
Stream size : 155 MiB (97%)
Encoded date : UTC 1974-03-31 12:00:00
Tagged date : UTC 1974-03-31 12:00:00

Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : ac-3
Duration : 1mn 21s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 4.33 MiB (3%)
Encoded date : UTC 1974-03-31 12:00:00
Tagged date : UTC 1974-03-31 12:00:00


So... as you can see on the converted file:

General
Complete name : 1.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 159 MiB
Duration : 1mn 21s
Overall bit rate mode : Variable
Overall bit rate : 16.5 Mbps
Encoded date : UTC 1974-03-31 12:00:00
Tagged date : UTC 1974-03-31 12:00:00
Writing application : Lavf54.6.100


File Size is different (9 Mb smaller), but the rest is exactly same (so seems that really it copies audio and video finally!).

I don't understand what's going on..

Anyone can explain/confirm that the MP4 has exactly same video as source?

Thanks
alvgarci is offline   Reply With Quote
Old 23rd June 2012, 08:23   #4  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,986
Transport streams have inherent overhead, and sometimes null padding. This isn't a bad thing - transport streams are designed to fill a specific role which requires some features that come with said overhead.

Most other containers don't have these requirements, so they have much less overhead. Temuxing from a transport stream to any other container will essentially guarantee at least some size reduction.

After remuxing, it's possible there will be some very slight mathematical differences in the video, but this will not affect the encoded video frames - only the surrounding header information. I'm simplifying here, because quite frankly I don't know the correct terminology!

In any case, if you decoded both the original video and the remuxed version into uncompressed video and did a comparison, you would have 100% perfectly identical results. Your video is untouched, don't worry
__________________
These are all my personal statements, not those of my employer :)
Blue_MiSfit is offline   Reply With Quote
Old 24th June 2012, 22:19   #5  |  Link
alvgarci
Registered User
 
Join Date: Dec 2010
Posts: 14
oh.. thanks a lot for your reply. Those are really good news for me.

BTW: I've some issues with MTS files and LightRoom 4 (LightRoom 4 cannot manage correctly audio inside of MTS). I'm looking for convert to MP4 files all my MTS collection, keeping the original creation date as well as video and audio quality (just change the container).

I've run this command:

./ffmpeg -i "marcos haciendo un dibujo.MTS" -acodec c copy -vcodec copy -timestamp '1974-03-31 13:00:00' -f mp4 1.mp4

The 1.mp4 file result has the correct date and works.. (seems that it have the same info inside based on your reply).. should be my solution? can I trust in my way to change all my MTS files to MP4 without loose quality?

(MP4 is a container that is easier to manage by many products, almost in MAC, that is my case).

Thanks
alvgarci is offline   Reply With Quote
Old 2nd July 2012, 06:02   #6  |  Link
alvgarci
Registered User
 
Join Date: Dec 2010
Posts: 14
Correction:

./ffmpeg -i "marcos haciendo un dibujo.MTS" -acodec copy -vcodec copy -timestamp '1974-03-31 13:00:00' -f mp4 1.mp4

Thanks
alvgarci is offline   Reply With Quote
Reply

Tags
avchd, ffmpeg, loosless, mp4

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.