Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AC3 file not being created? #85

Open
enormouspoon opened this issue Jan 20, 2013 · 16 comments
Open

AC3 file not being created? #85

enormouspoon opened this issue Jan 20, 2013 · 16 comments

Comments

@enormouspoon
Copy link

I'm running this on OSX 10.6.8. I have all the listed pre-req libraries/binaries installed. I'm using the supplied test.mkv, but I get the same results with any mkv. I'm applying the --new and -d flags. The conversion runs all the way through, but seemingly never creates the test.ac3 file. I've tried surrounding the test.mkv file with double/single quotes in the initial mkvdts2ac3 command, I've tried using alternate working temp locations instead of /tmp. Nothing seems to help.

There's one syntax error on line 537 and a -gt: unary operator expected error on line 175.

Any help or insight would be appreciated. I'm banging my head against a wall here.

Terminal output

HERPA-DURP:~ Media$ sudo ./mkvdts2ac3.sh --new -d Downloads/test.mkv
mkvdts2ac3-1.6.0 - by Jake Wharton <jakewharton@gmail.com> and
                  Chris Hoekstra <chris.hoekstra@gmail.com>

Extracting Timecodes:
Progress: 100%
Timecode extraction took:    00:00:00 (0 seconds)

Extracting DTS Track: 
Progress: 100%
DTS track extracting took:   00:00:00 (0 seconds)

Converting DTS to AC3:
Progress: 100%
DTS track conversion took:   00:00:01 (1 seconds)

du: /tmp/test.ac3: No such file or directory
./mkvdts2ac3.sh: line 537: 2248 + : syntax error: operand expected (error token is " ")
Muxing AC3 Track in:

Muxing AC3 track in took:    00:00:00 (0 seconds)

INFO: Moving new file over old file. DO NOT KILL THIS PROCESS OR YOU WILL EXPERIENCE DATA LOSS!
NEW FILE: /tmp/test.new.mkv
MKV FILE: Downloads/test-AC3.mkv
mv: rename /tmp/test.new.mkv to Downloads/test-AC3.mkv: No such file or directory
ERROR: There was an error copying the new MKV over the old one. You can perform this manually by moving '/tmp/test.new.mkv' over 'Downloads/test-AC3.mkv'.
./mkvdts2ac3.sh: line 175: [: -gt: unary operator expected
File copy took:          00:00:00 (0 seconds)

Total processing time:      00:00:01 (1 seconds)

du: Downloads/test-AC3.mkv: No such file or directory
Filesize summary:
     Original Filesize:            2,248 KB
Extracted DTS Filesize:            1,924 KB
Converted AC3 Filesize:               0 KB
        Final Filesize:               0 KB
HERPA-DURP:~ Media$ 
@1951FDG
Copy link

1951FDG commented Jan 20, 2013

I am also on OS X 10.6.8, I tried the same command and it worked. Can you try the same command but append the debug flag "sudo ./mkvdts2ac3.sh --debug --new -d Downloads/test.mkv"

@enormouspoon
Copy link
Author

Yeah no problem. Here's the output. The write test.ac3 command looks right, but the very next process can't find the file.

Output

HERPA-DURP:~ Media$ sudo ./mkvdts2ac3.sh --debug --new -d Downloads/test.mkv
Password:
mkvdts2ac3-1.6.0 - by Jake Wharton <jakewharton@gmail.com> and
                  Chris Hoekstra <chris.hoekstra@gmail.com>

MKV FILE: Downloads/test.mkv
DTS FILE: /tmp/test.dts
AC3 FILE: /tmp/test.ac3
TIMECODE: /tmp/test.tc
NEW FILE: /tmp/test.new.mkv
WORKING DIRECTORY: /tmp

Find first DTS track in MKV file.
> mkvmerge -i "Downloads/test.mkv" | grep -m 1 "audio (A_DTS)" | cut -d : -f 1 | cut -d " " -f 3

RESULT:DTSTRACK=1

Extract track information for selected DTS track.
> mkvinfo "Downloads/test.mkv"

RESULT:INFO=
|  + Track number: 1 (track ID for mkvmerge & mkvextract: 0)
|  + Track UID: 1
|  + Track type: video
|  + Enabled: 1
|  + Default flag: 1
|  + Forced flag: 0
|  + Lacing flag: 0
|  + MinCache: 1
|  + Timecode scale: 1
|  + Max BlockAddition ID: 0
|  + Codec ID: V_MPEG4/ISO/AVC
|  + Codec decode all: 1
|  + CodecPrivate, length 42 (h.264 profile: High @L4.1)
|  + Default duration: 41.708ms (23.976 frames/fields per second for a video track)
|  + Language: eng
|  + Name: Video: x264_L4.1 @ 7183 Kbps
|  + Video track
|   + Pixel width: 1280
|   + Pixel height: 534
|   + Interlaced: 0
|   + Display width: 1280
|   + Display height: 534
| + A track
|  + Track number: 2 (track ID for mkvmerge & mkvextract: 1)

Extract language from track info.
> echo "$INFO" | grep -m 1 \"Language\" | cut -d \" \" -f 5

RESULT:DTSLANG=eng

Extract name for selected DTS track. Change DTS to AC3 and update bitrate if present.
> echo "$INFO" | grep -m 1 "Name" | cut -d " " -f 5- | sed "s/DTS/AC3/" | awk '{gsub(/[0-9]+(\.[0-9]+)?(M|K)bps/,448Kbps)}1'

RESULT:DTSNAME=Video: x264_L4.1 @ 7183 Kbps

Extract timecode information for the audio track.
> mkvextract timecodes_v2 "Downloads/test.mkv" 1:"/tmp/test.tc"
> sed -n "2p" "/tmp/test.tc"
> rm -f "/tmp/test.tc"

Extracting Timecodes:
Progress: 100%
RESULT:DELAY=0

Extract DTS file from MKV.
> mkvextract tracks "Downloads/test.mkv" 1:"/tmp/test.dts"

Extracting DTS Track: 
Progress: 100%
Converting DTS to AC3.
> ffmpeg -i "/tmp/test.dts" -acodec ac3 -ac 6 -ab 448k "/tmp/test.ac3"

Converting DTS to AC3:
Progress: 100%
du: /tmp/test.ac3: No such file or directory
./mkvdts2ac3.sh: line 537: 2248 + : syntax error: operand expected (error token is " ")
Running main remux.
> nice -n 0 mkvmerge -o "/tmp/test.new.mkv" --compression 0:none "Downloads/test.mkv" --default-track 0 --    language 0:eng --track-name 0:"Video: x264_L4.1 @ 7183 Kbps" --compression 0:none "/tmp/test.ac3"

Muxing AC3 Track in:

Removing temporary AC3 file.
> rm -f "/tmp/test.ac3"


Moving new file over old one.
> mv "/tmp/test.new.mkv" "Downloads/test-AC3.mkv"

INFO: Moving new file over old file. DO NOT KILL THIS PROCESS OR YOU WILL EXPERIENCE DATA LOSS!
NEW FILE: /tmp/test.new.mkv
MKV FILE: Downloads/test-AC3.mkv
mv: rename /tmp/test.new.mkv to Downloads/test-AC3.mkv: No such file or directory
ERROR: There was an error copying the new MKV over the old one. You can perform this manually by moving '/tmp/test.new.mkv' over 'Downloads/test-AC3.mkv'.
./mkvdts2ac3.sh: line 175: [: -gt: unary operator expected
du: Downloads/test-AC3.mkv: No such file or directory
HERPA-DURP:~ Media$'

@1951FDG
Copy link

1951FDG commented Jan 20, 2013

Ok, try the following: run the same command, stop (do not press enter) at "Converting DTS to AC3.", then open a new window in Terminal, type open /tmp, the file test.dts should be present in directory /tmp, if test.dts is present, go back to the previously opened window in Terminal, type ffmpeg -i "/tmp/test.dts" -acodec ac3 -ac 6 -ab 448k "/tmp/test.ac3"

@enormouspoon
Copy link
Author

Again yeah no problem. Ran the debug, this time using the alternate ffmpeg parameters. Still looks like the ac3 file wasn't created. Oddly though no error message when removing the test.ac3 file in the muxing step

Summarized output:

Extracting DTS Track: 
Progress: 100%
Converting DTS to AC3.
> ffmpeg -i "/tmp/test.dts" -acodec ac3 -ac 6 -ab 448k "/tmp/test.ac3"
ffmpeg -i "/tmp/test.dts" -acodec ac3 -ab 640k "/tmp/test.ac3"
Converting DTS to AC3:
Progress: 100%
du: /tmp/test.ac3: No such file or directory
./mkvdts2ac3.sh: line 537: 2248 + : syntax error: operand expected (error token is " ")
Running main remux.
> nice -n 0 mkvmerge -o "/tmp/test.new.mkv" --compression 0:none "Downloads/test.mkv" --default-track 0 --language 0:eng --track-name 0:"Video: x264_L4.1 @ 7183 Kbps" --compression 0:none "/tmp/test.ac3"

Muxing AC3 Track in:

Removing temporary AC3 file.
> rm -f "/tmp/test.ac3"


Moving new file over old one.
> mv "/tmp/test.new.mkv" "Downloads/test-AC3.mkv"

INFO: Moving new file over old file. DO NOT KILL THIS PROCESS OR YOU WILL EXPERIENCE DATA LOSS!
NEW FILE: /tmp/test.new.mkv
MKV FILE: Downloads/test-AC3.mkv
mv: rename /tmp/test.new.mkv to Downloads/test-AC3.mkv: No such file or directory
ERROR: There was an error copying the new MKV over the old one. You can perform this manually by moving '/tmp/test.new.mkv' over 'Downloads/test-AC3.mkv'.
./mkvdts2ac3.sh: line 175: [: -gt: unary operator expected
du: Downloads/test-AC3.mkv: No such file or directory
HERPA-DURP:~ Media$

@1951FDG
Copy link

1951FDG commented Jan 20, 2013

Did you try the ffmpeg command manually? ffmpeg -i "/tmp/test.dts" -acodec ac3 -ac 6 -ab 448k "/tmp/test.ac3"

@enormouspoon
Copy link
Author

Ran another debug using ffmpeg -i "/tmp/test.dts" -acodec ac3 -ac 6 -ab 448k "/tmp/test.ac3" manually, but same results as your first suggestion. Also, I'm using ffmpeg 1.1.7, which are you using?

...
Extracting DTS Track: 
Progress: 100%
Converting DTS to AC3.
> ffmpeg -i "/tmp/test.dts" -acodec ac3 -ac 6 -ab 448k "/tmp/test.ac3"
ffmpeg -i "/tmp/test.dts" -acodec ac3 -ac 6 -ab 448k "/tmp/test.ac3"
Converting DTS to AC3:
Progress: 100%
du: /tmp/test.ac3: No such file or directory
./mkvdts2ac3.sh: line 537: 2248 + : syntax error: operand expected (error token is " ")
Running main remux.
> nice -n 0 mkvmerge -o "/tmp/test.new.mkv" --compression 0:none "Downloads/test.mkv" --default-track 0 --    language 0:eng --track-name 0:"Video: x264_L4.1 @ 7183 Kbps" --compression 0:none "/tmp/test.ac3"

Muxing AC3 Track in:

Removing temporary AC3 file.
> rm -f "/tmp/test.ac3"


Moving new file over old one.
> mv "/tmp/test.new.mkv" "Downloads/test-AC3.mkv"

INFO: Moving new file over old file. DO NOT KILL THIS PROCESS OR YOU WILL EXPERIENCE DATA LOSS!
NEW FILE: /tmp/test.new.mkv
MKV FILE: Downloads/test-AC3.mkv
mv: rename /tmp/test.new.mkv to Downloads/test-AC3.mkv: No such file or directory
ERROR: There was an error copying the new MKV over the old one. You can perform this manually by moving '/tmp/test.new.mkv' over 'Downloads/test-AC3.mkv'.
./mkvdts2ac3.sh: line 175: [: -gt: unary operator expected
du: Downloads/test-AC3.mkv: No such file or directory
HERPA-DURP:~ Media$

@1951FDG
Copy link

1951FDG commented Jan 20, 2013

Better yet, open a new window in Terminal and type ffmpeg? The first line of the output should be similar to "ffmpeg version 0.9.1, Copyright (c) 2000-2012 the FFmpeg developers"

@1951FDG
Copy link

1951FDG commented Jan 20, 2013

By the way, you are entering the command in the same Terminal window, that will not work!

@enormouspoon
Copy link
Author

Ah crap my mistake. I thought just hitting enter sent a blank line to move the debugger forward, and that I could send manual inline commands. Using a second terminal window to send the ffmpeg gave me a bad cpu type error. The ffmpeg 1.1.7 version I'm using I thought was for mac intel x64.

HERPA-DURP:~ Media$ ffmpeg -i "/tmp/test.dts" -acodec ac3 -ac 6 -ab 448k "/tmp/test.ac3"
-bash: /usr/bin/ffmpeg: Bad CPU type in executable
HERPA-DURP:~ Media$

@1951FDG
Copy link

1951FDG commented Jan 20, 2013

Universal Media Server contains a fairly recent version of ffmpeg in directory /Applications/Universal\ Media\ Server.app/Contents/Resources/Java/osx/

@enormouspoon
Copy link
Author

let me try that. the latest snapshot gave me the same bad cpu type error.

[edit]
Yeah that fixed it. Seems like the script didn't like the ffmpeg's from http://www.evermeet.cx/ffmpeg/ Using the ffmpeg from UMS-2.2.5 produced the test.ac3 file correctly and finished the conversion process. Thanks for all your help :-) I appreciate it.

I used the -d flag yet mkvmerge -i shows the new ac3 track at id 4. Doesn't that mean it's not the default track as -d implies?

HERPA-DURP:~ Media$ mkvmerge -i Downloads/test-AC3.mkv
File 'Downloads/test-AC3.mkv': container: Matroska
Track ID 0: video (V_MPEG4/ISO/AVC)
Track ID 1: audio (A_DTS)
Track ID 2: subtitles (S_TEXT/UTF8)
Track ID 3: subtitles (S_TEXT/UTF8)
Track ID 4: audio (A_AC3)
HERPA-DURP:~ Media$ 

Again, thank you for all your help! 👍

@1951FDG
Copy link

1951FDG commented Jan 20, 2013

Upon further investigation, the problem is clear to me! You have a 32-bit CPU. ffmpeg 1.1.7 lacks the 32-bit (i386) part, it is 64-bit (x86_64) only!

@1951FDG
Copy link

1951FDG commented Jan 20, 2013

FFmpeg Static Builds by tessus are all 64-bit only!

@enormouspoon
Copy link
Author

That's really odd. AFAIK Intel COre i7's are 64bit but whatever. Don't care as long as it works :) Thanks.

Lastly though, does that Track ID 4: audio (A_AC3) mean the -d flag didn't work? Or does default audio not matter with Track ID

@1951FDG
Copy link

1951FDG commented Jan 21, 2013

That's odd, you could email tessus as to why his build does not work on i7. You could try snapshots starting from the most recent to the oldest to figure out the latest working snapshot on i7.

Track ID has nothing to do with the -d flag! Use mkvinfo Downloads/test-AC3.mkv. If the default flag is not set for a track, mkvinfo outputs Default flag: 0.

Glad I could help.

@1951FDG
Copy link

1951FDG commented Jan 21, 2013

Also, don't forget, the excellent GUI: MKVToolNix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants