English 中文(简体)
remuxing mpv files from h264 AVI files
原标题:
  • 时间:2009-12-15 03:18:48
  •  标签:
  • mp4
  • h.264

I have a bunch of, I think, x264 encoded AVIs that I d like to convert to m4v so that I can play with Quicktime. Here s how I created them

First I dump the vob from DVD with this:

$ mplayer -dumpstream -dumpfile new.vob dvd://1

Then I compress it:

$ mencoder -oac copy -o new.avi -ovc x264 -x264encopts crf=18 new.vob

I tried doing this to convertthem to m4v, but it s blowing up...

I tried dumping the h264/acc streams:

$ mplayer new.avi -dumpvideo -dumpfile new.h264
$ mplayer new.avi -dumpaudio -dumpfile new.acc

And remuxing(?) with MP4Box but I m getting an error:

$ MP4Box -add new.h264#video -add new.aac#audio new.m4v
Cannot find H264 start code
Error importing new.h264#video: BitStream Not Compliant

So not sure what to do now...

问题回答

If I were you, I would just use ffmpeg. ffmpeg has a magic ‘codec’ called copy which simply copies the content, rather than re-encoding, which is useful for precisely your use case — changing container without re-encoding.

From the ffmpeg man page:

-vcodec codec

Force video codec to codec. Use the "copy" special value to tell that the raw codec data must be copied as is.

-acodec codec

Force audio codec to codec. Use the "copy" special value to specify that the raw codec data must be copied as is.

So, to put this into practice:

$ ffmpeg -i new.avi -acodec copy -vcodec copy new.m4v

I use this technique for reformatting H.264 videos inside an FLV container into an MP4 container, which drastically improves lip sync in some cases.

You should use handbrake.





相关问题
H264 RTP packet parsing [closed]

I am looking for source code of RTP Payload Format for H.264 Video according to RFC(3984). It would be great if someone can point out it. Also I am looking for wireshark plugin which can show me the ...

Learn Nvidia CUDA

I am C++ programmer that develop image and video algorithims, should i learn Nvidia CUDA? or it is one of these technlogies that will disappear?

Hardware accelerated video in DirectShow / WinForms

Currently prototyping a Windows .NET app that needs to play back high definition WMV and H264 video. My test files are full 1080p. The target hardware has weak Atom processors but strong NVidia 9400 ...

Retrieving metadata from x264?

I am trying to exctract the meta data from x264-encoded video files. First priority is to map the IDR-frames structure. The work seams to be harder than expected and I am trying to find command line ...

remuxing mpv files from h264 AVI files

I have a bunch of, I think, x264 encoded AVIs that I d like to convert to m4v so that I can play with Quicktime. Here s how I created them First I dump the vob from DVD with this: $ mplayer -...

Get the dimensions of a H.264 MP4

Does anybody know a ready-made, reliable way to tell the dimensions (width x height) of a MP4 encoded using the H.264 codec without ffmpeg or similar extensions, in pure PHP? Thanks for all the ...

热门标签