Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DominikHoffmann

macrumors 6502a
Original poster
Jan 15, 2007
537
530
Indiana
I have VideoDuke to download a Web video. It downloads as hundreds of 5-s long MPEG-2 Transport Streams (.ts files). They can be individually opened by QuickTime Player, and I could, in principle, edit them and splice them together individually, reassemble the video and finally export it as an MP4. This would take a prohibitive amount of time.

All the TS files are sequentially numbered. There must be a utility out there that can join these back together. Any suggestions?
 
Can't you just open a new project in iMovie and then mark all the files in your folder in finder (sorted as you need them) and drag and drop them in to the time line? I think this way they should be aligned properly and you only need to export the file.
 
Yes, off hand I forget what container is called but many of the old video recorders used that format. Yes there are utilities/converters/joiners. I don't recall off hand but its been talked about here a couple times a year. I used Bigasoft ProRes Converter at the time. Its jack of all trades, but there are free apps. Perhaps look for joiners.
 
I have VideoDuke to download a Web video. It downloads as hundreds of 5-s long MPEG-2 Transport Streams (.ts files). They can be individually opened by QuickTime Player, and I could, in principle, edit them and splice them together individually, reassemble the video and finally export it as an MP4. This would take a prohibitive amount of time.

All the TS files are sequentially numbered. There must be a utility out there that can join these back together. Any suggestions?

If you are ok with command line, you can leverage ffmpeg.

This might help: https://superuser.com/questions/692990/use-ffmpeg-copy-codec-to-combine-ts-files-into-a-single-mp4
 
Can't you just open a new project in iMovie and then mark all the files in your folder in finder (sorted as you need them) and drag and drop them in to the time line? I think this way they should be aligned properly and you only need to export the file.
iMovie does not recognize the TS files as ones that can be added to a project. Too bad! It would have been too simple.
 
  • Like
Reactions: Meuti
If you are ok with command line, you can leverage ffmpeg.

This might help: https://superuser.com/questions/692990/use-ffmpeg-copy-codec-to-combine-ts-files-into-a-single-mp4
It did! I had to first
brew install ffmpeg
Then, however, the resulting file was still in the TS format, which QuickTime Player can open. I would have preferred to generate a more macOS native MP4 file. @ipponrg: Do you know how to modify my command
/opt/homebrew/bin/ffmpeg -f concat -safe 0 -i ~/Downloads/movie.txt -c copy concatmovie.ts
so it will? The file movie.txt contains the list of all the constituent .ts files per instructions on that StackExchange superuser page.
 
It did! I had to first
brew install ffmpeg
Then, however, the resulting file was still in the TS format, which QuickTime Player can open. I would have preferred to generate a more macOS native MP4 file. @ipponrg: Do you know how to modify my command
/opt/homebrew/bin/ffmpeg -f concat -safe 0 -i ~/Downloads/movie.txt -c copy concatmovie.ts
so it will? The file movie.txt contains the list of all the constituent .ts files per instructions on that StackExchange superuser page.
/opt/homebrew/bin/ffmpeg -f concat -safe 0 -i ~/Downloads/movie.txt -c copy concatmovie.mp4

What happens if you try the above?
 
Okay. So, the .ts files were already H.264-encoded. Consequently, the concatenated movie with these options is also H.264-encoded. Using a target file name with a different file extension thus seems to only apply that different filename.

If I wanted to encode the concatenated movie as a HEVC, how would I do that? ffmpeg is obviously extremely powerful, but it’s also a command that’s a bit intimidating.
 
Okay. So, the .ts files were already H.264-encoded. Consequently, the concatenated movie with these options is also H.264-encoded. Using a target file name with a different file extension thus seems to only apply that different filename.

If I wanted to encode the concatenated movie as a HEVC, how would I do that? ffmpeg is obviously extremely powerful, but it’s also a command that’s a bit intimidating.

I think there is some confusing terminology here. MP4 in this context is the container. H.264 is the encoding of the video. You can store h.265 encoded or h.264 encoded files into a mp4 container.

In order to transcode h264 to hevc, you need to tell ffmpeg to use a target encoder for the output kinda like the below:

ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 output.mp4

This will encode the video bits to hevc compatible. The only issue is you may need to also install and compile ffmpeg with the libx265 codec on your Mac if it’s not already present. I used this link as a reference: https://stackoverflow.com/questions/58742765/convert-videos-from-264-to-265-hevc-with-ffmpeg
 
In order to transcode h264 to hevc, you need to tell ffmpeg to use a target encoder for the output kinda like the below:

ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 output.mp4

This will encode the video bits to hevc compatible. The only issue is you may need to also install and compile ffmpeg with the libx265 codec on your Mac if it’s not already present.
Bash:
ffmpeg -version
shows that libx265 is in fact installed. I am doing a transcode now. It reports a speed of only around 0.778x. I did a search for “ffmpeg apple silicon” and came up with this blog post:

PSA: Apple Silicon Users: Update ffmpeg

Since I installed ffmpeg via Homebrew only a few days ago, I am already on the latest Apple Silicon native version: 5.0.1, or so it seems. Still 0.778x seems really low, since I am running it on an M1 MAX MacBook Pro. Of course, I have no comparison. Perhaps the same conversion would run considerably more slowly on my old 2017 i7 MacBook Pro. I may be able to give it a try there later.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.