VideoHelp Forum




+ Reply to Thread
Results 1 to 10 of 10
  1. Hello, thanks for the help in advance. I am trying to split videos in 1 second intervals. I am using the program batch video splitter. In my notes TEST1 splits perfectly in 1 second intervals. However in Test1 is splitting it out in the 10 second intervals instead of 1. I have used multiple video splitting programs, and I can only get to 10 seconds. Could anybody please help me convert the video to the correct format. Looking to convert my video to Test 2 Videos in the documents. Thanks

    https://files.videohelp.com/u/303238/Test1.txt

    https://files.videohelp.com/u/303238/Test2.txt
    Quote Quote  
  2. Originally Posted by dolomite41 View Post
    Hello, thanks for the help in advance. I am trying to split videos in 1 second intervals. I am using the program batch video splitter. In my notes TEST1 splits perfectly in 1 second intervals. However in Test1 is splitting it out in the 10 second intervals instead of 1. I have used multiple video splitting programs, and I can only get to 10 seconds. Could anybody please help me convert the video to the correct format. Looking to convert my video to Test 2 Videos in the documents. Thanks

    https://files.videohelp.com/u/303238/Test1.txt

    https://files.videohelp.com/u/303238/Test2.txt

    The smallest timeframe that you can split while copying the video depends on where the keyframes are placed in the source video. eg. If they are placed at 10 seconds apart - 10 seconds is the miniumum timeframe that you can split without re-encoding. The reason is many frames are incomplete and use temporal compression - they rely on data from other frames, so you cannot cut where ever you want, unless all frames are IDR-frames (true keyframes)

    You can test this in avidemux and navigate foward by keyframes (the ">>" button in the GUI, or up arrow key). If it jumps 10 seconds you have your answer - the problem is your video. You would have to re-encode to create smaller divisions (lose quality, unless you use a lossless codec, but that will increase the filesize by many times)
    Quote Quote  
  3. Originally Posted by poisondeathray View Post
    Originally Posted by dolomite41 View Post
    Hello, thanks for the help in advance. I am trying to split videos in 1 second intervals. I am using the program batch video splitter. In my notes TEST1 splits perfectly in 1 second intervals. However in Test1 is splitting it out in the 10 second intervals instead of 1. I have used multiple video splitting programs, and I can only get to 10 seconds. Could anybody please help me convert the video to the correct format. Looking to convert my video to Test 2 Videos in the documents. Thanks

    https://files.videohelp.com/u/303238/Test1.txt

    https://files.videohelp.com/u/303238/Test2.txt

    The smallest timeframe that you can split while copying the video depends on where the keyframes are placed in the source video. eg. If they are placed at 10 seconds apart - 10 seconds is the miniumum timeframe that you can split without re-encoding. The reason is many frames are incomplete and use temporal compression - they rely on data from other frames, so you cannot cut where ever you want, unless all frames are IDR-frames (true keyframes)

    You can test this in avidemux and navigate foward by keyframes (the ">>" button in the GUI, or up arrow key). If it jumps 10 seconds you have your answer - the problem is your video. You would have to re-encode to create smaller divisions (lose quality, unless you use a lossless codec, but that will increase the filesize by many times)

    Thanks for your answer. What is the best program to use to re-encode and what should all my parameters be? Sorry New to this and trying to learn. Im not really worried about the file size, since they will be 1sec clips. Thanks
    Quote Quote  
  4. One way to do it would be to re-encode with 1 sec keyframes, then use whatever batch video splitters you used earlier. Since you have 23.976p video, a max keyframe interval of 24 would be 1 second. You can set it smaller if you want higher precision cutting: eg. -g 12 would be half second for 23.976p video

    You could use ffmpeg; in ffmpeg -g is the max keyframe interval. There are some ffmpeg GUI's but I'm not up to date on the various ffmpeg GUIs

    Code:
    ffmpeg -i input.mp4 -c:v libx264 -ref 4 -crf 18 -g 24 -c:a copy output.mp4
    You can vary the crf value , lower means larger filesize, higher quality. For 8bit 4:2:0 video like yours, crf 0 is lossless, but some devices, software might have problems playing lossless video - it depends on the background information and why you are doing this

    Another way to do it in 1 step directly (in theory) would be to split and encode directly in ffmpeg using -f segment ; but I've never gotten it to work correctly
    https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment
    Quote Quote  
  5. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    What is the -ref 4 option ?
    Quote Quote  
  6. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    It's a reference frame which is used to define future frames.
    I think,therefore i am a hamster.
    Quote Quote  
  7. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Thanks.

    So its a B or P frame ?
    Quote Quote  
  8. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Google video reference frame,it will tell you more.
    I think,therefore i am a hamster.
    Quote Quote  
  9. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Ok. So as I now understand it, reference frames can be I frames or P frames. https://blog.video.ibm.com/streaming-video-tips/keyframes-interframe-video-compression/

    The P frame can look back to an I frame or a P frame.
    The B frame can look back or forward to an I frame or a P frame.

    There is also this … https://en.wikipedia.org/wiki/Reference_frame_%28video%29
    “ Some modern video encoding standards, such as H.264/AVC, allow the use of multiple reference frames. This allows the video encoder to choose among more than one previously decoded frame on which to base each macroblock in the next frame. While the best frame for this purpose is usually the previous frame, the extra reference frames can improve compression efficiency and/or video quality. Note that different reference frames can be chosen for different macroblocks in the same frame. The maximum number of concurrent reference frames supported by H.264 is 16. Different reference frames can be chosen for each 8x8 partition of a macroblock.”

    Recommended default: -refs 6 … https://help.encoding.com/knowledge-base/article/advanced-configuration-options-for-th...4-video-codec/
    Last edited by JN-; 7th Oct 2023 at 18:36.
    Quote Quote  
  10. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    The reason I queried this -ref option is I have never previously used it in any ffmpeg syntax. Perhaps there’s a built in default value.
    Quote Quote  



Similar Threads

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