lisamelton / video_transcoding

Tools to transcode, inspect and convert videos.
MIT License
2.39k stars 160 forks source link

no H.264 format video track: #41

Closed dgibbs64 closed 8 years ago

dgibbs64 commented 8 years ago

Hey, Im currently getting this error when testing out convert-video. Not sure why. Any suggestions?

Just to confirm the video track is H264

lisamelton commented 8 years ago

@dgibbs64 You're getting that error because the video your'e trying to convert doesn't contain any H.264 format video track. Very likely you're trying to use convert-video on a DVD rip with MPEG-2 format video or on a Blu-ray rip with VC-1 format video. Or you're simply trying to use convert-video on a non-video file.

What does mediainfo tell you about the contents of the file you're trying to convert?

You can get the mediainfo tool via Homebrew with a brew install media-info command.

lisamelton commented 8 years ago

@dgibbs64 Did you ever figure out what's going on here? Did the media file actually contain H.264 video?

dgibbs64 commented 8 years ago

yeah the media did contain H.264. I will need to investigate again as I have been busy and not been able to test this in a while. I will look at this again once I have settled in to my new house in a few weeks :)

lisamelton commented 8 years ago

@dgibbs64 Any update on this?

dgibbs64 commented 8 years ago

Will be doing a fresh install once I get my VMware server installed :D. I will test then

dgibbs64 commented 8 years ago

Just setting up my new VM I can confirm I still have the issue with an mkv file that does contain a H.264 track.

dgibbs64 commented 8 years ago

here is a sample output from mediainfo

Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 22.7 MiB
Duration                                 : 1mn 1s
Overall bit rate                         : 3 075 Kbps
Encoded date                             : UTC 2014-09-06 03:22:13
Writing application                      : mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 22 2014 08:19:39
Writing library                          : libebml v1.3.0 + libmatroska v1.4.1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 1mn 1s
Bit rate                                 : 2 630 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.119
Stream size                              : 19.4 MiB (86%)
Writing library                          : x264 core 142 r2479 dd79a61
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=18 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Matrix coefficients                      : BT.709

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 1mn 1s
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Frame rate                               : 31.250 fps (1536 spf)
Compression mode                         : Lossy
Stream size                              : 2.83 MiB (12%)
Default                                  : Yes
Forced                                   : No
lisamelton commented 8 years ago

@dgibbs64 Thanks. Is it possible to upload this file somewhere so I could download and test it?

lisamelton commented 8 years ago

@dgibbs64 If uploading is not possible, can you run this command on the input and paste the output here:

HandBrakeCLI --title 0 --scan --previews 2:0 --input "/path/to/Movie.mkv"
lisamelton commented 8 years ago

@dgibbs64 BTW, the reason why I need the output of a HandBrake scan is that's what the convert-video tool (or any of my tools) uses to detect a H.264 video stream.

lisamelton commented 8 years ago

@dgibbs64 Any chance to try that HandBrakeCLI command yet?

dgibbs64 commented 8 years ago
[19:45:40] CPU: Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz
[19:45:40]  - Intel microarchitecture Ivy Bridge
[19:45:40]  - logical processor count: 4
[19:45:40] OpenCL: library not available
[19:45:40] hb_scan: path=/home/dgibbs/nas-Downloads/convert-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv, title_index=0
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:269: failed opening UDF image /home/dgibbs/nas-Downloads/convert-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv
disc.c:350: error opening file BDMV/index.bdmv
disc.c:350: error opening file BDMV/BACKUP/index.bdmv
[19:45:48] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.3
libdvdread: Encrypted DVD support unavailable.
************************************************
**                                            **
**  No css library available. See             **
**  /usr/share/doc/libdvdread4/README.css     **
**  for more information.                     **
**                                            **
************************************************
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[19:45:50] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from '/home/dgibbs/nas-Downloads/convert-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.1
    creation_time   : 2014-08-23 03:01:46
  Duration: 00:01:08.42, start: 0.000000, bitrate: 2188 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709/unknown/unknown), 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
[19:45:54] scan: decoding previews for title 1
Scanning title 1 of 1, preview 1, 0.00 %[19:45:54] scan: audio 0x1: ac3, rate=48000Hz, bitrate=384000 Unknown (AC3) (5.1 ch)
Scanning title 1 of 1, preview 2, 100.00 %[19:45:57] scan: 2 previews, 1280x720, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
Scanning title 1 of 1, preview 2, 100.00 %[19:45:58] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: /home/dgibbs/nas-Downloads/convert-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv
  + duration: 00:01:08
  + size: 1280x720, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 0/0/0/0
  + support opencl: no
  + support hwd: not built-in
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:01:08
  + audio tracks:
    + 1, Unknown (AC3) (5.1 ch) (iso639-2: und), 48000Hz, 384000bps
  + subtitle tracks:

HandBrake has exited.

Hope this helps

dgibbs64 commented 8 years ago

It may be worth seeing if you can setup an Ubuntu VM and replicate that way. If I remember correctly your using Mac? It could be some slight differences in the software that are causing the issue? This is retested on just released Ubuntu 16.04 LTS and still the same issue.

lisamelton commented 8 years ago

@dgibbs64 Can you include the entire scan? You're missing the first few lines which contain the HandBrake version number.

Thanks.

lisamelton commented 8 years ago

@dgibbs64 Are you using a development/nightly build of HandBrakeCLI? I ask that because the scan says you're using libdvdnav version 5.0.3. And that's not included with HandBrake version 0.10.5, the current official release.

dgibbs64 commented 8 years ago

Im just using whatever the default is for Ubuntu 16.04 Installed: Which appears to be

    dgibbs@ubuntu:~$ apt-cache policy handbrake-cli
    handbrake-cli:
      Installed: 0.10.2+ds1-2build1
      Candidate: 0.10.2+ds1-2build1
      Version table:
     *** 0.10.2+ds1-2build1 500
            500 http://gb.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
            100 /var/lib/dpkg/status

edit: I have just added the official PPA to get the latest version however there is no release for 16.04 of the repo currently.

lisamelton commented 8 years ago

@dgibbs64 Maybe the version is 0.10.2 but it's hard to tell with all that noise from apt-cache so give me the output of:

HandBrakeCLI --preset-list

Specifically, the first line of that output. That's the crucial version information.

lisamelton commented 8 years ago

@dgibbs64 BTW, getting back to the scan output. This is the crucial line I use to detect whether an input file contains a valid H.264 video stream:

    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709/unknown/unknown), 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)

And there's nothing wrong with that line. My parser should see that. So, I have no idea why it's failing.

This means I need to go back to your original attempt to use convert-video and get FULL diagnostic information from the failure. Here's how you do that:

convert-video -vv "/path/to/video.mkv"

See that -vv there? That's the same as using the --verbose option twice. It's just less to type. :)

Please paste in ALL of the output from that command -- from the first line to the last line.

Thanks.

dgibbs64 commented 8 years ago

Output of HandBrakeCLI --preset-list

dgibbs@ubuntu:~$ HandBrakeCLI --preset-list
HandBrake 0.10.2 (2016021200) - Linux x86_64 - https://handbrake.fr

Output of convert-video -vv "/path/to/video.mkv"

dgibbs@ubuntu:~$ convert-video -vv nas-Downloads/transcode-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv
convert-video 0.7.0
Copyright (c) 2013-2016 Don Melton
HandBrake 0.10.2 found...
Processing: nas-Downloads/transcode-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv...
Scanning media title 1 with HandBrakeCLI...
[23:09:12] hb_init: starting libhb thread
HandBrake 0.10.2 (2016021200) - Linux x86_64 - https://handbrake.fr
4 CPUs detected
Opening nas-Downloads/transcode-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv...
[23:09:12] CPU: Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz
[23:09:12]  - Intel microarchitecture Ivy Bridge
[23:09:12]  - logical processor count: 4
[23:09:12] OpenCL: library not available
[23:09:12] hb_scan: path=nas-Downloads/transcode-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:269: failed opening UDF image nas-Downloads/transcode-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv
disc.c:350: error opening file BDMV/index.bdmv
disc.c:350: error opening file BDMV/BACKUP/index.bdmv
[23:09:13] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.3
libdvdread: Encrypted DVD support unavailable.
************************************************
**                                            **
**  No css library available. See             **
**  /usr/share/doc/libdvdread4/README.css     **
**  for more information.                     **
**                                            **
************************************************
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[23:09:13] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'nas-Downloads/transcode-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.1
    creation_time   : 2014-08-23 03:01:46
  Duration: 00:01:08.42, start: 0.000000, bitrate: 2188 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709/unknown/unknown), 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
[23:09:13] scan: decoding previews for title 1
[23:09:13] scan: audio 0x1: ac3, rate=48000Hz, bitrate=384000 Unknown (AC3) (5.1 ch)
Scanning title 1 of 1, preview 2, 100.00 %[23:09:13] scan: 2 previews, 1280x720, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[23:09:13] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: nas-Downloads/transcode-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv
  + duration: 00:01:08
  + size: 1280x720, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 0/0/0/0
  + support opencl: no
  + support hwd: not built-in
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:01:08
  + audio tracks:
    + 1, Unknown (AC3) (5.1 ch) (iso639-2: und), 48000Hz, 384000bps
  + subtitle tracks:
HandBrake has exited.

{:title=>1, :size=>18718680, :directory=>false, :duration=>68, :width=>1280, :height=>720, :fps=>23.976, :autocrop=>nil, :audio=>{1=>{:format=>"AC3", :channels=>5.1, :language=>"und", :bps=>384000}}, :subtitle=>{}, :h264=>false, :mpeg2=>false, :bd=>false, :dvd=>false, :mkv=>true, :mp4=>false}
/usr/local/bin/convert-video: no H.264 format video track: nas-Downloads/transcode-video/output/original/sample-the.knick.s01e03.720p.hdtv.x264-killers.mkv
lisamelton commented 8 years ago

@dgibbs64 Thanks! But most of that is still formatted as regular text. Can you can re-edit that comment to format it as code?

lisamelton commented 8 years ago

@dgibbs64 Nevermind. I realized I could edit it myself. :)

lisamelton commented 8 years ago

@dgibbs64 OK, I see the problem now. Sorry that I missed it the first time but it's very subtle.

For some strange reason, your particular version of HandBrakeCLI is using a colon (":") instead of a period ".") to separate the two numerical components of a stream identifier. For example, your scan shows Stream #0:0 instead of Stream #0.0. And that's screwing up my parser.

I've never seen that output from any other version of HandBrakeCLI. Now I need to do some research and testing...

dgibbs64 commented 8 years ago

That's great news you have spotted the issue. Hopefully you can figure out a work around. Good Luck!

lisamelton commented 8 years ago

@dgibbs64 Looks like this has to do with the version of libavcodec to which HandBrake is linked. Because libavcodec contains the code which generates the steam information in the scan output. And different versions of libavcodec use different punctuation. Go figure.

Anyway, (I think) I can fix this in my parser by being a little more lenient about about the stream identifier. So, I'll put this on the list of things to fix for 0.8.0. Probably due out next week.

Stay tuned! And thanks for going through all these hoops with me. :)

lisamelton commented 8 years ago

@dgibbs64 OK, I have a patch ready for this and #30 that I'm evaluating now. Unfortunately, I don't have your setup so I'm taking it a bit on faith that it will work. But I'll figure out someway to test it. Stay tuned.

lisamelton commented 8 years ago

@dgibbs64 OK, the fix has been released in version 0.8.0. Just update to get it. Please test on your configuration and let me know if it actually works.

Thanks again!