[mythtv-users] MP4/H264 file and problems with 10-second rewind

Joey Morris rjmorris at nc.rr.com
Wed Dec 28 03:25:37 UTC 2011


Joey Morris <rjmorris at nc.rr.com> wrote on Fri, Dec 23, 2011 at 06:02:52PM -0500:
> I bought the Louis CK standup special that he's selling from his
> website and dropped it into MythVideo (0.24.1+fixes). It mostly plays
> fine. However, the elapsed time counter moves at about half of real
> time. For example, if I start the video and let it play for 10
> minutes, the elapsed time shows just 5 minutes. Also, if I use the
> left arrow key to skip back 10 seconds, it actually skips back several
> minutes.
> 
> I'm not sure how to debug this, but I did inspect the file with
> ffmpeg -i. Here is the output:
> 
> Seems stream 0 codec frame rate differs from container frame rate:
>     47952.00 (47952/1) -> 23.98 (2997/125)
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
>     'Louis CK Live at the Beacon Theater 2011.mp4':
>   Metadata:
>     major_brand     : mp42
>     minor_version   : 1
>     compatible_brands: mp42mp41
>     creation_time   : 2011-12-09 16:04:07
>   Duration: 01:02:43.17, start: 0.000000, bitrate: 2550 kb/s
>     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661),
>         yuv420p, 1280x720, 2354 kb/s, 23.98 fps, 23.98 tbr, 23976 tbn,
>         47952 tbc
>     Metadata:
>       creation_time   : 2011-12-09 16:04:07
>       handler_name    : Apple Video Media Handler
>     Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16,
>         191 kb/s
>     Metadata:
>       creation_time   : 2011-12-09 16:04:07
>       handler_name    : Apple Sound Media Handler
> 
> I suspect this is a frame rate problem similar to the one discussed
> recently in http://www.gossamer-threads.com/lists/mythtv/users/497615.
> A solution was found for that problem, requiring edits to the file's
> metadata, but that was for an mkv.
> 
> Does anyone have advice for how I can fix the frame rate on my mp4
> file? Or, do you think there might be other causes for the problem I'm
> seeing?

After playing around with this for a while, I think I've fixed it.

At first I tried demuxing the mp4 into its separate video and audio
streams, and then remuxing into a container with hopefully the right
frame rate. For demuxing, I tried both ffmpeg and mencoder. For
remuxing, I tried to create an mp4 using both ffmpeg and mencoder, and
I tried to create an mkv using mkvmerge. No matter what I tried, my
final file was bad. It either wouldn't play at all or had no video.

Finally, I decided to skip the demuxing step and instead opened the
original mp4 in mkvmerge's GUI. I left all the settings at their
defaults, including FPS, which was blank. So far, I haven't seen any
problems when playing the resulting mkv in MythVideo. The elapsed time
counter advances at the correct rate, and skipping around in the file
works fine.


More information about the mythtv-users mailing list