[FFmpeg-user] Lossless cut from a h264 video with audio

DopeLabs dopelabs at dubstep.fm
Wed Oct 10 19:30:56 EEST 2018


try this one...


/usr/bin/env ffmpeg -y -ss 0:03:18  -i cook.mp4 -t 0:00:10 -c copy cook-start.mp4 &> cook-start.txt



> On Oct 10, 2018, at 8:44 56AM, Samat Galimov <s at samat.me> wrote:
> 
> Hello,
> 
> tl;dr: Q: is there a way to cut a 10 second clip from a h264 video (downloaded from youtube) to later use it in web browsers with no quality loss?
> 
> What I have tried so far: http://alpha.rawg.io/question/
> 
> Long version:
> 
> My inputs are http://alpha.rawg.io/question/cook.txt <http://alpha.rawg.io/question/cook.txt>
> 
> My first attempt is to opt-in for copy codecs using the following command:
> 
> 	/usr/bin/env ffmpeg -y -ss 0:03:18 -t 0:00:10 -i cook.mp4 -c copy cook-start.mp4 &> cook-start.txt
> 
> What I've got is:
> - Safari: audio/video sync is OK, beginning is OK, but additional 3 seconds of audio without video in the end
> - Chrome: audio/video is out of sync
> 
> Then I tried to specify -ss as an output option:
> 
> 	/usr/bin/env ffmpeg -y -i cook.mp4 -ss 0:03:18 -t 0:00:10 -c copy cook-end.mp4 &> cook-end.txt
> 
> Safari & Chrome: first 3 seconds have no video, but audio only.
> 
> 
> Is there a clever trick to overcome this apparent keyframe location issue while not re-encoding videos? 
> 
> If there is no way to avoid re-encoding, what options should I use to minimise quality loss?
> 
> Here is the webpage to check out my results & source files: https://alpha.rawg.io/question/ <https://alpha.rawg.io/question/>
> 
> Thank you very much in advance.
> 
> Samat.
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list