VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Hiya All - hoping someone can help me!

    I have 2 days of recovered footage that was recovered from a corrupt drive. Originally the footage was AVCHD files. The recovery has gone well almost! It seems I have all the footage but it is all in around 1000 70mb clips. The seem to piece together ok, but the is a frame or two at the beginning of each file where the footage is frozen. I really don't want to have to go and edit every clip! Anybody know of any software that might help me automate this process? Hopefully i have explained this well enough! Thanks in advance.
    Quote Quote  
  2. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Maybe append the individual files with MKVMerge to a single file.
    Quote Quote  
  3. Originally Posted by Marty Nick View Post
    The seem to piece together ok, but the is a frame or two at the beginning of each file where the footage is frozen.
    Try
    ffmpeg -i "concat:input1.ts|input2.ts|input3.ts" -c copy "output.ts"
    and see if the issue with the frozen frames persists.

    If not maybe someone can help you automate this. But with 1000 files you might even reach max Windows command-line length or some ffmpeg/RAM limits.


    With mkvmerge as suggested by KarMa you can try:
    mkvmerge -o "output.mkv" ( "input1.ts" "input2.ts" "input3.ts" )

    In the GUI you add the first file. Then right-click it -> "Add files as additional parts" and select the other 999. I haven't tested it with this many files ever but this would probably be easiest if it worked ...
    Last edited by sneaker; 6th May 2018 at 07:32.
    Quote Quote  
  4. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Hopefully the merge suggested by KarMa and sneaker above will work for you, but my 'experience' (I'm far from an expert) is that the video may be cut or starting at an I-frame that has a PTS time that is not Zero and your particular player will show the first actual frame for that amount of time frozen (and possibly with accompanying sound). Other players may show pixelated first few frames or other strange behavior.

    This can be reproduced with FFMPEG, at least on my machine, by taking a video with a key frame at 05:27.127127 and cutting 2 seconds back (05:25.127127) using -SS as an output option. This is because FFMPEG cuts at a key frame when -SS is used as an output option but not setting it to 0-PTS as it does when used as an input option.

    Code:
    ffmpeg -i "Video.mp4" -ss 05:25.127127 -to 05:35.4688 -acodec copy -vcodec copy -y "Output_Video.mp4"
    This causes an output video with this condition. Parsing the frames shows the leading I frame with a 2.000000 time:

    No. pts_time type
    0 2.000000 1 I
    1 2.033367 0 B
    2 2.066733 0 P
    3 2.100100 0 P
    4 2.133467 0 B
    5 2.166834 0 P
    6 2.200200 0 P
    7 2.233567 0 P
    8 2.266934 0 B
    9 2.300300 0 P
    It's possible your recovery software did a similar function because it would COPY from the first usable frame and not recode. It is possible to fix these, MOST of the time, by using -SS as an input option and seeking to the offset with no -TO or -T option, since you would want to copy the entire video.

    Code:
    ffmpeg -ss 2.000000 -i "Output_Video.mp4" -acodec copy -vcodec copy -y "Final_Output_Video.mp4"
    I do not know if this is your problem but checking the frame data would tell you by showing the leading frames data. You should be able to use the below script to check.

    Code:
    ffprobe.exe -v quiet -select_streams v -show_frames -show_entries frame=pkt_pts_time -print_format csv "Video.mp4"  >> "Video_ffprobe.csv"
    Quote Quote  
  5. Originally Posted by sneaker View Post
    If not maybe someone can help you automate this. But with 1000 files you might even reach max Windows command-line length or some ffmpeg/RAM limits.
    That's why you can create list of files to combine and use it as concatenate input.
    https://trac.ffmpeg.org/wiki/Concatenate
    Quote Quote  
  6. The "concat demuxer" isn't the same as the "concat protocol". That said, testing both wouldn't hurt.
    Quote Quote  
  7. Originally Posted by sneaker View Post
    The "concat demuxer" isn't the same as the "concat protocol". That said, testing both wouldn't hurt.
    True but protocol is not different than simple copy /b or any similar tool (ps?) to combine file at binary level.
    Quote Quote  
  8. AFAIK: yes. Which is a good hint as it seems copy /b supports wildcards:
    copy /b "*.ts" "output.ts"

    Now of course whether or not this is what he needs he must test. As Budman1 said the problem might require a different solution.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!