[mythtv-users] Little gems on MythTV wiki

Christopher Meredith chmeredith at gmail.com
Mon Feb 22 15:11:47 UTC 2010


On Mon, Feb 22, 2010 at 8:50 AM, Brent Bolin <brent.bolin at gmail.com> wrote:
> On Mon, Feb 22, 2010 at 8:41 AM, Brent Bolin <brent.bolin at gmail.com> wrote:
>> On Mon, Feb 22, 2010 at 8:21 AM, Christopher Meredith
>> <chmeredith at gmail.com> wrote:
>>> On Mon, Feb 22, 2010 at 8:12 AM, Brent Bolin <brent.bolin at gmail.com> wrote:
>>>> On Mon, Feb 22, 2010 at 7:44 AM, Christopher Meredith
>>>> <chmeredith at gmail.com> wrote:
>>>>> On Mon, Feb 22, 2010 at 7:24 AM, Brent Bolin <brent.bolin at gmail.com> wrote:
>>>>>> Ran across this info -
>>>>>>
>>>>>> Did you know you can merge two MPG files together?
>>>>>> cat File1 File2 > Merged File-name.
>>>>>>
>>>>>> Doesn't appear to work.  I have a couple of DVD's that are on two
>>>>>> disks.  Currently have them as video.name.disk1.mpg and
>>>>>> video.name.disk2
>>>>>>
>>>>>> So I tested to see what would happen.
>>>>>>
>>>>>> Here is a snippet of what I see in  mythfrontend.log
>>>>>>
>>>>>> 2010-02-22 07:10:06.282 [h264 @ 0x40646e0]AVC: nal size 1315803467
>>>>>> 2010-02-22 07:10:06.282 [h264 @ 0x40646e0]no frame!
>>>>>> 2010-02-22 07:10:06.282 [h264 @ 0x40646e0]AVC: nal size -1686999763
>>>>>> 2010-02-22 07:10:06.283 [h264 @ 0x40646e0]no frame!
>>>>>> 2010-02-22 07:10:06.283 [h264 @ 0x40646e0]AVC: nal size -645962405
>>>>>> 2010-02-22 07:10:06.283 [h264 @ 0x40646e0]no frame!
>>>>>> 2010-02-22 07:10:06.283 [h264 @ 0x40646e0]AVC: nal size 1296261589
>>>>>> 2010-02-22 07:10:06.283 [h264 @ 0x40646e0]no frame!
>>>>>> 2010-02-22 07:10:06.284 [h264 @ 0x40646e0]AVC: nal size -1383481424
>>>>>> 2010-02-22 07:10:06.284 [h264 @ 0x40646e0]no frame!
>>>>>> 2010-02-22 07:10:06.333 AFD: Opened codec 0xaed1df70, id(H264) type(Video)
>>>>>> 2010-02-22 07:10:06.334 AFD: codec AAC has 2 channels
>>>>>> 2010-02-22 07:10:06.348 AFD: Opened codec 0xac9e8a90, id(AAC) type(Audio)
>>>>>> 2010-02-22 07:10:06.348 AFD: codec AC3 has 2 channels
>>>>>> 2010-02-22 07:10:06.350 AFD: Opened codec 0xac9e9010, id(AC3) type(Audio)
>>>>>> 2010-02-22 07:10:06.350 AFD Error: Could not find decoder for codec
>>>>>> (Unknown Codec ID), ignoring.
>>>>>> 2010-02-22 07:10:06.398 AFD: Opened codec 0xacdaad20, id(H264) type(Video)
>>>>>> 2010-02-22 07:10:06.398 AFD: codec AAC has 2 channels
>>>>>> 2010-02-22 07:10:06.399 AFD: Opened codec 0xacdab2a0, id(AAC) type(Audio)
>>>>>> 2010-02-22 07:10:06.399 AFD: codec AC3 has 2 channels
>>>>>> 2010-02-22 07:10:06.400 AFD: Opened codec 0xacdab820, id(AC3) type(Audio)
>>>>>> 2010-02-22 07:10:06.400 AFD Error: Could not find decoder for codec
>>>>>> (Unknown Codec ID), ignoring.
>>>>>> 2010-02-22 07:10:06.423 Opening audio device 'spdif'. ch 2(2) sr 48000
>>>>>> 2010-02-22 07:10:06.423 Opening ALSA audio device 'iec958:{ AES0 0x02 }'.
>>>>>> 2010-02-22 07:10:06.601 Opening audio device 'spdif'. ch 2(2) sr 48000
>>>>>> 2010-02-22 07:10:06.601 Opening ALSA audio device 'iec958:{ AES0 0x02 }'.
>>>>>> 2010-02-22 07:10:06.667 VideoOutputXv: XVideo Adaptor Name: 'NV17 Video Texture'
>>>>>> 2010-02-22 07:10:06.737 OSD Theme Dimensions W: 1280 H: 720
>>>>>> 2010-02-22 07:10:07.910 TV: StartPlayer(0, Watching Video, main) -- end ok
>>>>>> 2010-02-22 07:10:07.911 New DB connection, total: 3
>>>>>> 2010-02-22 07:10:07.912 New DB connection, total: 4
>>>>>> YadifDeint: In-Pixformat = 1 Out-Pixformat=1
>>>>>> YadifDeint: size changed from 0 x 0 -> 720 x 432
>>>>>> YadifDeint: Using existing thread.
>>>>>> 2010-02-22 07:10:07.920 OpenGLVideoSync()
>>>>>> 2010-02-22 07:10:07.982 Video timing method: SGI OpenGL
>>>>>> 2010-02-22 07:10:09.848 NVP(0): Prebuffer wait timed out 10 times.
>>>>>> 2010-02-22 07:10:11.731 NVP(0): Prebuffer wait timed out 20 times.
>>>>>>
>>>>>> The two video files were created using Handbrake with High Profile setting.
>>>>>>
>>>>>> filetype shows -
>>>>>>
>>>>>>  file ap*
>>>>>> apocalypse.now.disk1.mpg: setgid ISO Media, MPEG v4 system, version 2
>>>>>> apocalypse.now.disk2.mpg: setgid ISO Media, MPEG v4 system, version 2
>>>>>>
>>>>>> So I guess this doesn't work.
>>>>>
>>>>> Yeah, you can't do that with H264, only MPEG2. To concatenate those
>>>>> recordings you have to do:
>>>>> mencoder -oac copy -ovc copy -forceidx apocalypse.now.disk1.mpg
>>>>> apocalypse.now.disk2.mpg -o apocalypse.now.mpg
>>>>>
>>>>> Also, you should use either the mp4 or mkv containers for H264
>>>>> recordings made with Handbrake. In that case, you could also use
>>>>> either mkvmerge or MP4Box to easily concatenate files.
>>>>> _______________________________________________
>>>>> mythtv-users mailing list
>>>>> mythtv-users at mythtv.org
>>>>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>>>>
>>>>
>>>> Does "Also, you should use either the mp4 or mkv containers for H264"
>>>> make a quality difference?
>>>
>>> None at all. But modern container formats are more efficient and
>>> introduce greater possibilities. At least Matroska allows multiple
>>> streams, embedded subtitles, chapters, attachments, etc. It can also
>>> reduce confusion (such as here) where you're working with data that is
>>> not typically found in a .mpg file.
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users at mythtv.org
>>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>>
>>
>> Thanks for your quick reply.  Can you give me the cli syntax to join 2
>> mp4 video files together.  There are many arguments for this command.
>>
>
> Sorry should have been more clear.  You give three commands or
> transcoders to do this
>
> mencoder
> mkvmerge
> MP4Box
>
> Is mencoder a subset of these or something?
>
> I installed mkvmerge.  mencoder is already installed

You may want to do some background reading on the differences between
audio/video codecs and container formats. Basically, what you have
done is transcoded your DVD using two codecs (H264 for video and AAC
for audio). But a movie file is more than just the video and audio
data. These two streams are "muxed" together in a container. Matroska
(MKV) is one such container, so is MP4. mencoder is used primarily to
change (transcode) data from one codec to another. Container tools
such as mkvmerge and MP4Box are used to manipulate the container
formats once they're created.

Think of it this way. In addition to the audio/video data, the
computer needs to know how to handle it. It needs to know how fast to
play video (framerate) and it needs to know how to align audio and
video. This is what the container does. Using the 'cat' command simply
writes the data of the two files end-to-end. With advanced codecs like
H264 and AAC, you can't do this because the container isn't updated
and it doesn't know who to do with that raw data at the end. MPEG2
doesn't have this problem because it technically doesn't need a
container. That's also why it tends to be so large.

So if you had transcoded the DVD to two mp4 files, you could use
MP4Box to simply concatenate the data and re-write the container
information. Same thing for mkv and mkvmerge. Now you can also use
MP4Box and mkvmerge to change container formats. For example, try
'mkvmerge videofile1.mpg -o videofile1.mkv' As long as mkvmerge finds
a stream that can be put in a Matroska container, it will work.
mkvmerge can also be used to specify aspect ratio, framerate,
chapters, etc. without modifying the included video stream. Changing
framerate is as easy as changing a container value.

I hope this helps!


More information about the mythtv-users mailing list