# MediaReaderFLV.open: Metadata Appears to Be Bad

**URL:** <https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848>\
**Category:** Wowza Streaming Engine\
**Created:** [November 12, 2010, 9:45am UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848 "2010-11-12T09:45:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Silas\_Silva](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Silas\_Silva](https://community.wowza.com/u/Silas_Silva)\
**Post date:** [November 12, 2010, 9:45am UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/1 "2010-11-12T09:45:35Z")

</div>

I’m trying to play a FLV file to Wowza, but the following message is displayed in the error logs:

MediaReaderFLV.open: Metadata Appears to Be Bad: RPHChamda15seg.flv

What does this error?

How to solve?

Tks,

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [November 12, 2010, 5:50pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/2 "2010-11-12T17:50:08Z")

</div>

It might actually contain h.264 video. Try using mp4: prefix to play it:

mp4:RPHChamda15seg.flv

Richard

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [July 9, 2011, 8:36am UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/3 "2011-07-09T08:36:45Z")

</div>

The mp4: tells us the file format to use. The mp4: prefix is for mov or mp4 files. It is required.

Charlie

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [November 12, 2010, 6:22pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/4 "2010-11-12T18:22:14Z")

</div>

I’m not sure how to manage it, but it is better if you use mp4 container and extension for h.264 video content.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [November 12, 2010, 8:37pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/5 "2010-11-12T20:37:12Z")

</div>

Did you record the file using Wowza? You can record to a mp4 container by using mp4: prefix in the stream name. You can do it in the encoder if you are using RTMP push encoder, or in StreamManager if you are using MediaCaster stream.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [September 3, 2011, 10:07am UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/6 "2011-09-03T10:07:52Z")

</div>

Jake,

Is it h.264 video recorded to mp4, and not using mp4: prefix?

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [September 7, 2011, 12:26am UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/7 "2011-09-07T00:26:41Z")

</div>

Jake,

I did a lot of testing recently of LiveStreamRecord with the included Flash app and HTTP interfaces using the recordOptions including append and versioning options, and it all worked in that package with those two examples.’

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [September 7, 2011, 3:55pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/8 "2011-09-07T15:55:27Z")

</div>

Jake,

I see, I didn’t know you were recording to s3 mount. That is a known problem. It can work for very small recordings, but beyond that it won’t work. You can use this to move automatically when recording is finished:

[https://www.wowza.com/docs/how-to-move-recordings-from-live-streams](https://www.wowza.com/docs/how-to-move-recordings-from-live-streams)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [December 13, 2012, 4:57pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/9 "2012-12-13T16:57:37Z")

</div>

You have to use “-2” for the start value for a live stream. Sounds like you did not do that.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [December 13, 2012, 11:45pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/10 "2012-12-13T23:45:09Z")

</div>

Great, thanks for the update. Yes, all streams have to be in same app/instance

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 1, 2013, 5:14pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/11 "2013-01-01T17:14:47Z")

</div>

I am pretty sure this message concerns vod playback, not live. So something is getting mixed up.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [June 25, 2013, 2:52pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/12 "2013-06-25T14:52:39Z")

</div>

The Application.xml goes below the /conf folder not the /applications folder

Yours should be here:

[wowza-install-dir]/conf/live/Application.xml

Richard

---

<div class="post-metadata">

**Author:** ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)\
**Post date:** [September 2, 2011, 2:23pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/13 "2011-09-02T14:23:46Z")

</div>

I’m seeing this error with a file recorded by Wowza. (MediaReaderFLV.open: Metadata appears to be bad:)

Any thoughts on why that might happen?

Thanks,

Jake

---

<div class="post-metadata">

**Author:** ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)\
**Post date:** [September 5, 2011, 7:22am UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/14 "2011-09-05T07:22:37Z")

</div>

No it’s just plain old spark video with nellymoser audio.

I am using this in combination with an s3fs mount. If the file is called something like 1.flv then the file is corrupt… but if I use a word like page.flv the file works fine. So I don’t know exactly where the issue is. If I don’t use s3fs then all works well… so I don’t think it’s a Wowza issue. Strange that if using a number then the file is corrupt.

If there are any ideas why this might happen or how to fix it and still leave the name intact that would be great.

I’ll report back with my future findings.

Thanks,

Jake

---

<div class="post-metadata">

**Author:** ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)\
**Post date:** [September 6, 2011, 11:28am UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/15 "2011-09-06T11:28:55Z")

</div>

I am not using the default stream type… but using the live-lowlatency type… which I then use the IMediaStreamActionNotify2 implementation to record the stream. I notice that if I do not try to append onto the end of the file… it records fine. If I specify that the file needs to be appended onto and the file doesn’t exist… it causes a corrupt file to be written.

Jake

---

<div class="post-metadata">

**Author:** ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)\
**Post date:** [September 6, 2011, 11:43am UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/16 "2011-09-06T11:43:49Z")

</div>

I am seeing this in the logs… hope it sheds some light on the issue:

2011-09-06 18:41:31 UTC comment server ERROR 500 - getLastTC[1]: java.lang.NullPointerException - - - 298.90

Thanks,

Jake

---

<div class="post-metadata">

**Author:** ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)\
**Post date:** [September 6, 2011, 11:51am UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/17 "2011-09-06T11:51:29Z")

</div>

It seems there is a problem with the reading file logic in append mode. I saw this in the IMediaWriter docs:

```auto
boolean localAppend = this.parent.isAppend();
if (isFirst)
{
        // determine the staring timecode
        // if we are appending we get it from the existing
        // flv file, if new file its zero
        long startTC = 0;
        if (newFile.exists())
        {
                if (localAppend)
                        startTC = FLVUtils.getLastTC(newFile);
else {
if (versionFile)
        FileUtils.versionFile(newFile);
else

```

I’m assuming it has something to do with the machine IO or something when operating on that file. I do see in the working directory of s3fs that the file is created and exists with 107 bytes or so… but in the actual s3 repo the file has 0 bytes even though it exists. It isn’t until the whole file is written to disk that it is persisted to s3.

When doing a straight record it records properly… but it must be looking for a file to append onto… and if one doesn’t exist it must put things in a weird state.

Jake

---

<div class="post-metadata">

**Author:** ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)\
**Post date:** [September 6, 2011, 12:04pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/18 "2011-09-06T12:04:51Z")

</div>

Of course if the file didn’t exist… then it shouldn’t try to append onto it… it’s probably hitting some code block I don’t have access to check out. If the file doesn’t exist… then why wouldn’t it default to just a record implementation. In the same code block section as mentioned above it is coded to do just that.

Jake

---

<div class="post-metadata">

**Author:** ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)\
**Post date:** [September 6, 2011, 12:52pm UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/19 "2011-09-06T12:52:30Z")

</div>

I’m doing this pretty straightforward… but if there is anything I can/should tweak to fix this up please let me know.

```auto
LiveStreamRecorder recorder = new LiveStreamRecorder();
		synchronized (recorders)
		{
			LiveStreamRecorder prevRecorder = recorders.get(stream_name);
			if (prevRecorder != null){
				prevRecorder.stopRecording();
			}
			recorders.put(stream_name, recorder);
		}
		// If you want to record data packets
		recorder.setRecordData(true);
		boolean append = true;
		// start recording
		recorder.startRecording(stream, append);

```

---

<div class="post-metadata">

**Author:** ![Jake\_Hilton](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@Jake\_Hilton](https://community.wowza.com/u/Jake_Hilton)\
**Post date:** [September 7, 2011, 8:40am UTC](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848/20 "2011-09-07T08:40:32Z")

</div>

Were you recording to an s3fs mounted file system? I found that to be the problem.

I have come up with a work around… by setting the file to record to a local location… and then when done copying it to the s3 repo that wowza is using as it’s content store.

I’d love to just have it work directly with the s3fs mount… but for now I’ve got a bandaid… but any headway on getting it to natively work would be awesome.

Thanks,

Jake

[Next page](https://community.wowza.com/t/mediareaderflv-open-metadata-appears-to-be-bad/34848.md?page=2)
