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,
Linux* FFmpegMultimedia ProgrammingProgramming Languages-Other

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon
David Favor

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.
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,

David Favor

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.
Your help has saved me hundreds of hours of internet surfing.
fblack61
Dinesh Bali

ASKER
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,
David Favor

Mention a rough time in the video where you see this artifact/glitch.
Dinesh Bali

ASKER
At 0 sec, just at a start.

Kind regards
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
David Favor

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.
Dinesh Bali

ASKER
Many thanks David

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

Please advise.

Kind Regards,

ASKER CERTIFIED SOLUTION
David Favor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dinesh Bali

ASKER
Many Thanks David. Let me try. If any issues. I will come back to you on another question.

Kind Regards,
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
David Favor

You're welcome!