Link to home
Start Free TrialLog in
Avatar of Dinesh Bali
Dinesh Bali

asked on

Video freeze at start for a sec using ffmpeg

Hi,

I am splitting video using ffmpeg with command
ffmpeg -ss 60 -i Episode10_RmvAdVi_1_6299.mp4 -to 120 -c:v copy -c:a copy Episode10_RmvAdVi_1_6299_1.mp4

Open in new window


The output video is freezing for 1 sec. Please help how to resolve this.

Video's are available here
https://drive.google.com/drive/folders/1SLsrRUjyGH3eM7Oe3cptU_YPkga7EoCO?usp=sharing

Please advise

Kind Regards,
Avatar of David Favor
David Favor
Flag of United States of America image

Likely cause is the 60 second mark (-ss 60) is either a an I or P frame, with a large time gap till next B frame.

This means you'll see... well... no telling what... till you hit the next B frame, so if the time gap is long you might see all white, all black, gibberish...

You might also try using -t 60, as the -t + -to logic might run differently internally.

Using -t (duration), seems like ffmpeg somehow handles the gaps correctly, so first frame is always correct.

Or at least, using -t, I've never seen the problem you describe.
Avatar of Dinesh Bali
Dinesh Bali

ASKER

Thanks David

As I understand that I need to use -t instead of -to. Below is my updated command. Still I see the same issue.

ffmpeg -ss 60 -i Episode10_RmvAdVi_1_6299.mp4 -t 120 -c:v copy -c:a copy Episode10_RmvAdVi_1_6299_2.mp4

Open in new window


I have uploded the video at url:
https://drive.google.com/drive/folders/1SLsrRUjyGH3eM7Oe3cptU_YPkga7EoCO?usp=sharing

Please advise

Kind Regards,

Let' see...

1) Footage looks good...

imac> avinfo Episode10_RmvAdVi_1_6299.mp4
Episode10_RmvAdVi_1_6299.mp4
   length: 00:04:01.34, start: 0.000000, bitrate: 3170 kb/s
   stream: #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt470bg), 720x576 [SAR 128:117 DAR 160:117], 2987 kb/s, SAR 787:720 DAR 787:576, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
   stream: #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)

Open in new window


2) After using your slice operation, I seen no 1 second freeze.

ffmpeg -ss 60 -i Episode10_RmvAdVi_1_6299.mp4 -t 120 -c:v copy -c:a copy foo.mp4

Open in new window

Checked clip beginning, entire clip played, end of clip.

No noticeable freeze for me.

3) Maybe mention exactly where you're seeing the freeze.

4) This might relate to your playback software also.

Seems like you mentioned in a previous question you're using VLC, which is same I'm using.

So if you're using something besides VLC, try VLC.
Hi David,

I was using windows media player. I have downloaded VLC now.
In office, we use VLC.

I am seeing issue in output video Episode10_RmvAdVi_1_6299_2.mp4

Please can you check if it is fine with you.

Kind Regards,
Mention a rough time in the video where you see this artifact/glitch.
At 0 sec, just at a start.

Kind regards
The only artifact I see at the 0 second mark is the video start, which has a small jump for first frames to render.

If you've extracted this footage from a longer clip (what it looks like has happened), then you'll likely always see a jump like this.

To... cover this... use a short (few seconds) of fade in of video, while audio plays at full volume.
Many thanks David

What changes  need to make in my command to give the fade effect.

Please advise.

Kind Regards,

ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Many Thanks David. Let me try. If any issues. I will come back to you on another question.

Kind Regards,
You're welcome!