VideoHelp Forum
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. Member
    Join Date
    May 2008
    Location
    Europe
    Search Comp PM
    Hi all,

    I have some ts files directly recorded from the sat receiver to the hard disk, which I now want to encode with mencoder to an avi container using x264 as video codec (2GB / hour is way too big).

    Code:
    mencoder -oac copy -ovc x264 -o out.avi in.ts
    This works pretty fine, but if a ts file has more than one audio stream, the option -oac copy takes only the first audio stream. I am searching now the net a few days for a simple solution (without demuxing the ts file), without a result.
    Has anyone a simple solution for this problem?

    Thanks a lot,
    Sven
    Quote Quote  
  2. humble suggestion, try with AutoFF (NOTE COPY AUDIO ISN'T WORKING ACTUALLY, only encoding it)

    thanks!

    BHH
    HDConvertToX, AutoMen, AutoMKV Developer
    Quote Quote  
  3. Member
    Join Date
    May 2008
    Location
    Europe
    Search Comp PM
    Thanks for the tips!
    It was not easy to figure it out of the ffmpeg documentation but finally the command line
    Code:
    ffmpeg -i in.ts out.avi -vcodec h264 -acodec copy -map 0:0 -map 0:1 -map 0:2 -newaudio
    lead to the wanted result (copying the first two stereo streams, stripping the DD2.0 stream)
    Input #0, mpegts, from 'in.ts':
    Duration: 00:41:55.7, start: 1288.327522, bitrate: 7694 kb/s
    Stream #0.0[0xe0]: Video: mpeg2video, yuv420p, 720x576, 6800 kb/s, 25.00 fps(r)
    Stream #0.1[0xc0](deu): Audio: mp2, 48000 Hz, stereo, 160 kb/s
    Stream #0.2[0xc1](eng): Audio: mp2, 48000 Hz, stereo, 160 kb/s
    Stream #0.3[0x80](deu): Audio: 0x0000, 48000 Hz, stereo, 448 kb/s
    Output #0, avi, to 'out.avi':
    Stream #0.0: Video: mpeg4, yuv420p, 720x576, q=2-31, 200 kb/s, 25.00 fps(c)
    Stream #0.1: Audio: mp2, 48000 Hz, stereo, 64 kb/s
    Stream #0.2: Audio: 0x0000, 48000 Hz, stereo, 160 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
    Stream #0.2 -> #0.2
    Ok, this is out of topic in my own post, but I got a problem configuring the h264 codec. The default settings lead to a really ugly video stream. I used the options from http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/, but the look of video didn't change a bit. -vcodec mpeg4 leads to a similar ugly result!
    I looking for settings that lead to a result comparable to the original mpeg2 stream.

    ffmpeg version is
    ~$ ffmpeg -version
    FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
    configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
    libavutil version: 1d.49.3.0
    libavcodec version: 1d.51.38.0
    libavformat version: 1d.51.10.0
    built on Jun 3 2007 20:59:25, gcc: 4.1.3 20070528 (prerelease) (Ubuntu 4.1.2-9ubuntu2)
    ffmpeg SVN-rUNKNOWN
    libavutil 3212032
    libavcodec 3352064
    libavformat 3344896
    Quote Quote  
  4. your version of ffmpeg is OUTDATED!, x264 on 2007 was is early stage...

    add to your repository debian-multimedia

    BHH
    HDConvertToX, AutoMen, AutoMKV Developer
    Quote Quote  
  5. Member GMaq's Avatar
    Join Date
    Mar 2004
    Location
    Canada
    Search Comp PM
    Hello,

    With all due respect to buzzqw, if you are using Ubuntu you certainly do not want to use the ffmpeg from debian-multimedia, it has numerous dependency conflicts with mjpegtools, mencoder, avidemux and especially libfaad2. Go to www.medibuntu.org and follow the instructions on adding their repo to get a fully enabled ffmpeg with a version of x264 that works great with AutoFF in Ubuntu. Judging by the version you have posted it would appear to be the stock one that comes with Ubuntu and is very limited in use.
    Quote Quote  
  6. well i must admit that i use debian sid.. so dependency are all resolved.. automagically by aptitude/dpkg...

    thanks GMaq, i will pay more attention next time

    BHH
    HDConvertToX, AutoMen, AutoMKV Developer
    Quote Quote  
  7. Member GMaq's Avatar
    Join Date
    Mar 2004
    Location
    Canada
    Search Comp PM
    buzzqw,

    Well it should be that way, Ubuntu and Debian share a common base but little else any more, debian-multimedia used to be very compatible with Ubuntu up until 7.10, Unfortunately that is no longer the case.
    Quote Quote  
  8. thanks for the info, i don't knew of recent "incompatibility", that's another plus to standard debian

    BHH
    HDConvertToX, AutoMen, AutoMKV Developer
    Quote Quote  
  9. Member
    Join Date
    May 2008
    Location
    Europe
    Search Comp PM
    First, thanks for all replies!

    I tried the ffmpeg version from debian-multimedia, which is actually not working. It returned these strange
    [mp2 @ 0xb7d739f0]encoding 0 channel(s) is not allowed in mp2
    Error while opening codec for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
    which seems only one person in the google world encountered before.

    As recommended I switched to www.medibuntu.org (thanks for that tip!!!), and ffmpeg works again!

    But the video using h264 or mpeg4 still looks just awful! No wonder, the video gets encoded at 500kBit...
    Quote Quote  
  10. for bitrate..

    just edit your ffmpeg string, and add the -b parameter, for bitrate

    ffmpeg -i in.ts out.avi -vcodec h264 -b 1500000 -acodec copy -map 0:0 -map 0:1 -map 0:2 -newaudio

    EDIT: just for learing pourpose you can study the command line produced by WinFF or AutoFF

    BHH
    HDConvertToX, AutoMen, AutoMKV Developer
    Quote Quote  
  11. Member GMaq's Avatar
    Join Date
    Mar 2004
    Location
    Canada
    Search Comp PM
    sven_911,

    If you don't specify a bitrate ffmpeg will just apply whatever default, which in the case of x264 is 500kb. Are you using AutoFF to do this or the commandline? I am not at my computer with AutoFF installed right now but I'm certain you can change the bitrate to whatever you like, there is a tab that is specifically for x264 in ffmpeg.

    **EDIT** Buzz typed faster!
    Quote Quote  
  12. @GMaq

    in autoff you can specify the final size, and bitrate will be computed automatically (and applied to whatever video codec selected)

    BHH
    HDConvertToX, AutoMen, AutoMKV Developer
    Quote Quote  
  13. Member
    Join Date
    May 2008
    Location
    Europe
    Search Comp PM
    I tried the -b parameter already some time ago, but the codec insists on the 500k limit. I used AutoFF to get a more complex set of parameters...
    I was just writing this replay, when I found the bug!
    The command line
    Code:
    ffmpeg -i in.ts out.avi -vcodec h264 -b 1500000 -acodec copy -map 0:0 -map 0:1 -map 0:2 -newaudio
    does work, but video is still encoded at 500k. It has to be e.g. like this
    Code:
    ffmpeg -i in.ts -vcodec h264 -b 1500000 out.avi -acodec copy -map 0:0 -map 0:1 -map 0:2 -newaudio
    The output file must not be specified before the codec parameters. ffmpeg is very curious about its parameter list, e.g. specifying in this example the output file at the end of the command line, leads to an syntax error
    Code:
    ffmpeg -i in.ts -vcodec h264 -b 1500000 -acodec copy -map 0:0 -map 0:1 -map 0:2 -newaudio out.avi
    Many thanks to buzzqw and GMaq for your help and time!
    Hope this helps some of the frustrated ffmpeg command line users (wild guess) out there.
    Quote Quote  
  14. Member GMaq's Avatar
    Join Date
    Mar 2004
    Location
    Canada
    Search Comp PM
    Sven_911,

    Glad you got it to work, many versions of ffmpeg including the current medibuntu one will also honor bitrate flags by adding "k" to the bitrate (ie: -b 1500k instead of 1500000)
    Quote Quote  
  15. @sven_911

    why -newaudio option ? isn't needed afaik.. and.. -map 0:0 ... it's a unneeded plus

    BHH
    HDConvertToX, AutoMen, AutoMKV Developer
    Quote Quote  
  16. Member
    Join Date
    May 2008
    Location
    Europe
    Search Comp PM
    Originally Posted by buzzqw
    @sven_911
    why -newaudio option ? isn't needed afaik.. and.. -map 0:0 ... it's a unneeded plus
    Actually, no... at least not in my version 3:0.cvs20070307-5ubuntu7+medibuntu1

    For the source:
    Stream #0.1[0xc0](deu): Audio: mp2, 48000 Hz, stereo, 160 kb/s
    Stream #0.2[0xc1](eng): Audio: mp2, 48000 Hz, stereo, 160 kb/s
    Stream #0.3[0x80](deu): Audio: ac3, 48000 Hz, stereo, 448 kb/s

    ffmpeg -i in.ts out.avi -vcodec h264 -acodec copy is equal to
    ffmpeg -i in.ts out.avi -vcodec h264 -acodec copy -map 0:0 -map 0:1

    both lead to
    Output #0, avi, to 'out.avi':
    Stream #0.0: Video: mpeg4, yuv420p, 720x576, q=2-31, 200 kb/s, 25.00 fps(c)
    Stream #0.1: Audio: mp2, 48000 Hz, stereo, 64 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1

    If you want to add a second audio stream, you have to provide the full mapping info
    -map 0:0 -map 0:1 -map 0:2".
    But this alone leads to the error
    Number of stream maps must match number of output streams.
    For each audio stream beyond the first, you have to add -newaudio (1 video + 1 audio stream is default).
    So, the correct mapping for two audio streams is
    -map 0:0 -map 0:2 -map 0:3 -newaudio (stripping stream 0:1),
    for all three
    -map 0:0 -map 0:3 -map 0:2 -newaudio -map 0:1 -newaudio (inverted audio stream order).
    Quote Quote  
  17. Member
    Join Date
    Mar 2020
    Location
    Brasil Guaruja-SP
    Search PM
    my receiver created 3 files 000.dvr 000.ts info3.dvr
    it's a coded video and I can't open it.
    please help. how to break the coding?


    erich@erich-All-Series:~/Vídeos/[TS]2020-03-08.07.44.14-Disney XD-00000040$ ffmpeg -i 000.ts out.avi -vcodec h264 -b 1500000 -acodec copy -map 0:0 -map 0:1 -map 0:2
    ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
    configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
    WARNING: library configuration mismatch
    avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
    libavutil 55. 78.100 / 55. 78.100
    libavcodec 57.107.100 / 57.107.100
    libavformat 57. 83.100 / 57. 83.100
    libavdevice 57. 10.100 / 57. 10.100
    libavfilter 6.107.100 / 6.107.100
    libavresample 3. 7. 0 / 3. 7. 0
    libswscale 4. 8.100 / 4. 8.100
    libswresample 2. 9.100 / 2. 9.100
    libpostproc 54. 7.100 / 54. 7.100
    Trailing options were found on the commandline.
    000.ts: could not find codec parameters
    erich@erich-All-Series:~/Vídeos/[TS]2020-03-08.07.44.14-Disney XD-00000040$
    Quote Quote  
  18. Code:
    000.ts: could not find codec parameters
    Seems like ffmpeg doesn't know that it's fed with. could it be that your transport stream is encrypted?
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  19. Member
    Join Date
    Mar 2020
    Location
    Brasil Guaruja-SP
    Search PM
    yes the file is encrypted. it only opens on the TV receiver.
    Quote Quote  
  20. that's your problem
    ffmpeg can't decrypt and thus not do anything with it.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  21. Member
    Join Date
    Mar 2020
    Location
    Brasil Guaruja-SP
    Search PM
    there must be some way. how to remove encryption?
    Last edited by erich8; 26th Mar 2020 at 07:05.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!