Report post You have 30 minutes to complete this form before the CAPTCHA will expire. Security image * Required field JavaScript is required to view this page. Either you do not have JavaScript enabled in your web browser, you do not have cookies enabled in your web browser, or this website is misconfigured such that cookies do not save correctly. This is a reported post for a post in the topic <input class="cms_keep_ui_controlled" size="45" title="[post param="NGINX video storage"]533[/post]" type="button" value="post Comcode tag (dbl-click to edit/delete)" />, by kobberholm<br /><br /><comcode-quote param="412">Hello!<br /> <br /> .ts files are <a class="user_link" href="https://en.wikipedia.org/wiki/MPEG_transport_stream" rel="nofollow noopener external" target="_blank" title="MPEG Transport Stream (this link will open in a new window)">MPEG Transport Stream</a> files.<br /> The "proper" way to concatenate the files, would be with ffmpeg (https://trac.ffmpeg.org/wiki/Concatenate).<br /> <br /> There are some good answers in <a class="user_link" href="https://superuser.com/questions/692990/use-ffmpeg-copy-codec-to-combine-ts-files-into-a-single-mp4" rel="nofollow noopener external" target="_blank" title="this thread &#111;n superuser.com (this link will open in a new window)">this thread on superuser.com</a>.<br /> <br /> In short, you can put the following code (<a class="user_link" href="https://superuser.com/a/1267448" rel="nofollow noopener external" target="_blank" title="that Francesco Galgani posted (this link will open in a new window)">that Francesco Galgani posted</a>) in a bash script and run it in a directory full of .ts files.<br /> <pre> <comcode-code>#!/bin/bash for i in `ls *.ts | sort -V`; do echo "file $i"; done >> mylist.txt ffmpeg -f concat -i mylist.txt -c copy -bsf:a aac_adtstoasc video.mp4</comcode-code> Explanation of the commands</pre><ol><li>Execute the following code using BASH</li><li>List the files, sort them and print the path to a temporary file called mylist.txt.</li><li>Run ffmpeg and tell it to concatenate the files listed in mylist.txt, applying the <a class="user_link" href="https://trac.ffmpeg.org/wiki/Concatenate#protocol" rel="nofollow noopener external" target="_blank" title="Concat &quot;protocol&quot; (this link will open in a new window)">Concat "protocol"</a> using the <a class="user_link" href="https://ffmpeg.org/ffmpeg.html#Stream-copy" rel="nofollow noopener external" target="_blank" title="Stream Copy (this link will open in a new window)">Stream Copy</a> method and the <a class="user_link" href="https://ffmpeg.org/ffmpeg-bitstream-filters.html#aac_005fadtstoasc" rel="nofollow noopener external" target="_blank" title="Bit Stream Audio Filter aac_adtstoasc (this link will open in a new window)">Bit Stream Audio Filter aac_adtstoasc</a>, that will convert the MPEG-2/4 AAC ADTS to an MPEG-4 Audio bitstream and finally output to the file video.mp4</li></ol><br /></comcode-quote><br />//// PUT YOUR REPORT BELOW \\\\<br /><br /> Add: Add: Font Size Color [Font] Arial Courier Georgia Impact Times Trebuchet Verdana Tahoma Geneva Helvetica [Size] 0.8 1 1.5 2 2.5 3 4 [Color] Black Blue Gray Green Orange Purple Red White Yellow This is a reported post for a post in the topic [post param="NGINX video storage"]533[/post], by kobberholm [quote="412"] [semihtml]Hello!<br /> <br /> .ts files are [url="https://en.wikipedia.org/wiki/MPEG_transport_stream" rel="nofollow noopener external nofollow noopener external nofollow noopener external" target="_blank"]MPEG Transport Stream[/url] files.<br /> The "proper" way to concatenate the files, would be with ffmpeg (https://trac.ffmpeg.org/wiki/Concatenate).<br /> <br /> There are some good answers in [url="https://superuser.com/questions/692990/use-ffmpeg-copy-codec-to-combine-ts-files-into-a-single-mp4" rel="nofollow noopener external nofollow noopener external nofollow noopener external" target="_blank"]this thread on superuser.com[/url].<br /> <br /> In short, you can put the following code ([url="https://superuser.com/a/1267448" rel="nofollow noopener external nofollow noopener external nofollow noopener external" target="_blank"]that Francesco Galgani posted[/url]) in a bash script and run it in a directory full of .ts files.<br /> <pre> [code]#!/bin/bash for i in `ls *.ts | sort -V`; do echo "file $i"; done >> mylist.txt ffmpeg -f concat -i mylist.txt -c copy -bsf:a aac_adtstoasc video.mp4[/code] Explanation of the commands</pre><ol style="list"><li>Execute the following code using BASH</li><li>List the files, sort them and print the path to a temporary file called mylist.txt.</li><li>Run ffmpeg and tell it to concatenate the files listed in mylist.txt, applying the [url="https://trac.ffmpeg.org/wiki/Concatenate#protocol" rel="nofollow noopener external nofollow noopener external nofollow noopener external" target="_blank"]Concat "protocol"[/url] using the [url="https://ffmpeg.org/ffmpeg.html#Stream-copy" rel="nofollow noopener external nofollow noopener external nofollow noopener external" target="_blank"]Stream Copy[/url] method and the [url="https://ffmpeg.org/ffmpeg-bitstream-filters.html#aac_005fadtstoasc" rel="nofollow noopener external nofollow noopener external nofollow noopener external" target="_blank"]Bit Stream Audio Filter aac_adtstoasc[/url], that will convert the MPEG-2/4 AAC ADTS to an MPEG-4 Audio bitstream and finally output to the file video.mp4</li></ol>[/semihtml] [/quote] //// PUT YOUR REPORT BELOW \\\\ View all Use of this website implies that you agree to the website rules and privacy policy. Statistics Users online: Details jacobgkau, 29 guests Usergroups: Administrators Forum statistics: 148 topics, 639 posts, 633 members Our newest member is OfflineInfluencer83