Answers.Body: <p>You should use the segment muxer for this.</p>
  <p><code>ffmpeg -i &quot;input.m2ts&quot; -map 0:v -map 0:a -c copy -f segment -segment_time 02:00 -reset_timestamps 1 output_%04d.m2ts</code></p>
  <p>This will create a sequence of files named output_0000.m2ts, output_0001.m2ts ...</p>
  <p>I've changed mapping to video and audio to avoid copying data streams that your editor may not make sense of.</p>
  <p>P.S. <code>.ts</code>, <code>.m2ts</code> are MPEG-TS files. AVCHD is just a commercial name given to Sony's flavour of H.264 video. Such video streams can be contained within many container formats (MOV, MP4, MXF, TS.. etc).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-08T02:04:41.037Z
Answers.Text: Thanks for the detailed answer. Note that the source file has one video stream and two audio streams, and I do need all of it in the edit. I didn't know ffmpeg could split a file like that, is there a way to get the segments to have an overlap? I was splitting every 2h, but making the files 2h10m, because each item I'm extracting is only a few minutes - I was avoiding splicing any items and having to rejoin them. Thanks again for all the extra info, most helpful.
Answers.UserDisplayName: Peter Barton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-08T02:10:41.333Z
Answers.Text: I am marking this the correct answer, because failing all else, I think this work around would have resolved this. Premiere did eventually import the big file correctly, and that's what I've used, but this would have been the other workable solution to the issue I was having.
Answers.UserDisplayName: Peter Barton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-31T04:19:01.120Z
Answers.LastActivityDate: 2023-10-31T04:19:01.120Z
Answers.UserDisplayName: Gyan
Body: <p>From an all day event shoot, I have a 13 hour file recorded on a Sony HXR-NX5R camera. Catalyst Browse transferred the 160GB file OK, Premiere imported the file (but choked for quite a while doing so), but now I can't actually edit with it - adding it to the timeline just comes up &quot;Media Pending&quot;, and sits there. Maybe if it sits long enough it will cope, but I wasn't seeing any life after an hour or so. It seems the file is too big for Premiere to handle (Premiere 22.5.0 Build 62, have tried same version on both Mac and PC - I can update to the latest Premiere if it's worth a shot, I've been sitting on this version a while to not disrupt some projects in progress)</p>
  <p>I looked into using Catalyst Browse to split the file when copying, but it seems that option isn't available for AVCHD files.</p>
  <p>I looked at using ffmpeg to split the big file to smaller ones, it throws &quot;Non-monotonous DTS in output stream 0:2&quot;, so I guess I'm just not sure if the files I'm cutting up this way have issues (missing frames, etc). I just don't understand the error, or what I might need to do to validate if the file is still good. Command issued is:</p>
  <p><code>ffmpeg -i &quot;input.m2ts&quot; -map 0 -c copy -ss 00:00:00 -t 2:10:00 output.m2ts</code></p>
  <p>I know some Sony cameras will let you split the recorded file into parts on the camera, but I can't find any such option in the NX5R menus.</p>
  <p>Suggestions on any other software or method of processing this that I might try? At this stage it looks like going the ffmpeg route, and crossing my fingers that the split files don't contain issues, I'm just surprised Premiere is having issues (VLC plays/scans the file fine), and disappointed there doesn't seem to be anything on the Sony side to assist in splitting the file up once it has been created.</p>
  <p>UPDATE: I decided to let Premiere chew on the file overnight, to see if the &quot;Media Pending&quot; would clear at any point. But I had removed it from the project, so I re-added it back, along with the ffmpeg split version. Premiere didn't choke bringing in the big file at all this time. I dropped it onto the timeline, expecting the &quot;Media Pending&quot;, but this time it just came up and worked. So it seems Premiere can handle the file, but there was something internally going wrong, and somewhere between trying to import straight off the SD card files, and playing with split files, and various other things I tried, Premiere must have forgotten whatever it was referencing on the file that wasn't working, and it has now just come in clean. Who knows.</p>
  
Tags: <ffmpeg><premiere><premiere-pro><avchd><sony>
Title: Is there a way to split up an AVCHD file into smaller files (Sony HXR-NX5R)
UserDisplayName: Peter Barton
ThreadText: # Is there a way to split up an AVCHD file into smaller files (Sony HXR-NX5R)
  
  (Asked by: username_0 on 2023-10-30)
  
  From an all day event shoot, I have a 13 hour file recorded on a Sony HXR-NX5R camera. Catalyst Browse transferred the 160GB file OK, Premiere imported the file (but choked for quite a while doing so), but now I can't actually edit with it - adding it to the timeline just comes up "Media Pending", and sits there. Maybe if it sits long enough it will cope, but I wasn't seeing any life after an hour or so. It seems the file is too big for Premiere to handle (Premiere 22.5.0 Build 62, have tried same version on both Mac and PC - I can update to the latest Premiere if it's worth a shot, I've been sitting on this version a while to not disrupt some projects in progress)
  
  I looked into using Catalyst Browse to split the file when copying, but it seems that option isn't available for AVCHD files.
  
  I looked at using ffmpeg to split the big file to smaller ones, it throws "Non-monotonous DTS in output stream 0:2", so I guess I'm just not sure if the files I'm cutting up this way have issues (missing frames, etc). I just don't understand the error, or what I might need to do to validate if the file is still good. Command issued is:
  
  `ffmpeg -i "input.m2ts" -map 0 -c copy -ss 00:00:00 -t 2:10:00 output.m2ts`
  
  I know some Sony cameras will let you split the recorded file into parts on the camera, but I can't find any such option in the NX5R menus.
  
  Suggestions on any other software or method of processing this that I might try? At this stage it looks like going the ffmpeg route, and crossing my fingers that the split files don't contain issues, I'm just surprised Premiere is having issues (VLC plays/scans the file fine), and disappointed there doesn't seem to be anything on the Sony side to assist in splitting the file up once it has been created.
  
  UPDATE: I decided to let Premiere chew on the file overnight, to see if the "Media Pending" would clear at any point. But I had removed it from the project, so I re-added it back, along with the ffmpeg split version. Premiere didn't choke bringing in the big file at all this time. I dropped it onto the timeline, expecting the "Media Pending", but this time it just came up and worked. So it seems Premiere can handle the file, but there was something internally going wrong, and somewhere between trying to import straight off the SD card files, and playing with split files, and various other things I tried, Premiere must have forgotten whatever it was referencing on the file that wasn't working, and it has now just come in clean. Who knows.
  
  **Tags:** ffmpeg, premiere, premiere-pro, avchd, sony
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-10-31. Score: 2 | Accepted answer
  
  You should use the segment muxer for this.
  
  `ffmpeg -i "input.m2ts" -map 0:v -map 0:a -c copy -f segment -segment_time 02:00 -reset_timestamps 1 output_%04d.m2ts`
  
  This will create a sequence of files named output\_0000.m2ts, output\_0001.m2ts ...
  
  I've changed mapping to video and audio to avoid copying data streams that your editor may not make sense of.
  
  P.S. `.ts`, `.m2ts` are MPEG-TS files. AVCHD is just a commercial name given to Sony's flavour of H.264 video. Such video streams can be contained within many container formats (MOV, MP4, MXF, TS.. etc).
  
  > **Comments:**
  > **username_0**: Thanks for the detailed answer. Note that the source file has one video stream and two audio streams, and I do need all of it in the edit. I didn't know ffmpeg could split a file like that, is there a way to get the segments to have an overlap? I was splitting every 2h, but making the files 2h10m, because each item I'm extracting is only a few minutes - I was avoiding splicing any items and having to rejoin them. Thanks again for all the extra info, most helpful.  
  > **username_0**: I am marking this the correct answer, because failing all else, I think this work around would have resolved this. Premiere did eventually import the big file correctly, and that's what I've used, but this would have been the other workable solution to the issue I was having.  
  
  ---
  
  