LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-13-2009, 10:07 PM   #1
LiquidL
LQ Newbie
 
Registered: Oct 2009
Posts: 4

Rep: Reputation: 0
Creating MPEG-TS from H.264 Elementary Stream


Hi,

I have been trying to encapsulate an H.264 elementary stream into an MPEG Transport Stream file but I am having problems. The command I use is:

ffmpeg -y -i Vantage_x264_6Mbps.264 -vcodec copy vantage.ts

My output for the above command is:

FFmpeg version 0.5-30.el5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-gpl --enable-postproc --enable-sws cale --enable-avfilter --enable-avfilter-lavf --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --disable-libamr-nb --disable-libamr-wb - -enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable- libxvid --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC --disab le-stripping --extra-cflags=-I/usr/include/nvidia-graphics --extra-ldflags=-L/usr/lib64/nvidia-graphics
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Mar 15 2009 14:08:04, gcc: 4.1.2 20080704 (Red Hat 4.1.2-44)

Seems stream 0 codec frame rate differs from container frame rate: 48.00 (48/1) -> 24.00 (48/2)
Input #0, h264, from 'Vantage_x264_6Mbps.264':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 1920x1080, 24 tbr, 1200k tbn, 48 tbc
Output #0, mpegts, to 'vantage.ts':
Stream #0.0: Video: libx264, yuv420p, 1920x1080, q=2-31, 90k tbn, 24 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[mpegts @ 0x11caa190]dts < pcr, TS is invalid
Last message repeated 48211 times557kB time=99.92 bitrate=9884.5kbits/s
[NULL @ 0x11ca9d90]missing picture in access unit
frame= 2853 fps= 0 q=-1.0 Lsize= 142889kB time=118.87 bitrate=9847.0kbits/s
video:87314kB audio:0kB global headers:0kB muxing overhead 63.649827%
-----------------------------------------------------------------------

The generated TS doesn't play using the VLC player.

Interestingly, if I try to put the H.264 Elementary Stream into an MP4 container, all works fine and the playback is superb:

ffmpeg -y -i Vantage_x264_6Mbps.264 -vcodec copy vantage.mp4


Can someone please point me to what I need to do to get this working?
Thanks.
 
Old 10-13-2009, 11:46 PM   #2
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 128Reputation: 128
Try with mencoder
 
Old 10-14-2009, 01:48 PM   #3
LiquidL
LQ Newbie
 
Registered: Oct 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Elv13 View Post
Try with mencoder
Yes, I have been looking into mencoder as well to create the MPEG-TS file but I have had no success.
Does anyone know the command line to put a H.264 Elementary Stream in MPEG-TS container?
 
Old 10-14-2009, 01:54 PM   #4
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 128Reputation: 128
You want to create a DVD? Did you tried tools like 2ManDVD (recommanded, but you have to check dependencies manually) or DeVeDe?
 
Old 10-14-2009, 02:05 PM   #5
LiquidL
LQ Newbie
 
Registered: Oct 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Elv13 View Post
You want to create a DVD? Did you tried tools like 2ManDVD (recommanded, but you have to check dependencies manually) or DeVeDe?
No, I don't want to create a DVD. I would like to put an H.264 encoded Elementary Stream (encoded using x264) into an MPEG-TS container for streaming and testing purposes.

I tried using a more recent SVN version (9/11/09) of ffmpeg to
encapsulate a raw H.264 Elementary Stream file into an MPEG-TS
container file and I got different results (from an older version from March '09) which still didn't work.

Here is my command line:

./ffmpeg -i ./Narnia.264 -vcodec copy -an narnia2.ts

Output:

FFmpeg version SVN-r19819-snapshot, Copyright (c) 2000-2009 Fabrice
Bellard, et al.
configuration:
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.35. 0 / 52.35. 0
libavformat 52.38. 0 / 52.38. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0. 7. 1
built on Sep 11 2009 10:26:09, gcc: 4.1.2 20080704 (Red Hat 4.1.2-44)

Seems stream 0 codec frame rate differs from container frame rate:
48.00 (48/1) -> 24.00 (48/2)
Input #0, h264, from './Narnia.264':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 1920x1080, 24 tbr, 1200k tbn, 48 tbc
Output #0, mpegts, to 'narnia2.ts':
Stream #0.0: Video: 0x0000, yuv420p, 1920x1080, q=2-31, 90k tbn, 24 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[mpegts @ 0x7643ab0]first pts value must set
av_interleaved_write_frame(): Error while opening file

Any tips??

Last edited by LiquidL; 10-14-2009 at 02:13 PM. Reason: Added new info
 
Old 10-14-2009, 02:11 PM   #6
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 128Reputation: 128
ffmpeg -i input.m4v output.ts

That would normally work, if it don't, then you are missing some codecs.
 
Old 10-14-2009, 02:49 PM   #7
LiquidL
LQ Newbie
 
Registered: Oct 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Elv13 View Post
ffmpeg -i input.m4v output.ts

That would normally work, if it don't, then you are missing some codecs.
I don't think so because, according to ffmpeg output, it is correctly able to identify the stream and also it doesn't need to decode/encode but just copy it into the MPEG-TS container. At this point, I don't care about sticking with mencoder or ffmpeg. If anyone has info about any other tool that can put a H.264 ES into a MPEG-TS, that would make my day.

Last edited by LiquidL; 10-14-2009 at 02:52 PM.
 
Old 10-14-2009, 05:13 PM   #8
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
You can look at avidemux. It is available via most distro's package managers. It simplifies a lot of conversions.
 
Old 09-14-2010, 07:15 PM   #9
Saibi Rocker
LQ Newbie
 
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
Question Segmenter.c Compilation with FFMPEG

Hi
I am new in this field, and i want to do vedio file segmentation for my Linux server. I have done the segmentation for my MAC OS, But really i have no clue and idea of doing it for Linux. As i am a beginner, so please post how to do it.
I have read in various commands that we have to do it by using segmenter.c with FFMPEG. I dont know anything about both of it. So can anybody please tell me the procedure in detail from scratch to do it.
Any little help will be appreciated greatly, as i should have to do it asap, coz i am stuck in it from the past 5,6 days and today i want to leave the seat after doing it. So dear looking forward for your positive response.
 
  


Reply

Tags
ffmpeg, h264, mencoder


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementation of SEEK for different codec types (H.264, MPEG 1/2) koodoo Programming 1 06-16-2008 12:20 PM
transcode an AVI into an MPEG-2 and stream it over the LAN cccc Linux - Software 1 09-05-2007 07:21 AM
Howto transcode & relay a MPEG stream to a WMV stream?? crazyivan Linux - Software 0 06-15-2007 04:18 AM
Can't we use ffserver to stream mpeg,rm files? tuxfood Linux - Software 0 01-05-2006 02:37 PM
convert mpeg transport stream? bjuhn Linux - Software 3 09-26-2005 04:22 AM


All times are GMT -5. The time now is 12:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration