VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Hi,

    I'm trying to trim 7 seconds from batch of files. but when I play the result of below code it starts the mkv with two seconds of black screen like the photo below.


    Image
    [Attachment 54233 - Click to enlarge]



    I'm using below script

    Code:
    MD newfiles
    for %%a in ("*.mkv") do C:\ConvertDTStoAC3\ffmpeg\bin\ffmpeg.exe -i "%%a" -ss 00:00:07.100 -vcodec copy -acodec copy "newfiles\%%~na.mkv"
    pause
    Quote Quote  
  2. To get what (I'm guessing) you want isn't possible using -vcodec copy.

    Here is what the documentation for ffmpeg says:

    -ss position (input/output)
    When used as an input option (before -i), seeks in this input file to position. Note that in most formats it is not possible to seek exactly, so ffmpeg will seek to the closest seek point before position. When transcoding and -accurate_seek is enabled (the default), this extra segment between the seek point and position will be decoded and discarded. When doing stream copy or when -noaccurate_seek is used, it will be preserved.

    When used as an output option (before an output url), decodes but discards input until the timestamps reach position.

    position must be a time duration specification, see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual.
    Quote Quote  
  3. Originally Posted by videobruger View Post
    To get what (I'm guessing) you want isn't possible using -vcodec copy.

    Here is what the documentation for ffmpeg says:

    -ss position (input/output)
    When used as an input option (before -i), seeks in this input file to position. Note that in most formats it is not possible to seek exactly, so ffmpeg will seek to the closest seek point before position. When transcoding and -accurate_seek is enabled (the default), this extra segment between the seek point and position will be decoded and discarded. When doing stream copy or when -noaccurate_seek is used, it will be preserved.

    When used as an output option (before an output url), decodes but discards input until the timestamps reach position.

    position must be a time duration specification, see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual.
    Thank you for the reply.
    What I’m trying to do is remove the first 7 seconds from mkv file. So, what I need to do now is just remove -vcodec copy ?
    Quote Quote  
  4. Originally Posted by Mishari View Post
    What I’m trying to do is remove the first 7 seconds from mkv file. So, what I need to do now is just remove -vcodec copy ?
    You can do that but the whole video will be re-encoded; taking a long time and reducing quality.
    Quote Quote  
  5. Originally Posted by jagabo View Post
    Originally Posted by Mishari View Post
    What I’m trying to do is remove the first 7 seconds from mkv file. So, what I need to do now is just remove -vcodec copy ?
    You can do that but the whole video will be re-encoded; taking a long time and reducing quality.

    Is there a way to avoid re-encoding the video and keep the quality as is ?
    Quote Quote  
  6. Is there a way to avoid re-encoding the video and keep the quality as is ?
    You can use a "smart" cutter that only re-encode around the cutting point(s). I belive SolveigsMM Video Splitter in their Business Version has some batch capabillities. (Never used it).
    Quote Quote  
  7. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    Originally Posted by ProWo View Post
    VideoReDo, or MKV Cutter.
    MKV Cutter is excellent, but (as of 2019) didn't do batch files - it is very fast.
    Quote Quote  
  8. mkv toolnix / mkvmerge , you need the segmented file option, there is a good help present in the programm, mind you , it only cuts on keyframes , so not exactly 7 secconds but close enough.
    Quote Quote  



Similar Threads

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