[FFmpeg-user] encoding mp4s so that it starts with keyframe

Tarun singhal tsinghal18 at gmail.com
Mon Jun 3 08:13:44 CEST 2013


Regards,
Tarun Singhal

Associate Software Engineer

Accenture - India
( - +91-8105061683 | *  tsinghal18 at gmail.com


On Mon, Jun 3, 2013 at 12:03 AM, Gabri Shally <gabri.ns at gmail.com> wrote:

> "Tarun singhal" <tsinghal18 at gmail.com> wrote:
> >
> > oh sorry for typo
> > How can i transcode mp4 so that it video starts with keyframe
> >
> still, whatever that means......
>
> for block coding video codec, the first frame will always be a keyframe,
> since it needed to decode other frames, namely P-frame n B-frame.
>
> you should explain what you are trying to do, and what you has "already"
> try, by providing command line and console output.
> that is first norm that you broke. the second is, you are top posting, in
> which it considered rude here.
>
> regard,
> gabri
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>

 Oh My bad, I didnt do that on purpose -

 My objective is to create DASH package using ffmpeg and mp4box in
conjuction
 Source file: http://statustreat.com/privatestream/flight_master.mp4<http://www.linkedin.com/redirect?url=http%3A%2F%2Fstatustreat%2Ecom%2Fprivatestream%2Fflight_master%2Emp4&urlhash=tyHb&_t=tracking_disc>



1) ffmpeg -i flight_master.mp4 -f mp4 -r 24 -vcodec libx264 -preset fast
-profile:v high -an -s 1280x720 -aspect 16:9 -b:v 3000k -map 0:0 -map 0:1
-b:a 128k -ar 44100 -ac 2 -maxrate 3080k -minrate 2920k -bufsize 6000k
-acodec aac -strict experimental -x264opts keyint=25:min-keyint=25:sps-id=1
-keyint_min 25 -g 25 -flags +cgop -sc_threshold 0 -pix_fmt yuv420p -threads
0 -y flight_3000.mp4

2) ffmpeg -i flight_master.mp4 -f mp4 -r 24 -vcodec libx264 -preset fast
-profile:v high -an -s 640x360 -aspect 16:9 -b:v 1000k -map 0:0 -map 0:1
-b:a 128k -ar 44100 -ac 2 -maxrate 1080k -minrate 920k -bufsize 2000k
-acodec aac -strict experimental -x264opts keyint=25:min-keyint=25:sps-id=2
-keyint_min 25 -g 25 -flags +cgop -sc_threshold 0 -pix_fmt yuv420p -threads
0 -y flight_1000.mp4

3) ffmpeg -i flight_master.mp4 -f mp4 -r 24 -vcodec libx264 -preset fast
-profile:v high -an -s 320x180 -aspect 16:9 -b:v 600k -map 0:0 -map 0:1
-b:a 128k -ar 44100 -ac 2 -maxrate 680k -minrate 520k -bufsize 1200k
-acodec aac -strict experimental -x264opts keyint=25:min-keyint=25:sps-id=3
-keyint_min 25 -g 25 -flags +cgop -sc_threshold 0 -pix_fmt yuv420p -threads
0 -y flight_600.mp4

MP4BOX command: mp4box -dash 20000 -frag 2000 -segment-name flight_test_%s
-segment-ext mp4 -rap -url-template -out flight.mpd flight_600.mp4
flight_1000.mp4 flight_3000.mpd

When I played mpd file on chrome browser using DASH player, I get following
error:
*pipeline_state: kStopped
url: blob:http%3A//dashif.org/fcca1029-ba6e-430d-ab9d-ca3ed3ff7821
error: Media segment did not begin with keyframe.
duration: 151.625
pipeline_error: pipeline: decode error
seek_target: 0 *
*
*
I hope now everyone is now very clear about question.
*
*
*Thanks,*
*Tarun Singhal*
*
*


More information about the ffmpeg-user mailing list