<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>MP4 &#8211; Wade Tregaskis</title>
	<atom:link href="https://wadetregaskis.com/tags/mp4/feed/" rel="self" type="application/rss+xml" />
	<link>https://wadetregaskis.com</link>
	<description></description>
	<lastBuildDate>Sat, 18 Nov 2023 00:11:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://wadetregaskis.com/wp-content/uploads/2016/03/Stitch-512x512-1-256x256.png</url>
	<title>MP4 &#8211; Wade Tregaskis</title>
	<link>https://wadetregaskis.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">226351702</site>	<item>
		<title>Never import by copy into Final Cut Pro</title>
		<link>https://wadetregaskis.com/never-import-by-copy-into-final-cut-pro/</link>
					<comments>https://wadetregaskis.com/never-import-by-copy-into-final-cut-pro/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sat, 19 Nov 2022 00:04:30 +0000</pubDate>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Broken by design]]></category>
		<category><![CDATA[Bugs!]]></category>
		<category><![CDATA[Final Cut Pro]]></category>
		<category><![CDATA[GoPro]]></category>
		<category><![CDATA[GPMD]]></category>
		<category><![CDATA[MOV]]></category>
		<category><![CDATA[MP4]]></category>
		<guid isPermaLink="false">https://blog.wadetregaskis.com/?p=5187</guid>

					<description><![CDATA[By default, Final Cut Pro prefers to &#8220;copy&#8221; all files on import. Indeed you&#8217;d think this is the only sensible option most of the time, since most of the time you&#8217;re importing from a memory card and you do need to make a local copy somewhere on your computer. However, Final Cut Pro has a&#8230; <a class="read-more-link" href="https://wadetregaskis.com/never-import-by-copy-into-final-cut-pro/" data-wpel-link="internal">Read more</a>]]></description>
										<content:encoded><![CDATA[
<p>By default, Final Cut Pro prefers to &#8220;copy&#8221; all files on import.  Indeed you&#8217;d think this is the <em>only</em> sensible option most of the time, since most of the time you&#8217;re importing from a memory card and you <em>do</em> need to make a local copy somewhere on your computer.</p>



<p>However, Final Cut Pro has a design flaw which causes data loss.  You see, Final Cut Pro never merely <em>copies</em> the files.  It extracts their audiovisual contents and puts it into a <em>new</em> file.  You might have noticed this already from the fact that Final Cut Pro&#8217;s copied version of the files is always a MOV container, whereas your inputs are more likely an MP4 container.</p>



<p>This would be annoying enough in itself &#8211; it means you can&#8217;t do simple bitwise comparisons of the files to e.g. ensure the imported copy is <em>actually</em> valid and not corrupt, before you erase the original from your memory card.  But it gets worse.</p>



<p><strong>Final Cut Pro doesn&#8217;t copy all the contents</strong>.  It only copies <em>some</em> types of tracks &#8211; i.e. audio, video, and timestamp tracks.  It does <em>not</em> copy tracks such as <a rel="noreferrer noopener external" href="https://github.com/gopro/gpmf-parser" data-type="URL" data-id="https://github.com/gopro/gpmf-parser" target="_blank" data-wpel-link="external">GoPro&#8217;s metadata track</a> (GPMD).  Final Cut Pro just silently discards those.</p>



<p>Those tracks can contain important information.  GPMD tracks, for example, contain a whole host of telemetry from the GoPro including its location during recording, rotation &amp; movement data, and much more.  Even if you think you don&#8217;t care about things like geotagging, consider this:  that rotation &amp; movement data can be used to enhance image stabilisation.  By losing the data at import, you&#8217;re losing the ability to ever utilise that enhanced image stabilisation.</p>



<p>So never let Final Cut Pro &#8220;copy&#8221; your files &#8211; always copy them yourself first, as needed, and then import them into Final Cut Pro by reference only (the &#8220;Leave files in place&#8221; option).  Thankfully Final Cut Pro doesn&#8217;t mangle the files when you use them that way (underlining the question: why does it force a lossy conversion to MOV to begin with, since it clearly works just fine with MP4 originals).</p>
]]></content:encoded>
					
					<wfw:commentRss>https://wadetregaskis.com/never-import-by-copy-into-final-cut-pro/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5187</post-id>	</item>
		<item>
		<title>ffmpeg can produce pseudo-corrupt audio when &#8216;copy&#8217;ing to an MP4 container</title>
		<link>https://wadetregaskis.com/ffmpeg-can-produce-pseudo-corrupt-audio-when-copying-to-an-mp4-container/</link>
					<comments>https://wadetregaskis.com/ffmpeg-can-produce-pseudo-corrupt-audio-when-copying-to-an-mp4-container/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Wed, 01 Aug 2018 15:56:08 +0000</pubDate>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[AAC]]></category>
		<category><![CDATA[Bugs!]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[Finder]]></category>
		<category><![CDATA[H.264]]></category>
		<category><![CDATA[Lightroom]]></category>
		<category><![CDATA[MOV]]></category>
		<category><![CDATA[MP4]]></category>
		<category><![CDATA[Quicktime]]></category>
		<category><![CDATA[Snafu]]></category>
		<category><![CDATA[trail camera]]></category>
		<category><![CDATA[VLC]]></category>
		<guid isPermaLink="false">https://blog.wadetregaskis.com/?p=4181</guid>

					<description><![CDATA[I&#8217;ve been using ffmpeg to trim clips from a trail camera, as most of the time there&#8217;s only a few seconds of anything interesting in frame out of the 30+ seconds of video it records each time, but I don&#8217;t want to re-encode them and lose video quality as a result (or balloon file sizes&#8230; <a class="read-more-link" href="https://wadetregaskis.com/ffmpeg-can-produce-pseudo-corrupt-audio-when-copying-to-an-mp4-container/" data-wpel-link="internal">Read more</a>]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve been using ffmpeg to trim clips from a trail camera, as most of the time there&#8217;s only a few seconds of anything interesting in frame out of the 30+ seconds of video it records each time, but I don&#8217;t want to re-encode them and lose video quality as a result (or balloon file sizes tremendously with a lossless video coding).  Keeping the whole 30 seconds is not just unnecessary and makes viewing the videos much more tedious, but wasteful of storage space as the encoding quality from the trail camera is very inefficient (file sizes are many times larger than they should be for the quality &#8211; clearly the H.264 encoder used in the trail camera is very cheap and very bad at its job).</p>
<p>I was originally doing something like:</p>
<pre>ffmpeg -ss 00:07 -t 00:03 -i "IMG_0164.MP4" -async 1 -c copy "IMG_0164_TRIMMED.MP4"</pre>
<p>The resulting trimmed MP4s play just fine in Quicktime, the Finder &#8211; anywhere that uses Apple&#8217;s decoding libraries (though I didn&#8217;t test iOS).</p>
<p>However, in VLC, or Lightroom, the audio is completely corrupt &#8211; just incoherent noise.  In Lightroom the video doesn&#8217;t even play correctly, because of Lightroom&#8217;s stupid habit of re-encoding the video &amp; audio into internal caches &#8211; apparently their video decoder is somehow thrown off by the audio channel issues, too.</p>
<p>After much trial and error and many dead-ends (thank you completely bogus &amp; wrong Stack Overflow threads… sigh) I eventually realised that the problem is apparently simply that Lightroom, VLC, etc get offended when you include pcm_s16le audio in an MP4.  ffmpeg itself says that&#8217;s not a valid audio codec for the MP4 container, <em>iff</em> you explicitly tell it to use that as the codec.  If you&#8217;re just copying from an existing audio / video file, however, it makes no mention at all of the concern.  Sigh.</p>
<p>So the apparent solution is simply to switch to the MOV container format instead.</p>
<pre>ffmpeg -ss 00:07 -t 00:03 -i "IMG_0164.MP4" -async 1 -c copy "IMG_0164_TRIMMED.MOV"</pre>
<p>The encoded bits remain identical, but the MOV container apparently accepts PCM audio where MP4 does not.  VLC, Lightroom, etc are now happy (and Quicktime et al remain happy).</p>
<p>(another possibility is that the &#8216;incompatibility&#8217; is related to MP4 levels or some other such junk… I didn&#8217;t try deciphering or exploring that)</p>
<p>It&#8217;s frustrating that VLC &amp; Lightroom can&#8217;t handle this when clearly it&#8217;s technically possible (witness Quicktime), and worse they don&#8217;t even properly recognise that they&#8217;re not handling it properly &#8211; they just play completely corrupt audio that&#8217;s literally painful on the ears.</p>
<p>It&#8217;s also very curious that the trail camera uses PCM audio if that&#8217;s not valid in an MP4 container.  It&#8217;s downright bizarre that VLC &amp; Lightroom can play the <em>unmodified</em> MP4s straight from the trail camera, even though they use the same purportedly invalid audio codec… somehow something ffmpeg is doing during its transmutation is making them angry.  I was unable to determine what that might be, though, through trial-and-error with ffmpeg command line options &amp; rudimentary examination of the input &amp; output files.</p>
<p>P.S.  An alternative is to bitwise-copy only the video stream (i.e. change -c copy to -c:v copy), and let VLC transcode the audio into its default AAC for the MP4 container.  That probably wouldn&#8217;t be a problem for me in my case &#8211; the audio from trail cameras is pretty crappy to begin with &#8211; but at the same time the audio tracks in these files are insignificant in size, so re-encoding them (and lossy as AAC) is pointless to saving disk space.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://wadetregaskis.com/ffmpeg-can-produce-pseudo-corrupt-audio-when-copying-to-an-mp4-container/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4181</post-id>	</item>
	</channel>
</rss>
