FORUMS: list search recent posts

video twice audio speed

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Peter Kerr
video twice audio speed
on Feb 19, 2013 at 8:42:34 am

Hi

My process is (.mp4 from gopro cam)-->(separate .h264 and ac3 streams)-->mux to .m2ts

ffmpeg(ver 0.8.12) does step 1 and tsMuxer does step 2 (under Linux)

ffmpeg -i IN.MP4 -s hd1080 -an -vcodec libx264 -vpre baseline -b 30M -r 50 OUT.h264

When I play the final .m2ts the video runs about 2x too fast, audio OK.

Checking the various stages with ffprobe and pulling out what look like the relevant parameters, gives:

Column 1: the original Gopro .mp4
Column 2: the .h264 video stream from ffmpeg (see command above)
Column 3: the final muxed .m2ts file from tsMuxer
Column 4: a .MTS file from a JVC camera - which works for my further processing

File/ Original ffmpeg tsMuxer JVC camera
Param mp4 .h264 .m2ts .MTS
codec_time_base 1/100 1/100 1/100 1/50
r_frame_rate 50/1 100/2 50/1 50/1
av_frame_rate 50/1 50/1 50/1 50/1
time_base 1/180,000 1/1,200,000 1/90,000 1/90,000
video speed OK OK approx 2x OK


It seems plausible that tsMuxer is messing it up by picking up just the numerator of r_frame_rate in column 2, but this program is not under development and source is not available.

Is there a way I can get ffmpeg to make me an h264 video stream with the same parameters as column 4, thus giving tsMuxer the best chance of success? (I've tried -r 50/1 , -copytb, -copyts, which had no effect.)

Thanks for any help or pointers!


Return to posts index

Reuben Martin
Re: video twice audio speed
on Feb 19, 2013 at 9:00:32 pm

First, try updating ffmpeg. The version you are using is quite old.

Secondly, try using MP4Box to mux the ts and see it that works any better. You could probably re-mux it directly from mp4 to ts that way.

The 1/90,000 is probably being used because that is what is compatible with RTP.


Return to posts index

Peter Kerr
Re: video twice audio speed
on Feb 20, 2013 at 4:01:29 am

I thought someone might say my ffmpeg looked long in the tooth! I managed, eventually, to download and compile the latest ffmpeg and x264 sources, but I still get the same funny parameters, including r_frame_rate 100/2 and timebase 1/1,200,000.

Unfortunately the only tool I can find which will mux to .m2ts is tsMuxer. As far as I can see MP4Box does only do what its name says.

I've tried looking at x264 encoding guides but there don't seem to be any options relating to the parameters I'm interested in except -r 50/1 which is still giving the same output as -r 50.

If I could find where in the .h264 file the r_frame_rate.num and .den values are stored I could try a hack and overwrite them with 50 and 1, but I can't find X00640002 (2 byte int) or X0000006400000002 (4 byte int) in the file. I suppose I could eventually work it out from tracing the code in ffprobe.

All very frustrating. The key to this is no doubt understanding just why ffmpeg is choosing such strange values for r_frame_rate and timebase in the first place.


Return to posts index


Reuben Martin
Re: video twice audio speed
on Feb 20, 2013 at 6:05:57 pm

Sorry. Brain fart.

Replace MP4Box with ffmpeg. ffmpeg should be able to mux m2ts directly. I was going to suggest trying to dump the h264 stream using MP4Box, but I doubt that would make any difference.


Return to posts index

Peter Kerr
Re: video twice audio speed
on Feb 21, 2013 at 6:54:49 am

My newly compiled latest ffmpeg does indeed mux to .m2ts, but alas, I still get the same double speed video; but at least now I can post it as a bug in ffmpeg. Thanks for your help.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]