h.264 encapsulation in MPEG2 TS

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
david88

h.264 encapsulation in MPEG2 TS

Postby david88 » 19 Oct 2004 16:45

Hello,

I need to generate a stream of h.264 encapsulated in MPEG2 TS. Does VLC support this encapusulation?

Thanks.

David

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: h.264 encapsulation in MPEG2 TS

Postby fkuehne » 19 Oct 2004 17:47

Yes, VLC does support both the encoder for h.264 and the MPEG-TS encapsulation format. The only problem is that, you cannot access the h.264-codec through a GUI. You need to do that through the command-line (the needed token is called "h264").
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

Guest

Postby Guest » 19 Oct 2004 18:13

Hi Fkuehne,

That's great!!

Then I have some questions about this.

1. Which version of VLC is the best one I can use for this purpose? 0.7.2 release or latest test release.

2. How to use these command-line? Is there any doc about this?

Looking forward to your response.

Thank you.

David

Guest

Postby Guest » 19 Oct 2004 18:24

I found some info about commend line in chapter 4 of VLC user guide.

But I still need to know which version of VLC is better for this.

Thanks.

David

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 19 Oct 2004 19:31

0.8.0-test2 is best this far

Guest

Postby Guest » 19 Oct 2004 20:47

Hello sigmund,

I installed VLC version 0.8.0-test2.

To test what I am doing is correct, I used following command line to put a mpeg2 ES "input_test.vid" to mpeg2 TS

vlc -vvv input_test.vid --sout '#es{ access_video=file,mux_video=ts,url_video=video-%c.%m}'

but nothing happened.

I can do the same thing via GUI successfully.

Is the command line and module I am suing correct? What's the output name I should have and where it goes?

Is the source code of version 0.8.0-test2 available? I could not find it from download page.

Thank you!

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Postby fkuehne » 19 Oct 2004 21:58

Your mrl does not work due to the fact that the syntax changed since the 0.7.2 release and the VLC user guide hasn't been updated yet (we are already working on an updated variant of the docs). Please have a look at the following mrl. The comments between these [] brackets should help you, what to put where.

Code: Select all

sout=#transcode{vcodec="[your video codec]",vb="[your video bitrate]",scale="[the video scale]",acodec="[your audio codec]",ab="[your audio bitrate]"}:std{access=[your access module/streaming method],mux=[your encapsulation format],url="[the target url (if needed)]"}
To figure out good and useable mrls, the GUI can be quite helpful. You just cannot choose H.264 as vcodec and need to change that part later on.

The 0.8.2-test2 source code is available here, but I strongly recommend you to use a more recent version of the source, since many bugs have been solved since this release. You can check out the latest source-code through svn (Subversion, available here) or daily snapshots, which can be found here. You can find good documentation on compiling VLC (which isn't quite easy) on the developer's page.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

Guest

Postby Guest » 19 Oct 2004 22:08

Thank you very much! I'll try.

Guest

Postby Guest » 19 Oct 2004 22:59

Hi,

I tried. Unfortunately, It doesn't work.

I am not clear in following points.

1. What I need is to Encapsulate a stream (either h.264 raw data or other ES) into MPEG2 TS. Both input and output are file format.

For this purpose, previous doc shows that "es" is required. Your mrl shows "#transcode module followed by "standard". From GUI, encapsulation and transcoding are two seperate menus, and transcoding is not needed for encapsulation. I am a bit confused about this. I may not make it clear what I need at first step. If I do need module "es", could you please let me know the new syntax for using "es".

2. Field access=[your access module/streaming method]
I need to put access = file, it that right?

Here is what I tried in my DOS terminal, and it did not generate anything (0.8.0-test2). test_input.vid is video only ES, so ignore audio part.

>vlc -vvv test_input.vid sout=#transcode{vcodec="mp2v",vb="1024",scale="1"}:std{access=file,mux=ts}

Thank you very much for the help!

David

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Postby fkuehne » 19 Oct 2004 23:42

1. What I need is to Encapsulate a stream (either h.264 raw data or other ES) into MPEG2 TS. Both input and output are file format.
I was unsure about the fact that your files are already H.264. Transcoding is only needed, if they aren't, but you want to stream through this codec. Ok, so you don't need it.
2. Field access=[your access module/streaming method] I need to put access = file, it that right?
No, that's wrong. This "access"-field (although it is called access) describes in fact the output-module in this case. If you enter "file", VLC streams to a file and not to the network. To make streaming-to-file work, you need to give a path too. Since you hadn't done that, VLC did not react at all.
To stream to a network, you need to give a valid module-name. Available modules are "http", "rtp", "udp" and "mmsh". If you stream on a local network, you should use "udp", because it sends the stream through multicast, which is very efficient, since the stream gets send only once for an unlimited number of users. Please click on the tokens for more information. Please keep in mind that you need to give also an address/url when streaming over a network. You can find a pretty introduction on streaming with VLC on the documentation page btw (called "Streaming with wxwindows interface"). Although it is written for the WxWindows-Interface, certain basic expressions and concepts are explained really good.

Here's a simple mrl for streaming through a network without transcoding:

Code: Select all

sout=#std{access=[access-module, preferable "udp"],mux=[encapsulation-format, should be "ts" (without the quotes) in your case],url="[url incl. port]"} file://[Path to your to-be-streamed file]
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

Guest

Postby Guest » 20 Oct 2004 01:18

Thanks for the reply!

I am using VLC version 0.8.0-test2.

You gave me the syntax for streaming through a network. Could you give me the syntax for streaming to a file?

Input is a file of raw h.264 data. Output is also a file which would contain h.264 encapsulated in MPEG2 TS. I played the code you just gave me. It does not seem to work.

Is the new syntax used for version 0.8.0-test2. I can encapsulate mpeg ES to mpeg2 TS with module “es” using old syntax, like

>vlc -vvv mpeg_input.vid --sout #es{access_video=file,mux_video=ts
,url_audio=video-%c.%m}:std{access=file, mux=ts}

It looks like the new syntax is not used for version 0.8.0-test2, or the new syntax is backward compatible.

Thanks!

David

fen

Postby fen » 20 Oct 2004 13:38

If your input is a raw h264 file you can try
vlc /h264:your_input_file.264 --sout file/ts:your_output_file.trp

This one should work too:
vlc /h264:your_input_file.264 --sout '#std{access=file, mux=ts, url=your_output_file.trp}'

You should not use the es{} module in your case.

Guest

Postby Guest » 20 Oct 2004 18:44

vlc /h264:your_input_file.264 --sout file/ts:your_output_file.trp

works great.

There seems to be some problem with
vlc /h264:your_input_file.264 --sout '#std{access=file, mux=ts, url=your_output_file.trp}'

OK, I can use the first one.

Thanks a lot!!

David

aileen614
New Cone
New Cone
Posts: 2
Joined: 13 Jan 2005 13:31

I have a question about streaming h.264 over MPEG-2 TS

Postby aileen614 » 14 Jan 2005 01:31

I am a beginner ,learning H.264.
Here are some questions:

1) When streaming H.264 video over MPEG-2 TS, I try to put H.264 video into PES,then put PES into TS. Is it right? If not, please tell me sth. about the detail.

2) I am confused about the module Packetizer/H.264.c and Demux/MPEG/H.264.c, what are they doing?

Thanks for help


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 30 guests